conan 基本配置

环境配置

gcc

cmake

python 3.10

pip3 install conan

编辑conan.conf

revisions_enabled = 1
full_transitive_package_id = 1
default_package_id_mode = full_package_mode

或者用

conan config set general.revisions_enabled=True
conan config set general.full_transitive_package_id=True
conan config set general.default_package_id_mode=True

Windows : C:\Users.conan\profiles\default

[settings]

arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
os=Windows
os_build=Windows

build_type=Release
compiler.runtime=MD

# build_type=Debug
# compiler.runtime=MDd

Apple: ~/.conan/profiles/default

[settings]
os=Macos
os_build=Macos
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=14
compiler.libcxx=libc++
build_type=Release

Linux arm64: ~/.conan/profiles/default

[settings]
os=Linux
os_build=Linux
arch=armv8
arch_build=armv8
compiler=gcc
compiler.version=10.2
compiler.libcxx=libstdc++11
build_type=Release

Linux x64: ~/.conan/profiles/default

[settings]
os=Linux
os_build=Linux
os.glibc=2.27
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=10.3
compiler.libcxx=libstdc++11
build_type=Release

如果CMake报告检测到的编译器版本不一致,或者把gcc/cc的路径更新来一样

或者在default profile加上

[env]
CC=/usr/local/bin/gcc
CXX=/usr/local/bin/g++

[[maybe_unused]] 如果conan.conf要指定os.glibc=2.27, 有时候需要在settings.ym加入glibc的列表。

os:
    Windows:
        subsystem: [None, cygwin, msys, msys2, wsl]
    WindowsStore:
        version: ["8.1", "10.0"]
    WindowsCE:
        platform: ANY
        version: ["5.0", "6.0", "7.0", "8.0"]
    Linux:
        glibc: [None, "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.19", "2.20", "2.21", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27", "2.28", "2.29", "2.30", "2.31", "2.32", "2.33", "2.34"]

 

你可能感兴趣的:(conan)