Skip to content

Conversation

@perseoGI
Copy link
Contributor

@perseoGI perseoGI commented Nov 13, 2025

Changelog: Feature: New parameter to support custom Premake configuration names
Docs: conan-io/docs#4313

In reference to conan-io/conan-center-index#27838,
The upstream project contains some non-default configuration names:

https://github.com/utelle/wxsqlite3/blob/7c34be98c9859b7525cf3ab33b3b2c8badba6190/premake5.lua#L12:

  configurations { "Debug", "Release", "Debug wxDLL", "Release wxDLL", "Debug DLL", "Release DLL" }

Currently, we do not have any mechanism to refer to those extra configurations except Debug or Release which are captured from the build_type setting of the conanfile.

This PR introduces a mechanism to bypass that default behavior and set a different Premake configuration.

Example:

class MyRecipe(Conanfile):
    ...
    def _premake_configuration(self):
        return str(self.settings.build_type) + ("DLL" if self.options.shared else "") 

    def generate(self):
        deps = PremakeDeps(self)
        deps.configuration = self._premake_configuration
        deps.generate()
        tc = PremakeToolchain(self)
        tc.generate()

    def build(self):
        premake = Premake(self)
        premake.configure()
        premake.build(workspace="MyProject", configuration=self._premake_configuration)

Having to set the configuration in the PremakeDeps is needed (when the project has dependencies), to update the name of the Lua tables accordingly.

t_conandeps = {}
t_conandeps["releasedll_arm64"] = {}
t_conandeps["releasedll_arm64"]["zstd"] = {}
...

@uilianries
Copy link
Member

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Looks good!

@perseoGI perseoGI marked this pull request as ready for review November 14, 2025 10:44
@memsharded memsharded self-assigned this Nov 14, 2025
@memsharded memsharded merged commit 86b5918 into conan-io:develop2 Nov 14, 2025
16 checks passed
@memsharded memsharded added this to the 2.23.0 milestone Nov 14, 2025
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