Boost logo

Boost-Build :

Subject: [Boost-build] gcc -std=c99 only for C, ObjC (not C++, ObjC++) files
From: Igor Palaguta (pala85_at_[hidden])
Date: 2008-12-11 08:08:34


Hello,
I have following target were I have both C++ and C sources

exe some_exe
   : [ glob *.cpp *.c *.mm *.m ]
;

And I want to add additional flag only for C-sources -std=c99

exe some_exe
   : [ glob *.cpp *.c *.mm *.m ]
   : <cflags>-std=c99
;

but in this case <cflags> affects also C++ sources and during compilation we have warnings (undefined compilation argument).
Also we can compile .c .m files separately with this flag:

exe some_exe
   : [ glob *.cpp *.mm ]
     [ obj obj1 : src1.m : <cflags>-std=c99 ]
     [ obj obj2 : src2.c : <cflags>-std=c99 ]
...
;

but number of files can be too great

Can we create new flag (without modifying existent darwin.jam, gcc.jam) or set -std=c99 by default?

Please can you advise what desicion is good in this case

Thanks,
Igor Palaguta


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk