how to pass cxxflag with mutli-parameters to boost.b2

1.3k Views Asked by At

i want to pass c++14 and -fPIC to boost.b2 and buid static lib. use :cxxflags="--std=c++14 -fPIC" and occur below error:

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"

if delete the ", like this ./b2 cxxflags=--std=c++14 -fPIC link=static install, will occur below error:

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

at last, i workaround it like this:

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

if need more than two parameter, it is no way now.

1

There are 1 best solutions below

0
On

You can specify cflags= multiple times to add multiple flags