Closed richmattes closed 3 years ago
I've confirmed that changing c++11
to c++17
, and removing the modification of CMAKE_CXX_FLAGS
altogether in test/CMakeLists.txt
both resolve the failure.
Thanks for the ticket.
I've confirmed that changing c++11 to c++17, and removing the modification of CMAKE_CXX_FLAGS altogether in test/CMakeLists.txt both resolve the failure.
Would you mind opening a PR with the flags removal approach?
@richmattes Can you check #214 for me?
Closed by #214
Environment
Description
When building ignition-common on Fedora 34 and higher, I am experiencing a build failure when compiling
plugin.cc
for theINTEGRATION_plugin
test. The command line (see Output section) doesn't include the necessary-std=c++17
, instead it includes-std=c++11
.There are a couple of conflicting C++ standards being set in different places:
libignition_common3
has anINTERFACE
target_compile_features
set forcxx_std_17
test/CMakeLists.txt
appendsstd=c++11
to theCMAKE_CXX_FLAGS
before building gtest targets and including test subdirectories.Given that the build works as expected on Fedora 33 with CMake 3.18, my guess is something changed in CMake 3.19 where the
CMAKE_CXX_FLAGS
take precedence and isn't overridden by target properties.The
CMAKE_CXX_FLAGS
intest/CMakeLists.txt
should be removed in favor of target-specific standards version selection if needed for the gtest libraries.Expected behavior: Package builds as expected, including all tests
Actual behavior: Building the INTEGRATION_plugin test fails with an error (C++17 required for
string_view
- see the Output section)Steps to reproduce
Output
Successful, and failed logs are (here)[https://copr.fedorainfracloud.org/coprs/g/robotics-sig/gazebo-latest/build/2059613/] in the builder_live logs. Excerpt of a failure case is shown below