Skip to content

Comments

macOS deployment target support for gcc and clang#1468

Merged
starkos merged 2 commits intopremake:masterfrom
noresources:toolset-macosx-systemversion
Jun 16, 2020
Merged

macOS deployment target support for gcc and clang#1468
starkos merged 2 commits intopremake:masterfrom
noresources:toolset-macosx-systemversion

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.

@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.

3 participants