-
Notifications
You must be signed in to change notification settings - Fork 44
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
build: add Meson support #7
base: main
Are you sure you want to change the base?
Conversation
f1cba7a
to
a456476
Compare
Thanks for the submission, and sorry for the delayed response - I received no notification. I'll check on the process to get this merged. |
Hey @mmc28a, pinging you just to let you know that the Vixl Debian package has been using Meson to build the project for a while, and everything works perfectly on 21 different architectures :) |
Great! My main worry with this is having two build systems, with the Meson one currently untested by the CI. An option is to switch from Scons to Meson, but that's still to be decided. |
I would be happy to help with switching to Meson, but I gave a look at your testing infrastructure and it is a bit... unusual 😅️. If you could explain be a bit how |
As far as I know the only pkg-config file provided by Vixl is the one generated by Meson when applying my yet to be merged patch. That extra include path was needed because I mistakenly thought that adding `vixl` as an include subdirectory was not necessary, but I fixed it in my latest revision - more details here: Linaro/vixl#7 (comment) The fix already landed in Debian and Ubuntu, that as far as I know are the only Linux distros that ship my patch, so manually adding that include directory shouldn't be necessary anymore
Hi @mmc28a, sorry to ping you again. Are you interested in the possibility of switching from SCons to Meson? If so, I could look into porting the tests, benchmarks and examples too; if not, I'll keep updating this branch for as long as I'll need an install target that also generates pkg-config files (i.e. for as long as I'll maintain the vixl package in Debian) |
Sorry, I've been a bit busy with feature updates. I need to make some time to experiment with Meson before deciding. We don't have a strong desire to stick with Scons, though. |
Don't worry, I've seen that Vixl has seen two big releases recently. I'll patiently wait for your decision :) |
Converting to draft, as it seems that there isn't much interested in this patch set and I haven't updated it in almost a year. Feel free to ping me when you're ready to consider the switch; if not, please consider adding an install target to the Scons build script :) |
Sorry, I've still not got to this. I appreciate the contribution, and it's still on my radar, but my radar's pretty full. |
Finally tried this - looks good! I guess it just builds a .so library at the moment, so I'd like it to build others later, along with tests and examples. However, for now, I think we should take it and improve with later patches. Regarding testing, we'd like to move away from the old Python version, and perhaps rewrite existing test scripts to use something like Parallel. The new scripts could then depend on Meson and Ninja for bulids, and will hopefully be much simpler. One small request: could you add your name to the AUTHORS file in this patch, and replace it in the individual build files with "VIXL authors"? |
Meson builds .so libraries by default, but you can change that with the
Nice to hear! I don't know what you mean with "Parallel", though; it can refer to quite a lot of things :)
Sure, I'll do it as soon as possible. |
any updates on this? I've updated the meson.build files for the latest master (vixl_meson.patch.gz), and I can compile an example, but only with manually defining |
Note that at least 7.0.0 requires C++17 but the current Meson files specify C++14. I'd definitely prefer Meson over SCons for packaging in Alpine Linux, thanks for this PR! |
oops, messed up the diff, attempt number 2: |
I've got a large backlog of patches, so I've not been paying much attention to this. Basically, we'll accept Meson as an alternative build system, and eventually move to it if it's reliable. |
Hi @Mis012, I tried applying your patch onto my branch and here is the diff. Was your only change adding a file to the diff --git a/meson.build b/meson.build
index 96d8165e..1f4e5646 100644
--- a/meson.build
+++ b/meson.build
@@ -6,10 +6,10 @@ project(
'vixl',
'cpp',
default_options: [
- 'cpp_std=c++14',
+ 'cpp_std=c++17',
'buildtype=release',
'warning_level=3',
- 'werror=true',
+ 'werror=false',
'd_ndebug=if-release',
'b_lto=true'
],
diff --git a/src/aarch64/meson.build b/src/aarch64/meson.build
index 7cd353a3..9eaf0f9d 100644
--- a/src/aarch64/meson.build
+++ b/src/aarch64/meson.build
@@ -32,6 +32,7 @@ install_headers(
'constants-aarch64.h',
'cpu-aarch64.h',
'cpu-features-auditor-aarch64.h',
+ 'debugger-aarch64.h',
'decoder-aarch64.h',
'decoder-constants-aarch64.h',
'decoder-visitor-map-aarch64.h', |
I was trying to package Vixl, but the SCons build system does not provide an install target, so I would've had to add it. It seemed too difficult, so I directly created a quite basic Meson build script. It provides most features of the SCons script, except for tests and benchmarks, while adding a rich install target, with library soname versioning and a pkg-config file. Meson is a simple yet powerful build system, and you're interested in using it as your main build system I could add tests and benchmarks :)
Finally rebased and refreshed! Here's what changed: diff --git a/AUTHORS b/AUTHORS
index 257ec9d3..13809d26 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,3 +6,4 @@
ARM Ltd. <*@arm.com>
Google Inc. <*@google.com>
Linaro <*@linaro.org>
+Andrea Pappacoda <[email protected]>
diff --git a/doc/aarch32/meson.build b/doc/aarch32/meson.build
index 6baf8d57..e07fc46d 100644
--- a/doc/aarch32/meson.build
+++ b/doc/aarch32/meson.build
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
custom_target(
diff --git a/doc/aarch64/meson.build b/doc/aarch64/meson.build
index d6fe068d..d25f8bfa 100644
--- a/doc/aarch64/meson.build
+++ b/doc/aarch64/meson.build
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
doc_aarch64_files = [
diff --git a/doc/aarch64/topics/meson.build b/doc/aarch64/topics/meson.build
index 40a4f7df..c6e8542b 100644
--- a/doc/aarch64/topics/meson.build
+++ b/doc/aarch64/topics/meson.build
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 VIXL authors
+# SPDX-License-Identifier: BSD-3-Clause
+
doc_aarch64_topics_files = [
'extending-the-disassembler',
'index',
diff --git a/doc/meson.build b/doc/meson.build
index f23f5c94..cbfe193d 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
doc_dir = get_option('datadir')/'doc'/meson.project_name()
diff --git a/meson.build b/meson.build
index 96d8165e..427e3f9e 100644
--- a/meson.build
+++ b/meson.build
@@ -1,12 +1,11 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
project(
'vixl',
'cpp',
default_options: [
- 'cpp_std=c++14',
+ 'cpp_std=c++17',
'buildtype=release',
'warning_level=3',
'werror=true',
@@ -14,8 +13,8 @@ project(
'b_lto=true'
],
license: 'BSD-3-Clause',
- meson_version: '>=0.49.0',
- version: '5.1.0',
+ meson_version: '>=0.50.0',
+ version: '7.0.0',
)
extra_args = []
diff --git a/meson_options.txt b/meson_options.txt
index 602d4c82..d436832a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
option(
diff --git a/src/aarch32/meson.build b/src/aarch32/meson.build
index f4997860..0b22336f 100644
--- a/src/aarch32/meson.build
+++ b/src/aarch32/meson.build
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
# Need to wrap the filenames in files() otherwise this array would be treated
diff --git a/src/aarch64/meson.build b/src/aarch64/meson.build
index 7cd353a3..2898c8f6 100644
--- a/src/aarch64/meson.build
+++ b/src/aarch64/meson.build
@@ -1,5 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
-#
+# SPDX-FileCopyrightText: 2021 VIXL authors
# SPDX-License-Identifier: BSD-3-Clause
# Need to wrap the filenames in files() otherwise this array would be treated
@@ -14,6 +13,7 @@ target_sources += files(
'assembler-sve-aarch64.cc',
'cpu-aarch64.cc',
'cpu-features-auditor-aarch64.cc',
+ 'debugger-aarch64.cc',
'decoder-aarch64.cc',
'disasm-aarch64.cc',
'instructions-aarch64.cc',
@@ -32,6 +32,7 @@ install_headers(
'constants-aarch64.h',
'cpu-aarch64.h',
'cpu-features-auditor-aarch64.h',
+ 'debugger-aarch64.h',
'decoder-aarch64.h',
'decoder-constants-aarch64.h',
'decoder-visitor-map-aarch64.h',
|
hm, I thought there were more changes but I guess not |
I was trying to package Vixl, but the SCons build system does not provide an install target, so I would've had to add it. It seemed too difficult, so I directly created a quite basic Meson build script.
It provides most features of the SCons script, except for tests and benchmarks, while adding a rich install target, with library soname versioning and a pkg-config file.
Meson is a simple yet powerful build system, and you're interested in using it as your main build system I could add tests and benchmarks :)