Okay, let me run through how it all will works:
import features : feature subfeature properties ;
feature optimization : off speed space ; feature define : : free ; #something more
# We need this to get permissible values for toolset import gcc-tools ; #inside gcc-tools.jam features.extend toolset : gcc ; # All compilers have the same definition for this. Better factor out, along with define, etc. flags gcc CFLAGS <cflags> ; # There are things common to just several compilers, I think import unix-like-system ; # This might get code to library search... #left # A question: we need to include toolset descriptions anyway, why ``executed'' features? Will toolset description modules # be included once for each target? import stlport ;
... exe foo : foo.cpp : <std-library>stlport ; ... for gcc debug build, after expanding properties, we have: <debug-symbols>on <runtime-build>debug <optimization>off <inlining>off <sys-include>$(STLPORT_ROOT)/STLPort? ... and it's ok.
I don't remember who raised this question (remind me!), but what if we want full optimization to mean -05 with g++-3.0 and -02 with g++ 2.95.2? Seems like with subfeatures it's easy:
flags gcc-2.95.2 CFLAGS <optimization>full : -02 ; flags gcc-3.0 CFLAGS <optimization>full : -05 ;Well, I like this!