Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions reference/tools/premake/premake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,40 @@ 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 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

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)