If a cmake project builds parts of itself using ExternalProject_Add(), MAKEOPTS is not propagated to the inner ninja. https://github.com/gentoo/gentoo/pull/36016 is an example of workaround for this, except that it should be set in the eclass, and it still doesn't propagate -l Docs: https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34734a17a456ded2122211876e2ff3612ee259d1 commit 34734a17a456ded2122211876e2ff3612ee259d1 Author: Alexey Sokolov <alexey+gentoo@asokolov.org> AuthorDate: 2024-03-31 15:47:47 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-04-01 07:13:55 +0000 dev-util/bear: limit parallelism I can't find a way to pass -l through cmake --build of ExternalProject, but at least it passes -j now [sam: added Bug: tag.] Bug: https://bugs.gentoo.org/928346 Closes: https://bugs.gentoo.org/922199 Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org> Closes: https://github.com/gentoo/gentoo/pull/36016 Signed-off-by: Sam James <sam@gentoo.org> dev-util/bear/bear-3.1.3.ebuild | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
I agree we should do this. While it's often an example of a bundled library, it's not always avoidable, and it's better than bombing out the system.