如何将带有多参数的cxxflag传递给boost.b2

时间:2018-09-29 10:19:33

标签: boost b2

我想将c++14-fPIC传递给boost.b2和buid静态库。使用:cxxflags="--std=c++14 -fPIC"并出现以下错误:

g++: error: unrecognized command line option ‘--std=c++14 -fPIC’

    "g++"   -pthread -O3 -finline-functions -Wno-inline -Wall "--std=c++14 -fPIC" -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE -DBOOST_ATOMIC_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-5.4.0/release/link-static/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"

如果像这样的"删除./b2 cxxflags=--std=c++14 -fPIC link=static install,则会在错误下方出现:

PIC: No such file or directory
don't know how to make cxxflags=--std=c++14
don't know how to make link=static

最后,我这样解决:

./b2 cflags=-fPIC cxxflags=--std=c++14 link=static install

如果需要两个以上的参数,那就没办法了。

1 个答案:

答案 0 :(得分:0)

您可以多次指定 cflags= 以添加多个标志