Xcode Preprocessor Macros

In Xcode, I can edit the preprocessor macros in the project settings. I want to create a macro that references an environment variable. Basically, I want to be able to reference $ SRC_ROOT in my code. In my macros, I have:

SRC_ROOT=${SRC_ROOT}

but it does not work.

+3
source share
1 answer

In the Xcode build settings, you are not actually referring to the value of the environment variable. Instead, you refer to the value of the assembly installation. The syntax for this is the Makefile style $(SETTING_NAME), not the shell style ${SETTING_NAME}you used above.

So what do you want to do, add

SRC_ROOT="$(SRCROOT)"

in the assembly settings Macros for the preprocessor .

, , , , .

( pch) . 2190: Xcode : , , , Xcode , .

+20

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


All Articles