I'd like to divide the process by predefined macros with compiler options as shown below.
#ifdef HOGE
Processing 1
# else
Processing 2
#endif
What should I do with SPRESENSE IDE?
I looked around the SDK configuration, but I couldn't find it.
Can someone please teach me?
■Environment
PC: Ubuntu 18.04.4 LTS
SDK: v2.0.1
IDE:v1.2.0
The Sony Spresense SDK seems to use an orthodox Makefile.
The general notation for Makefile is that there are many sources of information on the web, so please look at them.
If you want to define a macro constant symbol for C named HOGE
, pass it to the C compiler by adding the -D
option to CFLAGS
in the Makefile.
CFLAGS+=-DHOGE
It's not a stress, it's a C language problem.
Typically, you create such a header file and write the macro for the compilation switch in it.
Another way is to define each macro with the compilation options
© 2024 OneMinuteCode. All rights reserved.