PremakeDeps

Warning

This feature is experimental and subject to breaking changes. See the Conan stability section for more information.

The PremakeDeps is the dependencies generator for Premake.

The PremakeDeps generator can be used by name in conanfiles:

conanfile.py

  1. class Pkg(ConanFile):
  2. generators = "PremakeDeps"

conanfile.txt

  1. [generators]
  2. PremakeDeps

And it can also be fully instantiated in the conanfile generate() method:

  1. from conan import ConanFile
  2. from conan.tools.premake import PremakeDeps
  3. class App(ConanFile):
  4. settings = "os", "arch", "compiler", "build_type"
  5. requires = "zlib/1.2.11"
  6. def generate(self):
  7. bz = PremakeDeps(self)
  8. bz.generate()

Generated files

When the PremakeDeps generator is used, every invocation of conan install will generate a include('conandeps.premake5.lua') that can be included and used in the project:

  1. -- premake5.lua
  2. include('conandeps.premake5.lua')
  3. workspace "HelloWorld"
  4. conan_setup()
  5. configurations { "Debug", "Release" }
  6. platforms { "x86_64" }