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

macOS deployment target support for gcc and clang #1468

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

noresources
Copy link
Contributor

Use the value of systemversion to set the Apple-specific gcc/clang option -mmacosx-version-min=, equivalent of the Xcode setting MACOSX_DEPLOYMENT_TARGET
add tests for gcc and clang

How does this PR change Premake's behavior?
add -mmacosx-version-min= build flag on macOS when the project defines a systemversion.

Are there any breaking changes? Will any existing behavior change?
This flag will be added in all actions that use the gcc/clang getcflags and getcxxflags method. The Xcode action doesn't. It already has a similar behavior but use a Xcode setting insteaod.

Anything else we should know?
Tested on a real project on Linux (no changes) and macOS .

Add any other context about your changes here.

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

Use the value of systemversion to set the Apple-specific gcc/clang option -mmacosx-version-min=<version>, equivalent of the Xcode setting MACOSX_DEPLOYMENT_TARGET

add tests for gcc and clang
Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

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

The implementations for Clang and GCC differs quite a lot to the XCode implementation.

src/tools/clang.lua Outdated Show resolved Hide resolved
@starkos
Copy link
Member

starkos commented Jun 14, 2020

It would probably be better if you validate at the point where the value is set, to make it easier for the script author to fix it? Here's an example of how to do it.

@noresources
Copy link
Contributor Author

It would probably be better if you validate at the point where the value is set, to make it easier for the script author to fix it? Here's an example of how to do it.

The allowed values depends on project configuration (mainly os target). As I understand it, the "allowed" function only know the input value.
If there is no systemversion validation in all other actions, maybe it is better to remove it here for now.

@samsinsane
Copy link
Member

Personally, I'm against validating version numbers - to me, it's just Premake getting in the way of the user when they know exactly what the version needs to be.

@noresources
Copy link
Contributor Author

Validation has been removed in the new commit

@samsinsane
Copy link
Member

PR looks good to me, but I'll let @starkos chime in on the validation before this is merged.

@starkos starkos merged commit 5fa6d35 into premake:master Jun 16, 2020
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

3 participants