From 19a702e32292c0c7d80b5643df454b839c85307b Mon Sep 17 00:00:00 2001 From: PerseoGI Date: Fri, 14 Nov 2025 13:12:52 +0100 Subject: [PATCH 1/2] Pramake: added example for using a custom configuration --- reference/tools/premake/premake.rst | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/reference/tools/premake/premake.rst b/reference/tools/premake/premake.rst index 75d8a44eb5a3..b68d768f7f9f 100644 --- a/reference/tools/premake/premake.rst +++ b/reference/tools/premake/premake.rst @@ -57,3 +57,38 @@ The ``Premake`` build helper is affected by these ``[conf]`` variables: - ``tools.build:verbosity`` which accepts one of ``quiet`` or ``verbose`` and sets the ``--quiet`` flag in ``Premake.configure()`` - ``tools.compilation:verbosity`` which accepts one of ``quiet`` or ``verbose`` and sets the ``--verbose`` flag in ``Premake.build()`` + +Extra configuration +------------------- + +By default, typical Premake configurations are ``Release`` and ``Debug``. +This configurations could vary depending on the used Premake script. + +For example, + +.. code-block:: lua + + workspace "MyProject" + configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" } + +If you wish to use a different configuration than ``Release`` or ``Debug``, you can override the configuration from ``PremakeDeps`` +and ``Premake`` generator: + +.. code-block:: python + + 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) From 4cff3ecf94e97026ba65d31e65e8d6cff9afda5c Mon Sep 17 00:00:00 2001 From: PerseoGI Date: Tue, 25 Nov 2025 10:23:51 +0100 Subject: [PATCH 2/2] Clarification --- reference/tools/premake/premake.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/tools/premake/premake.rst b/reference/tools/premake/premake.rst index b68d768f7f9f..eea763a495a5 100644 --- a/reference/tools/premake/premake.rst +++ b/reference/tools/premake/premake.rst @@ -71,8 +71,10 @@ For example, workspace "MyProject" configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" } -If you wish to use a different configuration than ``Release`` or ``Debug``, you can override the configuration from ``PremakeDeps`` -and ``Premake`` generator: +If you wish to use a different configuration than ``Release`` or ``Debug``, you can override the configuration from the ``Premake`` generator. + +If the project also have dependencies, you will also need to override the +``configuration`` property of the ``PremakeDeps`` generator accordingly, with the same value. .. code-block:: python