This is my project structure:
- cpp files
lib libname : [ glob *.cpp ] : <link>static : <define>SOMEVALUE ;
Adding a preprocessor definition uses the "define" feature as you've seen given your example. But the feature needs to be specified as a requirement of the target definition. The requirements are specified as the third argument of the target definition not the fourth as in your use case. Hence instead of:
lib libname # main-target-name : [ glob *.cpp ] # sources : <link>static # requirements : <define>SOMEVALUE # usage-requirements ;
You need to move the "" from the usage requirements to the target requirements:
lib libname # main-target-name : [ glob *.cpp ] # sources : <link>static <define>SOMEVALUE # requirements : # usage-requirements ;
You can find what all the arguments to the target definition are here.