Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Carlson <joelsoncarl@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH/next v2] flatcc: conditionally require c++ in cmake
Date: Thu,  6 Sep 2018 15:11:29 -0600	[thread overview]
Message-ID: <1536268289-23275-1-git-send-email-JoelsonCarl@gmail.com> (raw)

Patches CMake files in flatcc to conditionally set c++ as a required
language depending on if FLATCC_TEST option is set, as only the tests
include a c++ file.

Fixes
http://autobuild.buildroot.net/results/8fb0447eed1d55b7687f657530e31695cf77ce5c/

Signed-off-by: Joel Carlson <JoelsonCarl@gmail.com>
---
Changes v1 -> v2:
  - patch CMake files to not require C++ when we don't build the tests,
    instead of making flatcc package require C++

Original patch was accidentally to master instead of next, and different subject
https://patchwork.ozlabs.org/patch/967100/
---
 ...txt-conditionally-require-C-based-on-FLAT.patch | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/flatcc/0001-CMakeLists.txt-conditionally-require-C-based-on-FLAT.patch

diff --git a/package/flatcc/0001-CMakeLists.txt-conditionally-require-C-based-on-FLAT.patch b/package/flatcc/0001-CMakeLists.txt-conditionally-require-C-based-on-FLAT.patch
new file mode 100644
index 0000000..7d76d6c
--- /dev/null
+++ b/package/flatcc/0001-CMakeLists.txt-conditionally-require-C-based-on-FLAT.patch
@@ -0,0 +1,56 @@
+From 878d51187bbc1ad490b4cd15e3741bc0bd11b6b2 Mon Sep 17 00:00:00 2001
+From: Joel Carlson <JoelsonCarl@gmail.com>
+Date: Thu, 6 Sep 2018 14:53:20 -0600
+Subject: [PATCH] CMakeLists.txt: conditionally require C++ based on
+ FLATCC_TEST (#94)
+
+C++ is only used when building the tests, so only include it as a
+language via project() when FLATCC_TEST is enabled. This allows
+toolchains that don't have C++ to build flatcc.
+
+Signed-off-by: Joel Carlson <JoelsonCarl@gmail.com>
+---
+Upstream commit 878d51187bbc1ad490b4cd15e3741bc0bd11b6b2
+---
+ CMakeLists.txt | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b39a3d1..5df5161 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -4,7 +4,18 @@
+ #cmake_minimum_required (VERSION 2.8.11)
+ cmake_minimum_required (VERSION 2.8)
+ 
+-project (FlatCC C CXX)
++# Disable build of tests and samples. Due to custom build step
++# dependency on flatcc tool, some custom build configurations may
++# experience issues, and this option can then help.
++option(FLATCC_TEST "enable tests" ON)
++
++# Conditionally set project languages based on FLATCC_TEST, as C++ is
++# only necessary if building the tests.
++if (FLATCC_TEST)
++    project (FlatCC C CXX)
++else()
++    project (FlatCC C)
++endif()
+ 
+ #
+ # NOTE: when changing build options, clean the build using on of:
+@@ -35,11 +46,6 @@ option(FLATCC_RTONLY "enable build of runtime library only" OFF)
+ # cmake -DBUILD_SHARED_LIBS=on can override.
+ option(FLATCC_INSTALL "enable build of runtime library only" OFF)
+ 
+-# Disable build of tests and samples. Due to custom build step
+-# dependency on flatcc tool, some custom build configurations may
+-# experience issues, and this option can then help.
+-option(FLATCC_TEST "enable tests" ON)
+-
+ # Use with debug build with testing enabled only. Enables generation
+ # of coverage information during build and run. Adds target "coverage"
+ # which collects data and makes HTML report in build directory
+-- 
+2.7.4
+
-- 
2.7.4

             reply	other threads:[~2018-09-06 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 21:11 Joel Carlson [this message]
2018-09-08 13:47 ` [Buildroot] [PATCH/next v2] flatcc: conditionally require c++ in cmake Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536268289-23275-1-git-send-email-JoelsonCarl@gmail.com \
    --to=joelsoncarl@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox