From d8ce25efce7d41e9ec3d3cb3d04cf05104c7b89b Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 30 Jun 2020 20:30:19 -0700 Subject: [PATCH] Allow building with libstdc++ instead of libstdc++11 if people want to use the old GCC ABI --- .circleci/config.yml | 5 ----- cmake-utils/conan-setup.cmake | 21 ++++----------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f81a1f7..cacbeda7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,11 +95,6 @@ references: # Setup conan cache echo 'export CONAN_USER_HOME=/build_cache/conan' >> $BASH_ENV - if [[ "${CXX}" == *"g++"* ]]; then - # Conan uses old gcc ABI by default but we can only build with the cxx11 ABI. - conan profile new default --detect - conan profile update settings.compiler.libcxx=libstdc++11 default - fi # Setup ccache sudo ln -s /usr/bin/ccache /usr/local/bin/$CC diff --git a/cmake-utils/conan-setup.cmake b/cmake-utils/conan-setup.cmake index 24462ae9..45635e87 100644 --- a/cmake-utils/conan-setup.cmake +++ b/cmake-utils/conan-setup.cmake @@ -1,22 +1,9 @@ macro(setup_conan) include(cmake-utils/conan.cmake) - if(MSVC) - conan_cmake_run( - CONANFILE conanfile.py - BUILD missing) - else() - 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 - SETTINGS compiler.libcxx=libstdc++11) - endif() - conan_basic_setup(TARGETS SKIP_STD) + conan_cmake_run( + CONANFILE conanfile.py + BUILD missing) - if(CONAN_SETTINGS_COMPILER_LIBCXX STREQUAL "libstdc++") - # TODO Test this warning works correctly and that the proposed solution in the warning message works. - message(FATAL_ERROR "Conan is set up to build against libstdc++ (i.e. the legacy GCC ABI). We only support libstdc++11 (i.e. the new GCC ABI).\nPlease add the '-s compiler.libcxx=libstdc++11' argument when running 'conan install'.") - endif() + conan_basic_setup(TARGETS SKIP_STD) endmacro()