Repository navigation
add defaultconfiguration API and config.getdefault - #2718
Merged
Merged
Conversation
Contributor
Author
|
The CI failure was primarily caused by some NuGet API error (504) encountered during testing. |
|
Tested and works for me, thanks for the effort. |
Jarod42
reviewed
Jun 19, 2026
samsinsane
requested changes
Jun 19, 2026
nickclark2016
requested changes
Jun 19, 2026
mercury233
force-pushed
the
patch-default-config
branch
from
June 19, 2026 23:39
9f3317c to
fcb8fc3
Compare
samsinsane
approved these changes
Jun 21, 2026
nickclark2016
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Close #2709
defaultconfigurationAPI to specify the default build configuration. For example, in gmake this controls which configuration is used when runningmakewithout explicitly passingconfig=release.config.getdefault()to centralize the logic for selecting the default configuration.defaultplatformwhen a non-existent value is specified, and update the documentation.How does this PR change Premake's behavior?
When
defaultconfigurationis specified, generators that support a default configuration will use it when selecting their default build target/configuration.When
defaultconfigurationis not specified, the expected behavior should remain consistent with the existing tests. The sorting performed byconfig.getdefault()is aligned with the workspace configuration ordering introduced by #2675, which sortedworkspace.eachconfig()for deterministic output.This can also be seen as a follow-up to #2675, extending the default-selection logic so it is shared and consistent across modules.
Anything else we should know?
There were existing design comments using the name
defaultConfiguration, so this PR preserves that API name conceptually while exposing it in Premake's usual lowercase style asdefaultconfiguration.#2675 did not update
project.eachconfig()to sort project configurations. That may have been intentional, but whether project-level configuration iteration should also be sorted may be worth discussing separately.Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!