Boost logo

Boost-Build :

Subject: [Boost-build] cxxflags and compilation of C files with clang
From: Wieger Wesselink (wieger_at_[hidden])
Date: 2013-03-26 04:44:19

When compiling a C file with clang it looks like cxxflags settings are
being passed to the compiler. My Jamroot contains

exe a : a.c : ;

When I use

b2 gcc cxxflags=-std=c++11

the result is an error:

compile.c.without-pth bin/clang-linux-3.0/debug/a.o
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'

  "clang++" -c -x c -O0 -g -std=c++11 -fno-inline -Wall -g -fPIC -c
  -o "bin/clang-linux-3.0/debug/a.o" "a.c"

...failed compile.c.without-pth bin/clang-linux-3.0/debug/a.o...

When I use gcc instead

b2 gcc cxxflags=-std=c++11

everything works fine.

Is this a problem in Boost.Build?



-- - The professional email service

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at