Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the 'xcodeproj' argument doesn't respect SWIFT_OPTIMIZATION_LEVEL flags #354

Closed
skydivedan opened this issue Feb 5, 2016 · 6 comments
Closed

Comments

@skydivedan
Copy link

exact copy of this issue: CocoaPods/CocoaPods#4867

I'm having trouble using the "xcodeproj" (soon to be "project") argument in my Podfile.

I'm using the "xcodeproj" argument to describe which configurations should be treated as "debug" and which should be treated as "release" like this:

xcodeproj 'SpecialProj', 'DEV' => :debug, 'QA' => :debug, 'PROD' => :release

While this flag does set the optimization levels correctly for Apple LLVM 7.0, it does not do something similar for the Swift compiler. Shouldn't it?

@skydivedan
Copy link
Author

I'm using cocopods 0.39, and Xcode 7.2

@segiddins
Copy link
Member

In debug on master it seems to be set to SWIFT_OPTIMIZATION_LEVEL = -Onone, so...

@skydivedan
Copy link
Author

Yes, the "debug" configuration does get set to "-0none", but the rest of the configs don't.

If I select the "Pods" project in my workspace, I see this:
screen shot 2016-02-05 at 12 57 17 pm

notice how "DEV" and "QA" have their flags set, in the LLVM section, but NOTHING in the Swift Compiler section.

however, I select an individual pod from the target list, there is a "Debug" configuration, and it is set to -0none. However, DEV & QA configs are not, and set to "Fast[-0]"

@segiddins
Copy link
Member

If they're not set, they'll use the default. Same as when you create a new framework via the Xcode new target menu.

@skydivedan
Copy link
Author

OK, here's a video of what I'm doing.
https://youtu.be/6srQt_00dAU

It's 5 minutes long, unedited. I do the following:

  1. Create a new Framework & Library, and then show the optimization settings in Release & Debug.
  2. I create three new configs, named DEV, QA and PROD. (only PROD is based on Release).
  3. I close the project, go into terminal and create a new Podfile, and specify the xcodeproj flag.
    (there was a typo, which caused an error when doing 'pod update', so you see me fix it).
  4. I do a 'pod update', and then open the workspace file.
  5. I show the optimization settings for the main project, then the Pods project.

End result is while the config named "Debug" does have Swift optimizations turned to "none", QA & DEV do not (although the do in the LLVM).

@segiddins
Copy link
Member

Issue stems from

new_config.build_settings = common_build_settings(:release, platform, deployment_target, target_product_type, language)
, I could reproduce it -- basically, whether a build configuration is based on debug or release isn't persisted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants