libcryfs/cmake-utils/conan-setup.cmake

25 lines
1.3 KiB
CMake
Raw Normal View History

2020-02-24 00:51:48 -08:00
macro(setup_conan)
include(cmake-utils/conan.cmake)
2020-06-27 00:53:55 -07:00
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
2020-06-29 01:35:03 -07:00
# Note: This way of passing compiler.libcxx seems to work, but there's an issue. See https://github.com/conan-io/cmake-conan/issues/255
# see also as a related issue: https://github.com/conan-io/cmake-conan/issues/256
2020-06-27 00:53:55 -07:00
SETTINGS compiler.libcxx=libstdc++11)
endif()
2020-02-24 00:51:48 -08:00
conan_basic_setup(TARGETS SKIP_STD)
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()
endmacro()