question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Provide a 'premake_multi' generator

See original GitHub issue

I’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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Zeenobitcommented, Mar 6, 2020

I managed to get this working using a simple function in Lua. Instead of using include, use include_conan:

local function include_conan(filename)
    include(filename)
    local buildinfo = { }
    local prefix = 'conan_'
    for k, v in pairs(_G) do
        if k:sub(1, #prefix) == prefix then
            buildinfo[k:sub(#prefix + 1)] = v
        end
    end
    return buildinfo
end

Then, use the following to install Conan files into separate directories:

conan install .. -if ./conan_debug   -s build_type=Debug
conan install .. -if ./conan_release

And then call include_conan at the beginning of your premake script:

conan_debug   = include_conan "conan_debug/conanbuildinfo.premake.lua"
conan_release = include_conan "conan_release/conanbuildinfo.premake.lua"

Projects can reference Conan variables like so:

        libdirs {
            conan_debug.libdirs
        }

It’s not the most elegant solution, but it’s working for me so far. Not sure if I should close the issue.

0reactions
memshardedcommented, Mar 8, 2020

Yes, what @Zeenobit exposed above is more or less what the xxx_multi generators are doing internally, so seems indeed possible. Actually, for xxx_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 such premake_multi generator to Conan? It seems a valid issue, but our backlog is huge, so contributions would be appreciated here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Documentation: Feature Generators - MAST-ML
This module contains a collection of classes for generating input features to fit machine learning models to. BaseGenerator: Base class to provide MAST-ML...
Read more >
Generator Features
Benefits & Uses of Diesel Generators · Lower maintenance costs · No spark plugs · Constructed from stronger metals · Larger engines ·...
Read more >
Generator Specification Sheets | How to Read & Interpret Specs
The specification sheet is divided into the following four pages: Description, Features and Ratings - Provides description, features and ratings information.
Read more >
Generators - IBM
A generator is a set of methods and objects that can be used for managing asynchronous processes in a synchronous manner.
Read more >
Generator Buying Guide: What features should you consider?
So, you know you need a portable generator for home, work or play. It's important to take a look at all the available...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found