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

Build with a spec's compile_flags directive. #73

Merged
merged 3 commits into from Apr 8, 2015
Merged

Build with a spec's compile_flags directive. #73

merged 3 commits into from Apr 8, 2015

Conversation

michaelmelanson
Copy link
Contributor

This change makes cocoapods-packager use a podspec's compiler_flag/compiler_flags when building the pod for packaging. Two further related changes are made:

  • In addition to adding tests for the new behaviour, tests for the code that produced compiler flags (e.g. GCC_PREPROCESSOR_DEFINITIONS and ARCHS) are added.
  • It renames the old specs/specification/builder_spec.rb to specs/specification/spec_builder_spec.rb which is a better name (it tests the SpecBuilder class, not Builder).

Note that it does not add these compiler flags to the generated podspec, so a project using the generated pod will not have these flags set. I think this is the expected behaviour.

@@ -89,6 +90,7 @@ def build_with_mangling(platform)

def compile(platform)
defines = "GCC_PREPROCESSOR_DEFINITIONS='PodsDummy_Pods_#{@spec.name}=PodsDummy_PodPackage_#{@spec.name}'"
defines += " #{@spec.consumer(platform).compiler_flags.join(' ')}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could just be defines << @spec.consumer(platform).compiler_flags.join(' ')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, could definitely change += to << if you'd like, but it needs the leading space on that string.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then just << ' ' <<

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 92.0% when pulling faa7d79 on toushay:feature/compile_flags into bfa05c8 on CocoaPods:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 92.0% when pulling faa7d79 on toushay:feature/compile_flags into bfa05c8 on CocoaPods:master.

neonichu added a commit that referenced this pull request Apr 8, 2015
Build with a spec's `compile_flags` directive.
@neonichu neonichu merged commit 85eb7b5 into CocoaPods:master Apr 8, 2015
@neonichu
Copy link
Member

neonichu commented Apr 8, 2015

LGTM, thanks for the contribution!

@michaelmelanson
Copy link
Contributor Author

Thanks!

@michaelmelanson michaelmelanson deleted the feature/compile_flags branch April 8, 2015 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants