-
Notifications
You must be signed in to change notification settings - Fork 27
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
pm5example1 failure #13
Comments
|
It is premake-cmake that causes this. staticlib1 is a static lib without main. It works fine when building makefiles with premake5, but via cmake it fails. That's why I reported it here. The code and premake file is at https://github.com/arnholm/pm5example1 |
i suggest trying to put some prints in the if-else's at note that I don't use this project anymore and working on other stuff so i dont maintain it right now. |
Thanks for the tip. The reason for the failure is that prj.kind is nil in this case, because 'kind' is defined on premake config level and not on project level https://github.com/arnholm/pm5example1/blob/master/pm5example1_premake5.lua#L33 That looks like a bug in cmake-premake. A work-around in cmake_project.lua, i.e. test for prj.kind == nil and let the configs define it
This fixes the immediate problem, but another problem appears when targetname is defined on config level in premake5. Unlike 'kind', 'targetname' is different for the different configs and premake-cmake doesn't handle that correctly. If I comment out 'targetname' in the premake5 file, it links properly. So premake-cmake is almost working, but not quite. EDIT: I should add that the file linked to above does not contain 'targetname' on config level, so it works with the fix mentioned. I observed the 'targetname' problem with a local modified copy |
I merged your PR, so closing this issue. |
I have written a Code::Blocks plugin to generate a premake5 script from a Code::Blocks workspace. There is an example with generated premake5 lua script at https://github.com/arnholm/pm5example1 . This example contains a static library, a shared library and a console application, all extremely small and simple.
It is possible to successfully build this example on linux or windows using premake5 generating makefiles or Visual Studion files:
Now I installed your premake-cmake under Kubuntu 20.04 to see if it would be possible to build the same via CMake, so I did
and then
So far so good, but build fails
The text was updated successfully, but these errors were encountered: