Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/meson.eclass | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..e9c9b155096 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -379,7 +379,21 @@ meson_src_configure() {
meson_src_compile() {
debug-print-function ${FUNCNAME} "$@"
- eninja -C "${BUILD_DIR}" "$@"
+ local mesoncompileargs=(
+ -C "${BUILD_DIR}"
+ )
+ if [[ -n ${NINJAOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${NINJAOPTS})"
+ --load-average "$(makeopts_loadavg ${NINJAOPTS})"
+ )
+ elif [[ -n ${MAKEOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${MAKEOPTS})"
+ --load-average "$(makeopts_loadavg ${MAKEOPTS})"
+ )
+
+ meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
}
# @FUNCTION: meson_src_test
Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/meson.eclass | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..e9c9b155096 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -379,7 +379,21 @@ meson_src_configure() {
meson_src_compile() {
debug-print-function ${FUNCNAME} "$@"
- eninja -C "${BUILD_DIR}" "$@"
+ local mesoncompileargs=(
+ -C "${BUILD_DIR}"
+ )
+ if [[ -n ${NINJAOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${NINJAOPTS})"
+ --load-average "$(makeopts_loadavg ${NINJAOPTS})"
+ )
+ elif [[ -n ${MAKEOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${MAKEOPTS})"
+ --load-average "$(makeopts_loadavg ${MAKEOPTS})"
+ )
+
+ meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
}
# @FUNCTION: meson_src_test
@@ -406,13 +420,17 @@ meson_src_test() {
}
# @FUNCTION: meson_src_install
-# @USAGE: [extra ninja install arguments]
+# @USAGE: [extra meson install arguments]
# @DESCRIPTION:
# This is the meson_src_install function.
meson_src_install() {
debug-print-function ${FUNCNAME} "$@"
- DESTDIR="${D}" eninja -C "${BUILD_DIR}" install "$@"
+ local mesoninstallargs=(
+ -C "${BUILD_DIR}" "$@"
+ --destdir "${D}"
+ )
+ meson install "${mesoninstallargs[@]}" "$@"
pushd "${S}" > /dev/null || die
einstalldocs
On 24/08/2021 07.35, William Hubbs wrote:
Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/meson.eclass | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..e9c9b155096 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -379,7 +379,21 @@ meson_src_configure() {
meson_src_compile() {
debug-print-function ${FUNCNAME} "$@"
- eninja -C "${BUILD_DIR}" "$@"
+ local mesoncompileargs=(
+ -C "${BUILD_DIR}"
+ )
+ if [[ -n ${NINJAOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${NINJAOPTS})"
+ --load-average "$(makeopts_loadavg ${NINJAOPTS})"
+ )
+ elif [[ -n ${MAKEOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${MAKEOPTS})"
+ --load-average "$(makeopts_loadavg ${MAKEOPTS})"
+ )
+
+ meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
}
# @FUNCTION: meson_src_test
Missing 'fi'?
I'd probably drop NINJAOPTS and simply have MAKEOPTS the one place where users can specify --jobs and --load values.
Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/meson.eclass | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..e9c9b155096 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -379,7 +379,21 @@ meson_src_configure() {
meson_src_compile() {
debug-print-function ${FUNCNAME} "$@"
- eninja -C "${BUILD_DIR}" "$@"
+ local mesoncompileargs=(
+ -C "${BUILD_DIR}"
+ )
+ if [[ -n ${NINJAOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${NINJAOPTS})"
+ --load-average "$(makeopts_loadavg ${NINJAOPTS})"
+ )
+ elif [[ -n ${MAKEOPTS} ]]; then
+ mesoncompileargs+=(
+ --jobs "$(makeopts_jobs ${MAKEOPTS})"
+ --load-average "$(makeopts_loadavg ${MAKEOPTS})"
+ )
+
+ meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
}
# @FUNCTION: meson_src_test
@@ -406,13 +420,17 @@ meson_src_test() {
}
# @FUNCTION: meson_src_install
-# @USAGE: [extra ninja install arguments]
+# @USAGE: [extra meson install arguments]
# @DESCRIPTION:
# This is the meson_src_install function.
meson_src_install() {
debug-print-function ${FUNCNAME} "$@"
- DESTDIR="${D}" eninja -C "${BUILD_DIR}" install "$@"
+ local mesoninstallargs=(
+ -C "${BUILD_DIR}" "$@"
+ --destdir "${D}"
+ )
+ meson install "${mesoninstallargs[@]}" "$@"
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (0 / 16) |
Uptime: | 29:30:32 |
Calls: | 8,327 |
Calls today: | 4 |
Files: | 13,153 |
Messages: | 5,890,081 |
Posted today: | 1 |