-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add meson build system #52311
Add meson build system #52311
Conversation
My comment is if we can run meson side by side with scons, we can work on this incrementally. Need to develop a plan with Akien though. |
@fire yes, that was my idea, and the reason hy I reworked the previous PR bringing the sources back in sync. If anyone can help with the windows and osx builds it would be great. |
version_cdata.set_quoted('VERSION_STATUS', 'dev') | ||
version_cdata.set_quoted('VERSION_BUILD', 'custom_build') | ||
version_cdata.set_quoted('VERSION_MODULE_CONFIG', '') | ||
version_cdata.set('VERSION_YEAR', 2020) |
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.
*2021.
"patch": 0, | ||
"status": "dev", | ||
"module_config": "", | ||
"year": 2020, |
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.
Same here. 2021.
@@ -0,0 +1,30 @@ | |||
name: 'Setup python meson ninja.' |
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.
Should these be capitalized? Also, the quotes are inconsistent. Other places in the file use '
, "
, or no quotes.
It's linking for me (on macOS), but generated |
@bruvzg nicely spot! Should be fixed now. Let's see what happens to CI |
Another issue, disabling module doesn't disable its dependencies (at least true for |
@Faless I spent yesterday evening trying to figure out what's wrong and surprisingly it's not the problem with slashes but the Python shebang missing in affected Python scripts. I moved the files around and for unknown reason |
@Listwon thanks a lot for finding that out. I'm growing more and more disappointed with meson :/ . |
Added volk support, now the editor starts (on X11 at least). Font rendering is totally broken, I realize that FreeType does actually get built (not the module though, because the module in scons only existed to let the library build). So I think it might be some missing defines that causes the font rendering to be broken. |
376cbb7
to
dec2851
Compare
I suggest the path forward with Meson would be as follows:
Does this make sense? |
With this diff I can build this branch on Linux and run the result successfully: diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h
index 5989035800..a9a29fd35c 100644
--- a/modules/text_server_adv/text_server_adv.h
+++ b/modules/text_server_adv/text_server_adv.h
@@ -52,6 +52,7 @@
#include <unicode/uloc.h>
#include <unicode/uscript.h>
#include <unicode/ustring.h>
+#include <unicode/utf16.h>
#include <unicode/utypes.h>
#include "modules/modules_enabled.gen.h"
diff --git a/thirdparty/harfbuzz/meson.build b/thirdparty/harfbuzz/meson.build
index caca75438e..e9b282854d 100644
--- a/thirdparty/harfbuzz/meson.build
+++ b/thirdparty/harfbuzz/meson.build
@@ -73,7 +73,7 @@ if get_option('builtin_harfbuzz')
'-DHAVE_ICU',
'-DHAVE_FREETYPE',
'-DHAVE_GRAPHITE2',
- '-DHB_DISABLE_DEPRECATED',
+ #'-DHB_DISABLE_DEPRECATED',
'-DGRAPHITE2_STATIC',
] Further, if you add this commit the ordering issues on macOS should get fixed. |
With this change it builds and runs on Windows, too:
|
@jpakkane the whole point of this branch is not changing the C/C++ source. I'll try to pick the |
Finished all modules on except for mono and webm. Windows compilation with MSVC (LLVM-mingw kind of) Linux compilation with GCC Linux cross compile to windows with gcc-mingw-64
Fixes desktop platforms (tested only X11) renderer. Font rendering it still broken.
With the following patch this builds on Windows for me: diff --git a/thirdparty/etcpak/meson.build b/thirdparty/etcpak/meson.build
index 6fc6f41d65..7c6cd63c35 100644
--- a/thirdparty/etcpak/meson.build
+++ b/thirdparty/etcpak/meson.build
@@ -1,10 +1,12 @@
# the include directory
-_etcpak_srcs = files([
+_etcpak_srcs = files(
'Dither.cpp',
'ProcessDxtc.cpp',
'ProcessRGB.cpp',
'Tables.cpp',
-])
+)
-_lib_etcpak = static_library('etcpak', _etcpak_srcs, build_by_default: false)
+_lib_etcpak = static_library('etcpak',
+ _etcpak_srcs,
+ cpp_args: ['-DNOMINMAX'])
DEP_ETCPAK = declare_dependency(link_with: _lib_etcpak) |
This patch is needed to build with Visual Studio. It fails with the same Freetype error as the other ones. diff --git a/tests/meson.build b/tests/meson.build
index 8bb59768c6..6f4481c7a1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -3,7 +3,11 @@ if get_option('tests')
_tests_cpp_args = []
if PLATFORM == 'windows'
+ if cpp.get_id() == 'msvc'
+ _tests_cpp_args += '/bigobj'
+ else
_tests_cpp_args += '-DDOCTEST_THREAD_LOCAL'
+ endif
endif
#_tests_incdirs = include_directories('.') |
In order to set up the VS environment on Github Actions, you need to use this action. From what I can tell, adding one line in
Scons seems to autoactivate the VS environment. Meson also has code for that, but it only does it if it detects that no other build toolchain is currently available. The assumption here being that if you have added a build toolchain in your 'PATH` then that is probably what you want to use. |
Any progress on this? |
I have kept my |
Is this going somwhere? The release of 4.0 would be a great moment to introduce a better build system. |
I'll share what I wrote on the Godot chat for context:
Note that @jpakkane has been maintaining a branch against current |
Closing, as development is continuing in #51153 |
In this PR:
Missing modules:
raycast, webm, opus, webm, theora, gdnative, etcpak, freetype, mono
.text_server_adv
fails to link.Additionally, at least the X11 display driver does not work (fails to connect to display).
The windows build is broken because... well, I don't know, meson doesn't seem to get the path slashes right.
This is as far as I will go, I already spent 3 days fighting with this and I'm totally fed up.
If anyone want to keep up the work, I think this is a solid base which is also easy to rebase.
Note: some cleanup of the doc generation should fix the mac editor build. I'll try to extract some of the scons code and move it to editor_generators.py as it should be.
Note2: I don't think
iphone
is actually a valid iphone build.