[feature] Provide a 'premake_multi' generator
See original GitHub issueI’m trying to use the new experimental premake generator with premake5 based on these guides: https://docs.conan.io/en/latest/reference/generators/premake.html https://docs.conan.io/en/latest/integrations/build_system/premake.html#premake
But I can’t figure out how to hook up multiple configurations in premake.
If I use conan install . -s built_type=Debug -if ./debug
to install Debug/Release builds into separate directories, then I end up with two conanbuildinfo.premake.lua
files in two separate directories (debug and release).
If I then have this in premake5.lua:
include "debug/conanbuildinfo.premake.lua"
That’ll include the debug configuration. But then what about the release configuration?
If I do this:
include "debug/conanbuildinfo.premake.lua"
include "release/conanbuildinfo.premake.lua"
Then I’m just loading two different tables on top of each other. Is this just not supported on premake, or am I doing something wrong? Any help on this would be appreciated.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
I managed to get this working using a simple function in Lua. Instead of using
include
, useinclude_conan
:Then, use the following to install Conan files into separate directories:
And then call
include_conan
at the beginning of your premake script:Projects can reference Conan variables like so:
It’s not the most elegant solution, but it’s working for me so far. Not sure if I should close the issue.
Yes, what @Zeenobit exposed above is more or less what the
xxx_multi
generators are doing internally, so seems indeed possible. Actually, forxxx_multi
generators, it might be possible that in Conan 2.0 they become the default (and only?) ones. If this functionality is important to you @Zeenobit, would you like to try to contribute suchpremake_multi
generator to Conan? It seems a valid issue, but our backlog is huge, so contributions would be appreciated here.