-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename PremakeDeps to PremakeMultiDeps and add single configuration PremakeDeps #17355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @Enhex
All Conan 2 generators are multi-config when applicable. If PremakeDeps
is not, it has to be fixed, the intent is that it is multi-config, and it can be considered a bug if not.
Given the other PR and how it was broken, it is almost guaranteed that nobody was using it at least on Windows, it is very low risk to fix it there.
It would be good to do the improvements on top of #17350, lets try to merge it soon, so you can contribute on top of it.
Thanks again for your contribution!
I'm not sure how to fix the existing multi-config PremakeDeps. when generating and using a multi-config build, how do you select which config to use? it means that it can't work with the current approach of letting perhaps the author of the current generator can explain how to properly use it. |
Maybe @Ohjurot can also give some insights into this? |
Hello together, first of all thank you for the feedback the proposed changes! Maybe first some background information on my inteds when porting the premake generator to conan2: My main intend was to build a working multi-configuration workflow for windows and linux (I dont have any Apple hardware... CI said we are good). My development flow is as follows:
The whole generate has been written in a way so that it is compatible with this kind of multi configuration workflows. The observed behavior in #17345 expected behavior because the case was never covered by the efforts back then. However I see the point that an automatically detection is beneficial. In case you want to see a (maybe a bit over engineered) version of my workflow, I have a project template that I use for all my (personal and youtube) projects as well as projects that I developed at work (previouse and current employer - thus production code): https://github.com/Moxibyte/MoxPP A short comment on the bug: Now some comments on the suggested changes: However with the suggested changes I have some concerns. All of them are more philosophically concerns than actual technical issues:
So I personally would not recommend merging this PR! What I would recommend rather than merging this PR: Suggested API / conaninfo = {}
conaninfo["configurations"] = {}
conaninfo["configurations"]["release_x86_64"] = { "release", "x86_64" }
conaninfo["configurations"]["debug_x86_64"] = { "debug", "x86_64" } -- Would be generate for multiple configurations
-- Maybe even more information about the conan environment... List of libs... etc... Suggested API / Public premake-conan API: -- All of the following functions would print a YELLOW warning in case the array has more than one element
conaninfo_get_current() -- Return the key of the first array element ("release_x86_64")
conaninfo_get_configuration() -- Returns the fist value of the arrays first element ("release")
conaninfo_get_architecture() -- Returns the second value of the arrays first element ("x86_64") This would allow you (@Enhex) to adapt your preamek5.lua file like this: -- ...
workspace("nanovg")
location(location_dir)
architecture(conaninfo_get_architecture())
configurations { conaninfo_get_configuration() }
project("nanovg"):
-- ...
conan_setup()
-- ... This would also empower more advanced usage. Conclusion: |
@memsharded I have see you already did some work on the toolchain in your recent PR #17350 very nice :D Thank you! Is it still desired that I take on the work on this generator to abstract away all the OS dependent if else logic from the "users" recipes into the generator? This was some draft that I was working on some month ago: |
yes, I also agree with these points, and I think that this PR shouldn't be merged. I also agree that I see some potential for improvements, as long as they are compatible and not breaking, with confs/opt-ins
Yes, not really the toolchain, but the |
Premake's basic tutorial doesn't use it, so probably a lot of Premake users don't either (generally it isn't needed unless you're cross compiling or targeting 32 bit from 64 bit): it doesn't make sense for a user to have to manually specify architecture in both Conan and Premake because it's wrong if they mismatch, thus Conan should tell Premake what architecture to use.
i was following the Conan 1 naming (example: cmake, cmake_multi, visual_studio, visual_studio_multi).
but users do tell Conan what arch and build type to use. this PR's generator works well for me and for the sake of saving time I currently use it via my fork, and plan to use it as a custom generator in the future. |
Changelog: (Feature): because the current Premake generator seems to have problems because of the way it supports multi config (#17345), add a separate single config generator that's simpler and doesn't have config mismatch problems.
Docs: https://github.com/conan-io/docs/pull/XXXX
develop
branch, documenting this one.