-
Notifications
You must be signed in to change notification settings - Fork 16
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
Switch from cmake
to premake5
#138
Comments
I've chosen CMake because afaik it either has support or is supported by the most IDEs. It's not necessarily as good as a "true native" project file, but probably better than no integration at all. Note however that meson does not support wildcards for source-file specification (FAQ entry). I have not used premake before, but like Lua. Well, most of it anyways *mutters about 1-based indexing... I have written a meson.build file for a project that features the same warning-flag checking as our current CMakeLists.txt: gist. I've written it to resemble the CMakeListst.txt, so it might not be considered good style for meson. |
From what I can see this is the case, albeit somewhat broken on most of them, especially when it comes to Windows. I vaguely remember codeblocks giving me some kind of issue with it's cmake plugin.
That looks pretty cool actually, the syntax to enable/check is quite similar to what you'd expect in a premake file.
From the extent that I've used it, it's rather nice. It's smart too, as it can resolve libraries that you make. That is, if one of the projects you specify is of type
|
Meson does that too and I thought CMake as well.
I assume it does come with the downside mentioned in Mesons FAQ though. The issue of a missing source file in the build script should be quite apparent. It is convenient, but does not lead to difficult-to-debug problems and comes with the aforementioned downsides. I don't think meson is going away as it has been picked up by a couple of projects. It has a better plan for IDE integration than CMake, by providing an introspection tool and JSON output describing the project, and also the prospective rewrite-tool that shall take care of adding and removing files from a project programmatically. There are also plans for meson (and currently an experimental implementation) to have a tool that can add and remove source files from a meson.build-script, so that when a user has generated a project for their IDE, the IDE can also keep the script in sync with the changes the user makes to the project, at least as for adding/removing source files - not so for compiler flags. Do you know if premake has similar goals regarding IDE support? |
This I didn't know (with regards to cmake).
I didn't think of this, mostly because when working by myself it's an assurance that the sources are always there and there's no missing files, however I can see that being an issue on a distributed project.
That sounds pretty neat, I hadn't heard of it until now, but I'm already liking the syntax and the feature set they plan to implement.
From what I've read (https://github.com/premake/premake-core/wiki/Using-Premake) it generates project files instead of having actual 'integration' per se. Handy for us in that it supports gmake files, and handy for Windows users with vs05+ IDE support for all flavours of Windows. Apart from that, it's basically just a C command line program that's small in scope.
Yeah I definitely agree. Also, as a side, target import for sdl2 is currently broken on arch and has been for the past 8 months (one of the few reasons I took a break from working on this, actually). It can't find the proper include directories apparently. |
https://mesonbuild.com/Dependencies.html#building-dependencies-as-subprojects Sadly, meson cannot communicate with other build-systems, like CMake's ExternalProject can. However, there is mesonbuild/meson#4321. Until then we can maybe write dummy-meson.builds that use |
Yeah definitely, I'm thinking this is going to solve the issue of per platform building once and for all, especially if it will allow Windows users to join development finally.
As per usual, I'll leave this to you, though I'm not too worried about that.
Most of the deps we use don't have other deps? Or at least from memory. |
@z33ky I just saw this when updating. It seems eclipse has integrated Meson support, or at least the starts to it. If you've got time, I'm 110% happy for you to switch the build system over (especially since it is also compatible with VS from what I've read). |
This one's probably just more of a personal preference, but I'd like to garner some opinion of others. I've done a bit of experimenting with
premake5
, which is similar tocmake
, however a lot less complex. The scripts are basic.lua
scripts, that look similar to the one attached. One neat feature is the ease of specifying build targets, as well as allowing recursive file finding (e.gfiles {"source/sh3/**.cpp", "source/sh3/**.hpp"}
) instead of having to specify files we want to compile. Though simpler, however, there IS a lot of functionality that it does not contain thatcmake
does, such as initial compiler scanning etc.An example of a script can be found here: https://github.com/Palm-Studios/OpenHill/blob/master/premake5.lua
The text was updated successfully, but these errors were encountered: