GNU bug report logs - #69554
[PATCH] build-system: cmake: Build tests depending on `#:tests?`.

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Mon, 4 Mar 2024 21:50:01 UTC

Severity: normal

Tags: patch

Done: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Greg Hogan <code <at> greghogan.com>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 69554 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`.
Date: Tue, 8 Oct 2024 13:19:57 -0400
I think we can do this without warnings in the output logs or
modifications to the project CMakeLists.txt. We can preload
BUILD_TESTING into the cache:

$ cat cache.txt
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
$ cmake --build build -C cache.txt .

It's not a "manually-specified variable" so no warning and can be
overwritten by a configure flag ("-DBUILD_TESTING=...") or from
CMakeLists.txt (as patched by the rosegarden package).

I have added a commit titled "build-system/cmake: Optionally build
tests." to my branch at
https://github.com/greghogan/guix/commits/master-cmake/ as part of a
v2 for #70031.

After resolving this feature we should look to create a branch on the
build service as with #73135.

[1] https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-C
[2] https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry
[3] https://cmake.org/cmake/help/book/mastering-cmake/chapter/CMake%20Cache.html




This bug report was last modified 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.