summaryrefslogtreecommitdiff
path: root/eclass/cmake.eclass
AgeCommit message (Collapse)Author
2024-01-13cmake.eclass: sys-devel/make -> dev-build/makeSam James
Signed-off-by: Sam James <sam@gentoo.org>
2024-01-03cmake.eclass: Set CMAKE_DISABLE_PRECOMPILE_HEADERS=ONAndreas Sturmlechner
Bug: https://bugs.gentoo.org/920845 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2024-01-03cmake.eclass: Set FETCHCONTENT_FULLY_DISCONNECTED=ONAndreas Sturmlechner
Bug: https://bugs.gentoo.org/920846 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2024-01-01*/*: Happy new yearAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-09-16cmake.eclass: remove USER_VARIABLE from CMAKE_SKIP_TESTSIonen Wolkens
This is an array, and users cannot even set arrays through the environment. Must have been a copy/paste oversight (skipping ML review). Signed-off-by: Ionen Wolkens <ionen@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-09-16cmake.eclass: Remove duplicate eninja call from cmake_buildMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-09-16cmake.eclass: Support CMAKE_VERBOSE with ninjaMatt Turner
Signed-off-by: Matt Turner <mattst88@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-09-16cmake.eclass: workaround S=${WORKDIR} creating builddir above ${WORKDIR}Sam James
When S=${WORKDIR}, cmake.eclass would create its build directory (if CMAKE_USE_DIR is unset) above WORKDIR(!) as ${WORKDIR}_build. Creating directories above WORKDIR is not legal. Portage has its own bug (bug #889418) in that it doesn't clean up unknown directories above WORKDIR in PORTAGE_TMPDIR, so combined, you get a problem where "ebuild ... clean" doesn't actually clean things up at all, and you get very confusing issues if e.g. changing CC between runs. The explicit S=WORKDIR check isn't truly needed but it makes explicit our intent here. Bug: https://bugs.gentoo.org/889418 Closes: https://bugs.gentoo.org/889420 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-09-16cmake.eclass: Set CMAKE_SYSROOT when building with SYSROOT=Raul E Rangel
When performing a SYSROOT= build, the --sysroot parameter was not getting passed to the compiler if the CBUILD and CHOST matched. This results in the build attempting to use BROOT libraries and headers instead of the ones from the SYSROOT. This change will allow `llvm` to be built into a new SYSROOT. ROOT=/build/amd64-host emerge sys-devel/llvm Signed-off-by: Raul E Rangel <rrangel@chromium.org> Closes: https://github.com/gentoo/gentoo/pull/30658 Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-05-18cmake.eclass: Cleanup fatal banned functions and meta variablesAndreas Sturmlechner
All of this was ported away from long ago, cmake-utils.eclass was removed almost a year ago. Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-26cmake.eclass: Quote argument of ":" commandUlrich Müller
This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-23cmake.eclass: Support dev-util/samuraiorbea
samurai is a ninja-compatible build tool written in C which works with cmake, meson and other users of ninja. It is feature-complete and supports most of the same options as ninja. Signed-off-by: orbea <orbea@riseup.net> Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-23cmake.eclass: Set CMAKE_SYSROOT in toolchain file when necessaryJames Le Cuirot
We previously set CMAKE_FIND_ROOT_PATH, but CMAKE_SYSROOT also sets this and more. The latter is needed when cross-compiling Fortran code such as sci-libs/lapack. Without this, it uses the toolchain's default sysroot, adds a -L/usr/${CHOST}/usr/lib flag based on that, reads the libc.so.6 ld script from this directory, does not apply any sysroot to the paths within because the script is outside the sysroot, and finally fails when attempting to link the host's libc.so.6. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-23eclass: standardize prologue/epilogueDavid Seifert
Closes: https://github.com/gentoo/gentoo/pull/30061 Signed-off-by: David Seifert <soap@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-23cmake.eclass: add base-system as @MAINTAINER too (align with dev-util/cmake)Sam James
Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-23cmake.eclass: mark CMAKE_VERBOSE as @USER_VARIABLESam James
It's a policy requirement that ebuilds produce verbose logs, so ebuilds themselves must not set CMAKE_VERBOSE. But users can. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-22cmake.eclass: Set Python3_FIND_UNVERSIONED_NAMES FIRSTAndreas Sturmlechner
See also: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8287 Bug: https://bugs.gentoo.org/835799 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-03-12cmake.eclass: handle quoted whitespace in MYCMAKEARGSMike Gilbert
This uses eval in a similar way to econf and meson.eclass. Closes: https://github.com/gentoo/gentoo/pull/29839 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2023-01-02*/*: Happy new yearAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-12-11cmake.eclass: comment typo fixSam James
Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-12-11cmake.eclass: drop use_enable reference in @DESCRIPTIONSam James
This is from cmake-utils.eclass and the use_enable-style functions it refers to are long-banned. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-10-16cmake.eclass: add CMAKE_SKIP_TESTSAlfred Persson Forsberg
Signed-off-by: Alfred Persson Forsberg <cat@catcream.org> Closes: https://github.com/gentoo/gentoo/pull/27052 Signed-off-by: Sam James <sam@gentoo.org>
2022-06-08cmake.eclass: Prepare for makeopts_jobs default inf changeMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-03-25*.eclass: @ECLASS-VARIABLE renamed to @ECLASS_VARIABLEUlrich Müller
Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-02-21cmake.eclass: Document MYCMAKEARGSAndreas Sturmlechner
Bug: https://bugs.gentoo.org/824030 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-02-16cmake.eclass: Fix MYCMAKEARGS support with >=dev-util/cmake-3.23Andreas Sturmlechner
Bug: https://bugs.gentoo.org/833100 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-01-04*/*: Happy new year!Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-09-02cmake.eclass: Sync with Gentoo ebuild repositoryAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-08-21cmake.eclass: Default CMAKE_BUILD_TYPE=RelWithDebInfo in EAPI 8Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-08-21cmake.eclass: Enable CMAKE_INSTALL_ALWAYSAndreas Sturmlechner
Bug: https://bugs.gentoo.org/735820 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-08-21cmake.eclass: Enforce CMAKE_REMOVE_MODULES_LIST be an arrayAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-08-21cmake.eclass: Support EAPI-8Andreas Sturmlechner
Switch to using current working directory instead of ${S} when initializing ${CMAKE_USE_DIR} and ${BUILD_DIR}. Raise baseline cmake version to 3.20. Bug: https://bugs.gentoo.org/704524 Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-07-18cmake.eclass: Move supported EAPI check and EXPORT_FUNCTIONS on topAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-05-09cmake.eclass: mark CMAKE_EXTRA_CACHE_FILE, CMAKE_QA_SRC_DIR_READONLY as ↵Sam James
@USER_VARIABLEs Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-05-09cmake.eclass: mark CMAKE_MAKEFILE_GENERATOR as @PRE_INHERITSam James
We use this to control our dependencies in global scope. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Move _cmake_check_build_dir to a better placeAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Merge mycmakeargs description into cmake_src_configure()Andreas Sturmlechner
Makes it a part of cmake_src_configure() rather than oddly appearing under FUNCTIONS. Bug: https://bugs.gentoo.org/771876 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Group all banned cmake-utils_* functions togetherAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Documentation: cmake_src_prepare() *MUST* be runAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Better description of cmake_build() and cmake_src_compile()Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Document _cmake_check_build_dir and _cmake_modify-cmakelistsAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-02-21cmake.eclass: Fix mycmakeargs documentationAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-01-01*/*: Happy new Year!Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-09-04cmake.eclass: Reformat the cmake code we write to lowercase callsAndreas Sturmlechner
Add some indendation, drop space between function name and brackets, cleanup old style if-else-endif. Bug: https://bugs.gentoo.org/739230 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-08-30cmake.eclass: If inherited from ecm.eclass, set ECM_DISABLE_QMLPLUGINDUMPAndreas Sturmlechner
Works with downstream patch added to kde-frameworks/extra-cmake-modules in commit f5b2cf80ea9696a5efbc2064cd432670670af486 Bug: https://bugs.gentoo.org/640432 Bug: https://bugs.gentoo.org/683102 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-08-30cmake.eclass: cmake_comment_add_subdirectory: line length reductionAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-08-30cmake.eclass: cmake_run_in: New functionAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-07-25cmake*.eclass: Hardcode CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX for riscvAndreas K. Hüttel
Bug: https://bugs.gentoo.org/689410 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2020-04-02cmake.eclass: do not append -DNDEBUG to CPPFLAGSMike Gilbert
The NDEBUG macro turns the assert() function into a noop. This gives a small performance boost, but may allow subtle programming errors to go unnoticed. This code was added back in 2008, when we started passing -DCMAKE_BUILD_TYPE=None instead of Release or Debug. It probably tries to mimic a default behavior of Release type builds. Other common build systems do not do this by default. For example, autoconf's AC_HEADER_ASSERT macro only sets NDEBUG if --disable-assert is passed to configure (it defaults to enabled). It is better to let users add this to CPPFLAGS themselves if they really want to save those few CPU cycles. Signed-off-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2020-01-05cmake.eclass: Fix cmake-utils_src_make error messageAndreas Sturmlechner
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>