GNU bug report logs -
#69554
[PATCH] build-system: cmake: Build tests depending on `#:tests?`.
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Am 07.10.24 um 17:45 schrieb Greg Hogan:
> Could we detect with `cmake -L` [1] that the package has a
> BUILD_TESTING option and only then pass this flag?
Running `cmake -L` would run the configure phase. Thus we would need to
configure twice: first to learn whether BUILD_TESTING is defined and
then a second time to change it. We might be able to optimize this: if
BUILD_TESTING is already set to the value we want, we can skip the
second run. While we can hope that the second run will be cheap, if
might not if things change depending on the values.
IMHO this is too much effort just to suppress a warning.
Anyhow, there is a much simpler solution, according to
<https://stackoverflow.com/questions/36451368/> we could just add a line
to the CMakeList.txt file.
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(lalala)
set(__guix_suppress_BUILD_TESTING_warning__ "${BUILD_TESTING}")
$ cmake -DBUILD_TESTING=OFF .
…
-- Generating done (0.0s)
-- Build files have been written to: /tmp/xxx
Voila, no warning.
WDYT?
--
Regards
Hartmut Goebel
| Hartmut Goebel |h.goebel <at> crazy-compilers.com |
|www.crazy-compilers.com | compilers which you thought are impossible |
[Message part 2 (text/html, inline)]
This bug report was last modified 278 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.