Skip to contentSkip to conversation

flatcc: add dependency on C++11

PATCH New Joel Carlson 3 participants 4 messages Sep 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flatcc: add dependency on C++11

Some of the components built by flatcc require C++. Also, while older toolchains may work, C11/C++11 is the reference that is expected to always work.

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

---
 package/flatcc/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)
package/flatcc/Config.in +7 -0
index 6273f2b..557bd9b 100644
@@ -1,8 +1,15 @@
 config BR2_PACKAGE_FLATCC
 	bool "flatcc"
+	# Some components require C++, and C11/C++11 is the reference
+	# expected to always work
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 	help
 	  flatcc is C language implementation of Google Flatbuffers. It
 	  consists of both a library for the target as well as a
 	  flatbuffer compiler tool for the host.
 
 	  https://github.com/dvidelabs/flatcc
+
+comment "flatcc needs a toolchain w/ C++11"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 flatcc: add dependency on C++11

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joel" == Joel Carlson <[email protected]> writes:

Some of the components built by flatcc require C++. Also, while older toolchains may work, C11/C++11 is the reference that is expected to always work.

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

This is an autobuilder on the next branch. Does this mean that only 0.5.2 is affected and not 0.5.1 (the verison on master)?

Quoted 10 lines
---
 package/flatcc/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)
package/flatcc/Config.in +0 -0
index 6273f2b..557bd9b 100644

package/flatcc/Config.in line 10

Quoted 10 lines
package/flatcc/Config.in +4 -0
@@ -1,8 +1,15 @@
 config BR2_PACKAGE_FLATCC
 	bool "flatcc"
+	# Some components require C++, and C11/C++11 is the reference
+	# expected to always work
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 	help
 	  flatcc is C language implementation of Google Flatbuffers. It
 	  consists of both a library for the target as well as a
 	  flatbuffer compiler tool for the host.

It is a bit odd that a "C language implementation" really needs C++. Are you sure this isn't just for some kind of optional C++ binding?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 flatcc: add dependency on C++11

Hello,

Quoted 7 lines · Peter Korsgaard
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Joel" == Joel Carlson <[email protected]> writes:

Some of the components built by flatcc require C++. Also, while older toolchains may work, C11/C++11 is the reference that is expected to always work.

Quoted 5 lines
Quoted 2 lines

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

This is an autobuilder on the next branch. Does this mean that only 0.5.2 is affected and not 0.5.1 (the verison on master)?

Sorry, I failed to pay attention to the branches. This is appropriate for next, not master. It looks like some CXX stuff was added into the CMake files after 0.5.1.

Quoted 16 lines
Quoted 16 lines
---
 package/flatcc/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)
package/flatcc/Config.in +3 -0
index 6273f2b..557bd9b 100644
@@ -1,8 +1,15 @@
 config BR2_PACKAGE_FLATCC
     bool "flatcc"
+    # Some components require C++, and C11/C++11 is the reference
+    # expected to always work
+    depends on BR2_INSTALL_LIBSTDCPP
Quoted 8 lines

package/flatcc/Config.in line 10

Quoted 5 lines
package/flatcc/Config.in +1 -0
+    depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
     help
       flatcc is C language implementation of Google Flatbuffers. It
       consists of both a library for the target as well as a
       flatbuffer compiler tool for the host.

It is a bit odd that a "C language implementation" really needs C++. Are you sure this isn't just for some kind of optional C++ binding?

I will dig into this a bit deeper. The immediate thing I had noticed was that CMakeLists.txt changed:
- project (FlatCC C)
+ project (FlatCC C CXX)

I only see a single .cpp file, which is in a tests folder. I will see if I can pass/set some options so that C++ isn't necessary, and will send a new patch if I find that to be the case.

Quoted 3 lines

--
Bye, Peter Korsgaard

#3 lore raw

PATCH 1/1 flatcc: add dependency on C++11

Hello,

Quoted 8 lines · Joel Carlson

I will dig into this a bit deeper. The immediate thing I had noticed was that CMakeLists.txt changed:
- project (FlatCC C)
+ project (FlatCC C CXX)

I only see a single .cpp file, which is in a tests folder. I will see if I can pass/set some options so that C++ isn't necessary, and will send a new patch if I find that to be the case.

I see two .cpp files, but indeed both in tests/

$ find . -name '*.cpp'
./test/benchmark/benchflatc/benchflatc.cpp
./test/monster_test_cpp/monster_test.cpp

There is already an option to enable/disable tests:

option(FLATCC_TEST "enable tests" ON)

and we already disable building tests in flatcc.mk:

# Disable build of tests and samples
FLATCC_CONF_OPTS += -DFLATCC_TEST=OFF
HOST_FLATCC_CONF_OPTS += -DFLATCC_TEST=OFF

The CMakeLists.txt needs to be fixed to only require a C++ compiler when tests are enabled.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com