3

如何在 conanfile.txt 中设置编译器和架构设置?我试过把它放进去

[settings]
arch=x86

但我得到了Unrecognized field: settings。我怎样才能做到这一点?

4

1 回答 1

3

您可能会将conanfile.txt与配置文件混淆。是一个解释如何格式化和使用配置文件的链接。

一个名为myprofile

[env]
# Where is our C compiler
CC=/usr/bin/x86_64-w64-mingw32-gcc
# Where is our CPP compiler
CXX=/usr/bin/x86_64-w64-mingw32-g++

[settings]
# We are building in Ubuntu Linux
os_build=Linux
arch_build=x86_64

# We are cross building to Windows
os=Windows
arch=x86_64
compiler=gcc
# Adjust to the gcc version of your MinGW package
compiler.version=6.3
compiler.libcxx=libstdc++11
build_type=Release

你可以像这样使用它:

$ conan install --profile /abs/path/to/myprofile  # abs path
$ conan install --profile ./relpath/to/myprofile  # resolved to current dir
$ conan install --profile myprofile  # resolved to user/.conan/profiles/myprofile
于 2018-05-23T12:13:14.857 回答