c++ - add #define when a specific flag is used -


i want add #define foo code in header file autotools when used specific flag.

the project have creates static library using header use inline functions example. if use -d option, used @ creation time i'll have add @ each compilation using library want avoid.

how can perform this?

i think best bet generate required header file pre-existing file. following shell command trick:

(echo "#define foo" ; cat myheader_pregen.hpp) > myheader.hpp 

you can incorporate above script autotools this


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -