dimanche 15 septembre 2019

How to specify an array of integers as compiler commandline define -D

I would like to be able to specify at compile time a list of integers These integers are used to output debug information on certain components in my system which have those intgers as id. The actual implementatio of printing that debug information is in one of our own libraries, but I need to be able to specify which ids I want to debug from the project that is using that library, with something like

-DDEBUG_SENSOR_VALUES="12,23,45"

In the actual C++ code the define (when present of course) needs to be converted to an array or vector of integers.

How can I achive this?

Aucun commentaire:

Enregistrer un commentaire