Show or write preprocessor macros during build

Is it possible to write or print preprocessor macros in Xcode for build results?

I want to see current specific macros during build.

For example, if I defined DEBUG and TESTSERVER as a preprocessor macro, there should be some lines in the assembly results, for example:

  • Compile class .m ....
  • GenerateDSYMFile .....
  • Macros Used: DEBUG, TESTSERVER ...

Maybe there is a custom shell script that can be executed after the build.

+3
source share
2 answers

OK I found the solution in the Apple documentation

Just enter the echo $GCC_PREPROCESSOR_DEFINITIONSscript into the build phase.

+5
source

Run Script , " ", . Script , , . , , - , .

, " Script", .

, ,

setenv GCC_PREPROCESSOR_DEFINITIONS "DEBUG=1 Debug=1"

+1

Source: https://habr.com/ru/post/1785203/


All Articles