ninja-utils.eclass: Warn if NINJAOPTS diable jobserver support

Warn if NINJAOPTS specifies "-j" option and a jobserver is available,
since it will implicitly disable the jobserver support.

Bug: https://bugs.gentoo.org/692576
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/44539
Closes: https://github.com/gentoo/gentoo/pull/44539
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Michał Górny 2025-11-08 20:39:34 +01:00 committed by Sam James
parent b8584ea0ae
commit 3f2c61f459
No known key found for this signature in database
GPG Key ID: 738409F520DF9190

View File

@ -116,6 +116,9 @@ get_NINJAOPTS() {
# ninja only uses jobserver if -j is not passed
NINJAOPTS+=" -j$(get_makeopts_jobs 999)"
fi
elif _ninja_uses_jobserver && [[ ${NINJAOPTS} == *-j* ]]; then
ewarn "Jobserver detected, but NINJAOPTS specifies -j option."
ewarn "To enable ninja jobserver support, remove -j from NINJAOPTS."
fi
echo "${NINJAOPTS}"
}