Runner Type: Xcode Project Additional command line parameters removing quotes
The runner type is Xcode Project
When running a build I am adding in additional command line parameters in order to set variables in the the Xcode project for the build.
E.g.
TEAMCITY_BUILD_NUMBER="%build.number%"
(Where build.number = 999)
Becomes:
Build settings from command line:
TEAMCITY_BUILD_NUMBER = 999
Under normal circumstances this works, but in this can I am setting a parameter that has to be put into Xcode that has its own parameters separated by spaces so they must be within quotes
E.g.
TEAMCITY_CMAKE_CONFIGURE_SETTINGS="%C_FLAG%"
(Where C_FLAG = C_FLAGS=-fsanitize=address -fsanitize=undefined)
Becomes:
Build settings from command line:
TEAMCITY_CMAKE_CONFIGURE_SETTINGS = -DCMAKE_C_FLAGS=-fsanitize=address -fsanitize=undefined
This is not acceptable as -fsanitize=undefined is read in by Xcode as a separate parameter.
For it to be read in correctly it must show
TEAMCITY_CMAKE_CONFIGURE_SETTINGS = -DCMAKE_C_FLAGS="-fsanitize=address -fsanitize=undefined"
So I tried changing C_FLAG to C_FLAGS="\"-fsanitize=address -fsanitize=undefined\""
Which works on the command line, but not on Xcode Project which converts it to
\"-DCMAKE_C_FLAGS=-fsanitize=address -fsanitize=undefined \"
From that input it is shown to either not put the quotes in the correct space to escape the inner quotes or is ignoring the inner quotes
Thanks
Please sign in to leave a comment.
Hi Brian,
Unfortunately the command line parameters parser does not currently support quotes with spaces, as you have experienced. We have a request for it in here if you would like to vote for it: https://youtrack.jetbrains.com/issue/TW-7964
I'm afraid that the XCode runner does not have any specific support for other methods (other runners do offer this support), so we would recommend using a slightly different approach to get this parameters through. Environment variables can be set at the build configuration or project level which would then be passed to the build, which in turn would need to identify them as environment variables rather than command line parameters.
If this is a common situation for you, I'd recommend opening a request in our issue tracker for the specific case in the Xcode runner: https://youtrack.jetbrains.com/issues/TW