...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
If one file must be compiled with special options, you need to
explicitly declare an obj
target for that file and then use
that target in your exe
or lib
target:
exe a : a.cpp b ; obj b : b.cpp : <optimization>off ;
Of course you can use other properties, for example to specify specific compiler options:
exe a : a.cpp b ; obj b : b.cpp : <cflags>-g ;
You can also use conditional properties for finer control:
exe a : a.cpp b ; obj b : b.cpp : <variant>release:<optimization>off ;