From f8c0bb8b973aa2b4aa4e204152ab4082f3f13637 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 30 Jun 2020 20:18:50 -0700 Subject: [PATCH] Use SETTINGS to set compiler.libcxx --- cmake-utils/conan-setup.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmake-utils/conan-setup.cmake b/cmake-utils/conan-setup.cmake index 4147320e..24462ae9 100644 --- a/cmake-utils/conan-setup.cmake +++ b/cmake-utils/conan-setup.cmake @@ -6,20 +6,12 @@ macro(setup_conan) CONANFILE conanfile.py BUILD missing) else() - # We're using set(_GLIBCXX_USE_CXX11_ABI 1), because conan_cmake_run looks at that variable - # to set conan to libstdc++11 instead of libstdc++. This would also work by passing in - # a "SETTINGS compiler.libcxx=libstdc++11" to conan_cmake_run, but for some reason the logs - # then show that conan ran with both "-s compiler.libcxx=libstdc++ -s compiler.libcxx=libstdc++11" - # which seems wrong. Using the set() approach instead, that command line only has the correct - # "-s compiler.libcxx=libstdc++11". - # See https://github.com/conan-io/cmake-conan/issues/255 - # We're using set() instead of add_definitions() because of https://github.com/conan-io/cmake-conan/issues/256 - set(_GLIBCXX_USE_CXX11_ABI 1) conan_cmake_run( CONANFILE conanfile.py # We'd like to use "BUILD missing" but that doesn't work because conan sometimes seems to download prebuilt packages with compiler.libcxx=libstdc++ even though we specify compiler.libcxx=libstdc++11. # see https://github.com/cryfs/cryfs/issues/336 and https://github.com/conan-io/conan/issues/7264 - BUILD all) + BUILD all + SETTINGS compiler.libcxx=libstdc++11) endif() conan_basic_setup(TARGETS SKIP_STD)