Overhaul Makefile build process - #150
Conversation
|
Hi @pkulchenko, Good to see you active on this project again. What are your initial thoughts on this change? If you like them in principle I'll rebase this PR and pull in some newer build changes from my fork too. |
|
Hi @solemnwarning, yes, I'm interested. I realize that it's an ambitious change, but I like the direction and the simplification that it may potentially bring. I'll check on the rebased PR. Thank you! |
This commit replaces the Makefile build system in wxLua with one which doesn't make use of recursive make and allows for more flexibility when selecting the wxWidgets/Lua libraries to build/link against. The end goal of this work is to make it so that portions of wxLua can be compiled into other Make-based projects by including the Makefile and simply depending on the appropriate targets. The C++ #include directives are reworked so that relative include paths are *actually* relative (where appropriate) rather than depending on the compiler include path including practically every directory in the wxLua source tree. The public headers have been moved to a dedicated include directory.
This commit removes all of the pre-build bindings from the source tree and properly integrates them into the Makefile so they can be build as dependencies of the targets that need them.
Set the WXLUA_ROOT variable before including to allow building from another directory. The 'all' and 'clean' targets have been renamed to 'wxlua-all' and 'wxlua-clean' to avoid conflict with other project(s). A wrapper target for 'clean' is defined only when WXLUA_ROOT is unset.
Outputs from genwxbind.lua are always overwritten now so that their modification timestamp accurately reflects when they were updated.
Not sure why this was here in the first place, but the result was it skipped building the bindings for projects like luamodule.
a119cdc to
05ec0c0
Compare
|
I've rebased it, made some further fixes to the Makefile/CMakeLists and made an initial pass at a GitHub Actions workflow to verify the myriad of configurations, which can be seen running here: https://github.com/solemnwarning/wxlua/actions/runs/34025706469 |
|
Hi @solemnwarning, thank you for the rebased PR and the added github actions! I'm still checking, but have a couple of questions about the new bindings approach. What's the motivation behind regenerating them on the fly and always overwriting generated files. My concern is that troubleshooting a build process is already fairly complex and adding a step that requires bindings to be regenerated will further complicate it. My understanding is that the rest of your changes are independent from this regeneration. Is that not the case? |
|
My motivation was ensuring that the bindings are always up to date - I've seen them get desync'd plenty in this repo and IMO build artifacts/intermediates don't belong in the source tree. The change to The Makefile(s) were in a pretty hairy state before I started on this, so a lot of restructuring/fixes on them in particular got done at the same time just to get things to a state where they worked well enough to use as a base. |
|
Do you think we can split them into two PRs? I agree that people sometimes miss committing updated bindings, but this is an easy problem to fix. I'm still concerned about complicating the build process and requiring a Lua interpreter to process the binding (yes, I recognize the irony). Maybe I just need to try it a couple of times to see the effect... |
|
I'm not really sure how much of this can be split off into a separate PR - refactoring the makefiles touched almost everything due to the previous state of them. In the long term there's more I can do to simplify the build system, but am trying to keep this PR somewhat contained. EDIT: The GitHub Actions workflow is self-contained if you want that separated. |
This is a pretty big (and potentially contentious) change, but I've reworked the Makefiles for wxLua with the following goals:
In addition to the above, I made the following changes while refactoring:
wxluasetup.htowxluasetup-defaults.hwhich can be included from a userwxluasetup.h