简体   繁体   中英

xcodebuild from command line: compile flag for file

I have TeamCity integration with some iOS project. Teamcity use bash script with xcodebuild. But now I need to provide -fobjc-arc compile flag for only one file. How can I do it through command line?

Why don't you add the flag in the Xcode project for the file? If this is needed for it to build then wouldn't it be needed when building from Xcode or from the command line?

To set a compile flag on a specific file:

  • In the project navigator, select your project.
  • Select the target that contains the file
  • Select the "Build Phases" tab.
  • Open the "Compile Sources" section
  • Find the file you want to add the flag to
  • Double-click the file you want to add the flags to.
  • An edit window opens under the "Compiler Flags"
  • On the edit window type -fobj-arc and press Enter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM