Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update performance_test_fixture to C++17. (#21)
The two reasons to do this are: 1. So that we can compile performance_test_fixture with the clang static analyzer. As of clang++-14 (what is in Ubuntu 22.04), the default still seems to be C++14, so we need to specify C++17 so that new things in the rclcpp headers work properly. 2. So we can build with a newer version of gtest which requires this. Further, due to reasons I don't fully understand, I needed to set CMAKE_CXX_STANDARD_REQUIRED in order for clang to really use that version. So set this as well. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
- Loading branch information
fe9857b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the build at least on the latest MacOS with the latest XCode.
osrf_testing_tools_cpp keeps using C++11 and, thus, uses "mpark variant" while performance_test_fixture starts expecting "std::variant".
That causes symbols mismatch during linking and, thus:
<<<
--- stderr: performance_test_fixture
Undefined symbols for architecture x86_64:
"osrf_testing_tools_cpp::memory_tools::on_unexpected_calloc(std::__1::variant<std::__1::function<void (osrf_testing_tools_cpp::memory_tools::MemoryToolsService&)>, std::__1::function<void ()>, std::nullptr_t>)", referenced from:
performance_test_fixture::PerformanceTest::SetUp(benchmark::State&) in performance_test_fixture.cpp.o
"osrf_testing_tools_cpp::memory_tools::on_unexpected_malloc(std::__1::variant<std::__1::function<void (osrf_testing_tools_cpp::memory_tools::MemoryToolsService&)>, std::__1::function<void ()>, std::nullptr_t>)", referenced from:
performance_test_fixture::PerformanceTest::SetUp(benchmark::State&) in performance_test_fixture.cpp.o
"osrf_testing_tools_cpp::memory_tools::on_unexpected_realloc(std::__1::variant<std::__1::function<void (osrf_testing_tools_cpp::memory_tools::MemoryToolsService&)>, std::__1::function<void ()>, std::nullptr_t>)", referenced from:
performance_test_fixture::PerformanceTest::SetUp(benchmark::State&) in performance_test_fixture.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libperformance_test_fixture.dylib] Error 1
make[1]: *** [CMakeFiles/performance_test_fixture.dir/all] Error 2
make: *** [all] Error 2