From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Mar 2024 21:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69554@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170958897913016 (code B ref -1); Mon, 04 Mar 2024 21:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Mar 2024 21:49:39 +0000 Received: from localhost ([127.0.0.1]:45072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhGBm-0003Ns-LF for submit@debbugs.gnu.org; Mon, 04 Mar 2024 16:49:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:52464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhGBi-0003NW-2p for submit@debbugs.gnu.org; Mon, 04 Mar 2024 16:49:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhGBD-0007UC-U4 for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:03 -0500 Received: from mail01.noris.net ([62.128.1.221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhGBA-0005Fn-BN for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:03 -0500 Received: from p57b08d98.dip0.t-ipconnect.de ([87.176.141.152] helo=hermia.goebel-consult.de) by mail01.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1rhGB4-0003zV-Tn for guix-patches@gnu.org; Mon, 04 Mar 2024 22:48:54 +0100 Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id B53515F4DE; Mon, 4 Mar 2024 22:48:51 +0100 (CET) From: Hartmut Goebel Date: Mon, 4 Mar 2024 22:48:51 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Noris-IP: 87.176.141.152 Received-SPF: pass client-ip=62.128.1.221; envelope-from=h.goebel@crazy-compilers.com; helo=mail01.noris.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/build/cmake-build-system.scm (configure): New paremeter `#:tests?`. Add cmake option "-DBUILD_TESTING=" with value "ON" or "OFF" depending on build-system argument `#:tests?`. * * doc/guix.texi (Inspecting Services)[cmake-build-system]: Document it. --- doc/guix.texi | 10 ++++++++++ guix/build/cmake-build-system.scm | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 87fe9f803c..409d076d12 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9617,6 +9617,16 @@ parameter specifies in abstract terms the flags passed to the compiler; it defaults to @code{"RelWithDebInfo"} (short for ``release mode with debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. + +Depending on the @code{#:tests?} parameter, the configure-flag +@code{BUILD_TESTING} is set to @code{ON} resp. @code{OFF}. +@code{BUILD_TESTING} is a +@url{https://cmake.org/cmake/help/v3.28/module/CTest.html, standard +defined by CMake} to enable or disable building tests. This aims to +save build time if tests are not run anyway, while trying to ensure +tests are build if they should be run. Anyhow, the CMakeLists.txt needs +to implement handling this flag. + @end defvar @defvar composer-build-system diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d1ff5071be..71e8ca8a83 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -33,7 +33,7 @@ (define-module (guix build cmake-build-system) ;; Code: (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) - build-type target + (tests? #t) build-type target #:allow-other-keys) "Configure the given package." (let* ((out (assoc-ref outputs "out")) @@ -62,6 +62,11 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib") ;; enable verbose output from builds "-DCMAKE_VERBOSE_MAKEFILE=ON" + ;; ask for (not) building tests depending on #:tests? + ;; (CMakeLists.txt may or may not implement this check) + ,@(if tests? + '("-DBUILD_TESTING=OFF") ; not run anyway + '("-DBUILD_TESTING=ON")) ; overwrite any default option ;; Cross-build ,@(if target base-commit: 3da49b1472919a62df1fe399638f23a246aa325d -- 2.41.0 From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. References: In-Reply-To: Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Mar 2024 23:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69554@debbugs.gnu.org Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.170959315330465 (code B ref 69554); Mon, 04 Mar 2024 23:00:03 +0000 Received: (at 69554) by debbugs.gnu.org; 4 Mar 2024 22:59:13 +0000 Received: from localhost ([127.0.0.1]:45223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhHH6-0007vJ-FK for submit@debbugs.gnu.org; Mon, 04 Mar 2024 17:59:12 -0500 Received: from mail02.noris.net ([62.128.1.232]:44451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhHH1-0007ut-2s for 69554@debbugs.gnu.org; Mon, 04 Mar 2024 17:59:11 -0500 Received: from p57b08d98.dip0.t-ipconnect.de ([87.176.141.152] helo=hermia.goebel-consult.de) by mail02.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1rhHGV-0006lq-UA for 69554@debbugs.gnu.org; Mon, 04 Mar 2024 23:58:35 +0100 Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id C52AC5F4DE; Mon, 4 Mar 2024 23:58:32 +0100 (CET) From: Hartmut Goebel Date: Mon, 4 Mar 2024 23:58:32 +0100 Message-ID: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Noris-IP: 87.176.141.152 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/cmake-build-system.scm (configure): New paremeter `#:tests?`. Add cmake option "-DBUILD_TESTING=" with value "ON" or "OFF" depending on build-system argument `#:tests?`. * * doc/guix.texi (Inspecting Services)[cmake-build-system]: Document it. --- doc/guix.texi | 10 ++++++++++ guix/build/cmake-build-system.scm | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 87fe9f803c..409d076d12 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9617,6 +9617,16 @@ parameter specifies in abstract terms the flags passed to the compiler; it defaults to @code{"RelWithDebInfo"} (short for ``release mode with debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. + +Depending on the @code{#:tests?} parameter, the configure-flag +@code{BUILD_TESTING} is set to @code{ON} resp. @code{OFF}. +@code{BUILD_TESTING} is a +@url{https://cmake.org/cmake/help/v3.28/module/CTest.html, standard +defined by CMake} to enable or disable building tests. This aims to +save build time if tests are not run anyway, while trying to ensure +tests are build if they should be run. Anyhow, the CMakeLists.txt needs +to implement handling this flag. + @end defvar @defvar composer-build-system diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d1ff5071be..3f5449c438 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -33,7 +33,7 @@ (define-module (guix build cmake-build-system) ;; Code: (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) - build-type target + (tests? #t) build-type target #:allow-other-keys) "Configure the given package." (let* ((out (assoc-ref outputs "out")) @@ -62,6 +62,11 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib") ;; enable verbose output from builds "-DCMAKE_VERBOSE_MAKEFILE=ON" + ;; ask for (not) building tests depending on #:tests? + ;; (CMakeLists.txt may or may not implement this check) + ,@(if tests? + '("-DBUILD_TESTING=ON") ; overwrite any default option + '("-DBUILD_TESTING=OFF")) ; not run anyway ;; Cross-build ,@(if target base-commit: 3da49b1472919a62df1fe399638f23a246aa325d -- 2.41.0 From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Jul 2024 09:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hartmut Goebel Cc: 69554@debbugs.gnu.org Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172103659413482 (code B ref 69554); Mon, 15 Jul 2024 09:44:01 +0000 Received: (at 69554) by debbugs.gnu.org; 15 Jul 2024 09:43:14 +0000 Received: from localhost ([127.0.0.1]:59049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTIEj-0003VO-Hd for submit@debbugs.gnu.org; Mon, 15 Jul 2024 05:43:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTIEh-0003VB-Hp for 69554@debbugs.gnu.org; Mon, 15 Jul 2024 05:43:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTICS-0004z7-V9; Mon, 15 Jul 2024 05:40:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=PDt8ye9JgVD/bMgDkOnaLB5WZb6lxRGn/8iKxyw7o8w=; b=iXD9mUSJB+agHVCroSI8 Oijaeuh7zCvEZRomS5nEad9+8Dz0NzRwA8K6gHFkDgvteR+uXVcr/BhDlu8FayCkXE8jLWTV1bTFv rSexb/alndLPyawrEbQoy6mT2yhO2ud8M5bXzrjOuh5OnaY4aXsI5tXv5xLY0bWbyzGN8RPEKn23S NfbfQ0Z/3w3tnXPANv1w0SmToLf4rh/HLAT/eTA9eKhrTAcly8tmlKudqo0Dq8viUypV9lliPVN8K Aj21NxaXllleFlgnTP00juk7hCOQw9tQb86x4joZm9M3kYsf4FsGkoq1NmrO4D07m30OlhUGgbVzV 7RunzrOVEQEmzA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> (Hartmut Goebel's message of "Mon, 4 Mar 2024 23:58:32 +0100") References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> Date: Mon, 15 Jul 2024 11:40:41 +0200 Message-ID: <87ed7v0z8m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Hartmut, Hartmut Goebel skribis: > * guix/build/cmake-build-system.scm (configure): New paremeter `#:tests?`. > Add cmake option "-DBUILD_TESTING=3D" with value "ON" or "OFF" depending > on build-system argument `#:tests?`. > * * doc/guix.texi (Inspecting Services)[cmake-build-system]: Document it. > --- > doc/guix.texi | 10 ++++++++++ > guix/build/cmake-build-system.scm | 7 ++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 87fe9f803c..409d076d12 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -9617,6 +9617,16 @@ parameter specifies in abstract terms the flags pa= ssed to the compiler; > it defaults to @code{"RelWithDebInfo"} (short for ``release mode with > debugging information''), which roughly means that code is compiled with > @code{-O2 -g}, as is the case for Autoconf-based packages by default. > + > +Depending on the @code{#:tests?} parameter, the configure-flag > +@code{BUILD_TESTING} is set to @code{ON} resp. @code{OFF}. > +@code{BUILD_TESTING} is a > +@url{https://cmake.org/cmake/help/v3.28/module/CTest.html, standard > +defined by CMake} to enable or disable building tests. This aims to > +save build time if tests are not run anyway, while trying to ensure > +tests are build if they should be run. Anyhow, the CMakeLists.txt needs > +to implement handling this flag. My understanding is that =E2=80=98BUILD_TESTING=E2=80=99 is not standard, a= s the last sentence above suggests. Thus I=E2=80=99m reluctant to passing this flag unconditionally, as I guess it would fail for =E2=80=98CMakeLists.txt=E2=80= =99 that do not implement it, right? Thanks, Ludo=E2=80=99. From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Jul 2024 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 69554@debbugs.gnu.org Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172114421815968 (code B ref 69554); Tue, 16 Jul 2024 15:37:01 +0000 Received: (at 69554) by debbugs.gnu.org; 16 Jul 2024 15:36:58 +0000 Received: from localhost ([127.0.0.1]:34286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTkEc-00049S-6S for submit@debbugs.gnu.org; Tue, 16 Jul 2024 11:36:58 -0400 Received: from mail01.noris.net ([62.128.1.221]:44947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTkEY-00049G-H3 for 69554@debbugs.gnu.org; Tue, 16 Jul 2024 11:36:56 -0400 Received: from p57b08481.dip0.t-ipconnect.de ([87.176.132.129] helo=[192.168.110.2]) by mail01.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1sTkEU-0007ma-FL; Tue, 16 Jul 2024 17:36:50 +0200 Content-Type: multipart/alternative; boundary="------------qlDq76IOe7CrJVGDm7nur6u4" Message-ID: <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> Date: Tue, 16 Jul 2024 17:36:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> From: Hartmut Goebel Content-Language: de-DE, en-US Autocrypt: addr=h.goebel@crazy-compilers.com; keydata= xsFNBFJQM3oBEACiUXmMppc3+A7JpF3lPz8O/mRhfz1U6F4EOTlacTrCcm7Xg5U2JsPPNapV r5+vHnKBK+xbaX3s/A/G+SwrUZhi1X1HRnSNY1CqL8CT7rZmOtfjg4ExnOuCjie2bKhb9JKm lJ7MrNimIbNQoX1mRcQ4VMEflhyWfaPGbT73siuMkbr020ExhzW8T18JIC01SgWMULYMBXOB oGY21am/vaTFCK8bym1P4HVN8i64uOWL0agkAMHbju6SZtG2fYJ68eS3P/97bXRg1pveEdpa FgaFZhquecw4WdedwLwt1xNcjAg/p6tN73W3asEZTgMHa+iNzbJgcyhWpci09wQZfZ1uL0Hd M+ohng38ccgu9hJx6YzCN7Fe14JooKbPukG/WfClAgAzZSHRKpS4zGdGlg6D6EWayyWWoLR3 KoMA4LIIlaQbqaOhfe85b4mNgB1hqd0uRTHOah/6T+FUoSQ1IAeKLIDqj6rW7X4ISRn1CXGS LGDn2QKqR3KtU3cLf8hAeDeO7Qe1jTvLrG1Mfca8lEmC7/yN1gI7L4/cs6lhmXUgMaevuxss BxO2kkh0OS8HVFf+QQ7LZ5vt91yQVT9HVvOuVob0YtG+3rvkpMaHQilK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jRY671qAvt6Q4uEsnDcz1g06zLnJKQLs9tEg4kCP32w kgMrrtAFQwbWzGTxf3xnjVooEJHHI7vOCzj83BQM4sq2Mp6kyuKjrAM+kLZChg8gd+Koj7fj eUIfwDjLCf3Ax7+g1QEqSqVsYxEB60oLONGMy0V31mofwefbWyFEhf7Mkb3lq01JtJ8TYNIL piWwGAMdoMZO8fXmTslMrRAStK3PpuUV1R3iAiqBHfyGYPQD5snxA4sHmWDSqI4OfUbVVkA6 OY6DWb43/DE= Organization: crazy-compilers.com In-Reply-To: <87ed7v0z8m.fsf@gnu.org> X-Noris-IP: 87.176.132.129 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------qlDq76IOe7CrJVGDm7nur6u4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 15.07.24 um 11:40 schrieb Ludovic Courtès: > My understanding is that ‘BUILD_TESTING’ is not standard, as the last > sentence above suggests. Thus I’m reluctant to passing this flag > unconditionally, as I guess it would fail for ‘CMakeLists.txt’ that do > not implement it, right? I just tested it, and all you get is a warning: $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(doo) $ cmake -DBUILD_TESTING=OFF . … -- Generating done (0.0s) CMake Warning:  Manually-specified variables were not used by the project:    BUILD_TESTING -- Build files have been written to: /tmp/xxx -- Regards Hartmut Goebel | Hartmut Goebel |h.goebel@crazy-compilers.com | |www.crazy-compilers.com | compilers which you thought are impossible | --------------qlDq76IOe7CrJVGDm7nur6u4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Am 15.07.24 um 11:40 schrieb Ludovic Courtès:
My understanding is that ‘BUILD_TESTING’ is not standard, as the last
sentence above suggests.  Thus I’m reluctant to passing this flag
unconditionally, as I guess it would fail for ‘CMakeLists.txt’ that do
not implement it, right?

I just tested it, and all you get is a warning:

$ cat CMakeLists.txt 
cmake_minimum_required(VERSION 3.0)
project(doo)
$ cmake -DBUILD_TESTING=OFF .

-- Generating done (0.0s)
CMake Warning:
 Manually-specified variables were not used by the project:

   BUILD_TESTING


-- Build files have been written to: /tmp/xxx


--

Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
--------------qlDq76IOe7CrJVGDm7nur6u4-- From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Greg Hogan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Oct 2024 15:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hartmut Goebel Cc: 69554@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172831600614099 (code B ref 69554); Mon, 07 Oct 2024 15:47:02 +0000 Received: (at 69554) by debbugs.gnu.org; 7 Oct 2024 15:46:46 +0000 Received: from localhost ([127.0.0.1]:47468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxpwb-0003fK-K1 for submit@debbugs.gnu.org; Mon, 07 Oct 2024 11:46:45 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:42138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxpwZ-0003f4-13 for 69554@debbugs.gnu.org; Mon, 07 Oct 2024 11:46:44 -0400 Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-712359d2c52so2311866a34.0 for <69554@debbugs.gnu.org>; Mon, 07 Oct 2024 08:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greghogan-com.20230601.gappssmtp.com; s=20230601; t=1728315930; x=1728920730; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ruWp/rZ9jR0y4Z4uet9EdFx2RLpEChwYF0Q80ZYqApo=; b=qu6gZcSuiI65A/XoC+eRFLm1S7+MewgRPZOl3q1lExwQm05oAPMXfFCctFHLWvhYxA y3jSeo94kmCLQ89BbkW6lPgCaaKHYLkxF+Ql0gszL9bgHsMOf2I5M2lL/lvZk9CFlaZr yFGwnU69+iy1bcQnUJ01fvMOhCqB4oYs7/GISw1qgFDTwTJy8Mc3ZFs8v0lrkS/cwCR/ Q9AYZ5EJTkdYYxBILGT6CXVTGqyW+sWVlIM9wCaSKz5qT9o5qXNxuMaZpDDOpT+Mr3FL oQgppnlEC4jF69n+MOrQobTSsx5vn2MmuArmArdHr5xzyFniIRiktzzaiub74xZS/20U 1PMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728315930; x=1728920730; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ruWp/rZ9jR0y4Z4uet9EdFx2RLpEChwYF0Q80ZYqApo=; b=kHaiiLWm5BoLdHPKUn8s8tO4YpImcPs5ODIElC/0HZ9j5A818DuJt8ZAVTrR4fKX97 q0m2kiWc/tdEZV62SmaWMw6jQxUh399qv+PWtlRCCCPuqtuxQBKJOXbhqC3/ziEUe08V MrEENDcdqYPeSaIV51X9CIgXCGD/PidqvFuxwM5zWg0kAbgAUJypEgu1uywFIfUnTHqZ OpTCMad0V00qlwIIUKw8U5TyIAWvcij7QpXl/iPZafjrkuflZpij6e4mibp3YcpMlki8 ZwmReMB7iCKkEKI+/lXvSkTRtmjGO8qH9cgN9BzTgsnlLBOPbFObaanzRAtbjxfGFvxD Rcsg== X-Forwarded-Encrypted: i=1; AJvYcCV57FFZDswN1nXjqIGUKVF+Px7qmqNxWAFbpf9TjZHQldD4CyRwR3jF5y8FIY58jQO0w0A4jQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywk/0uvYB7oC5uwa92AW1H1JzNr8FOb++ZGWZak45+MtfDcVOel 8ZCMqdOwk+aYMwetQkFvUTEn8SuSd/vJ60rGOzmz++be/YUO/1UtpMsR8jBMB9kr3JM1iKmwpuO 4S1QL+6cJvI6WhwOBToGEOa3399kIch0GAxjrwLxm4JI3V7iuvQQ= X-Google-Smtp-Source: AGHT+IFtkFUgjB2hMGV+ntasRk3MyF2PDJkadVI57GqAIfwnmQMwNuoGlJA3qAQq5Q+jKBEoZoyWzRbT4GdIQ0UnHjA= X-Received: by 2002:a05:6830:9cb:b0:710:d2d1:20f3 with SMTP id 46e09a7af769-71570bc3d2fmr25514a34.4.1728315929800; Mon, 07 Oct 2024 08:45:29 -0700 (PDT) MIME-Version: 1.0 References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> In-Reply-To: <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> From: Greg Hogan Date: Mon, 7 Oct 2024 11:45:18 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Jul 16, 2024 at 11:37=E2=80=AFAM Hartmut Goebel wrote: > > Am 15.07.24 um 11:40 schrieb Ludovic Court=C3=A8s: > > My understanding is that =E2=80=98BUILD_TESTING=E2=80=99 is not standard,= as the last > sentence above suggests. Thus I=E2=80=99m reluctant to passing this flag > unconditionally, as I guess it would fail for =E2=80=98CMakeLists.txt=E2= =80=99 that do > not implement it, right? > > I just tested it, and all you get is a warning: > > $ cat CMakeLists.txt > cmake_minimum_required(VERSION 3.0) > project(doo) > $ cmake -DBUILD_TESTING=3DOFF . > =E2=80=A6 > -- Generating done (0.0s) > CMake Warning: > Manually-specified variables were not used by the project: > > BUILD_TESTING > > > -- Build files have been written to: /tmp/xxx Hi Hartmut, Could we detect with `cmake -L` [1] that the package has a BUILD_TESTING option and only then pass this flag? [1] https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake= -L-A-H Greg From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Oct 2024 09:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Greg Hogan Cc: 69554@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.17283784104505 (code B ref 69554); Tue, 08 Oct 2024 09:07:01 +0000 Received: (at 69554) by debbugs.gnu.org; 8 Oct 2024 09:06:50 +0000 Received: from localhost ([127.0.0.1]:50923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy6B7-0001AY-Kx for submit@debbugs.gnu.org; Tue, 08 Oct 2024 05:06:50 -0400 Received: from mail03.noris.net ([62.128.1.223]:57755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy6B4-0001AO-6F for 69554@debbugs.gnu.org; Tue, 08 Oct 2024 05:06:47 -0400 Received: from p57b0937b.dip0.t-ipconnect.de ([87.176.147.123] helo=[192.168.110.2]) by mail03.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1sy6Au-0007j3-AR; Tue, 08 Oct 2024 11:06:36 +0200 Content-Type: multipart/alternative; boundary="------------Qc19ptplkjtPJ0FRNfHhQ03l" Message-ID: <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> Date: Tue, 8 Oct 2024 11:06:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> From: Hartmut Goebel Content-Language: de-DE, en-US Autocrypt: addr=h.goebel@crazy-compilers.com; keydata= xsFNBFJQM3oBEACiUXmMppc3+A7JpF3lPz8O/mRhfz1U6F4EOTlacTrCcm7Xg5U2JsPPNapV r5+vHnKBK+xbaX3s/A/G+SwrUZhi1X1HRnSNY1CqL8CT7rZmOtfjg4ExnOuCjie2bKhb9JKm lJ7MrNimIbNQoX1mRcQ4VMEflhyWfaPGbT73siuMkbr020ExhzW8T18JIC01SgWMULYMBXOB oGY21am/vaTFCK8bym1P4HVN8i64uOWL0agkAMHbju6SZtG2fYJ68eS3P/97bXRg1pveEdpa FgaFZhquecw4WdedwLwt1xNcjAg/p6tN73W3asEZTgMHa+iNzbJgcyhWpci09wQZfZ1uL0Hd M+ohng38ccgu9hJx6YzCN7Fe14JooKbPukG/WfClAgAzZSHRKpS4zGdGlg6D6EWayyWWoLR3 KoMA4LIIlaQbqaOhfe85b4mNgB1hqd0uRTHOah/6T+FUoSQ1IAeKLIDqj6rW7X4ISRn1CXGS LGDn2QKqR3KtU3cLf8hAeDeO7Qe1jTvLrG1Mfca8lEmC7/yN1gI7L4/cs6lhmXUgMa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3NNWAZAnPYyEntPWMKTYlwJZDNURqT NSE3TlS3RUpHJ/y7FeSUQ0kVMmpFZjRY671qAvt6Q4uEsnDcz1g06zLnJKQLs9tEg4kCP32w kgMrrtAFQwbWzGTxf3xnjVooEJHHI7vOCzj83BQM4sq2Mp6kyuKjrAM+kLZChg8gd+Koj7fj eUIfwDjLCf3Ax7+g1QEqSqVsYxEB60oLONGMy0V31mofwefbWyFEhf7Mkb3lq01JtJ8TYNIL piWwGAMdoMZO8fXmTslMrRAStK3PpuUV1R3iAiqBHfyGYPQD5snxA4sHmWDSqI4OfUbVVkA6 OY6DWb43/DE= Organization: crazy-compilers.com In-Reply-To: X-Noris-IP: 87.176.147.123 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------Qc19ptplkjtPJ0FRNfHhQ03l Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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@crazy-compilers.com | |www.crazy-compilers.com | compilers which you thought are impossible | --------------Qc19ptplkjtPJ0FRNfHhQ03l Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
--------------Qc19ptplkjtPJ0FRNfHhQ03l-- From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Greg Hogan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Oct 2024 17:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hartmut Goebel Cc: 69554@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172840808611815 (code B ref 69554); Tue, 08 Oct 2024 17:22:02 +0000 Received: (at 69554) by debbugs.gnu.org; 8 Oct 2024 17:21:26 +0000 Received: from localhost ([127.0.0.1]:54224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syDtm-00034U-5R for submit@debbugs.gnu.org; Tue, 08 Oct 2024 13:21:26 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:47391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syDtj-00034D-C4 for 69554@debbugs.gnu.org; Tue, 08 Oct 2024 13:21:24 -0400 Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-7157c329d93so321237a34.3 for <69554@debbugs.gnu.org>; Tue, 08 Oct 2024 10:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greghogan-com.20230601.gappssmtp.com; s=20230601; t=1728408009; x=1729012809; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VyrcT3XZpQScFh7FO/bbRzmQ8ny4vk1HoWXHapnBC+c=; b=Kmi3QSqc5fiLXxyp3AuINSpLeIV1pOdlI1cbCsZUm0AZJelWCQUC7YpcqILcl3tN9L nzIr47Vz1WnXHDh8tcd/OO9Op4PkBGu80lLuE1wt8cKa64B9IUrWJ/inaBMjwan+Ie6/ RAc1jkwh6ntWtRma2Odwg2EymI40cyHghRQhn86fJbKVK7a/qlUrIUmXQ8qJRRPTIGXD KZFTps1q+TpJdNt8TUTmbGN0EJjfbYwv2JkIGUeHfgiGV0E87KYfTEK+P+QNYp2ep80W 3hZH7Nb6TGqtzfXZj+3iLAqttac2cZIqnVE0bwr1TxFmoq91vR5mSE7FZucmpAQD2Aio zTJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728408009; x=1729012809; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VyrcT3XZpQScFh7FO/bbRzmQ8ny4vk1HoWXHapnBC+c=; b=IaQitNtm7+IbF6kGn1gl+fE2hQRmdAeF4qp1YlycqPPtDY9i5tVT2a9uhzEpitObPy UoYceRPRfqu0GZvIelW+2WkNK8iCIxqensfRl3FWBSR/FOtBv8PRggsctInQv+i7oO4y gW4EE/I7HfyDUEoyyQMNMmV3Ex1TjOgYX938jNB+cqf/Q1lBOBMarpRSGoWBM2/yffZR DtSlxa3j/F4qzsJlg0cvQw1tvSC5AQQQQT0bLJr4oaObHjIyPN45jGTOhLtTWQpTVbY3 pQcjhagDI/100rcxbK1RPfRdk3RkEN/za9Fpzq+8qnJiTxxTYOveLGGxC7v9Mrt9I1Ia hiiA== X-Forwarded-Encrypted: i=1; AJvYcCWSelZVmT3EVIq4jKRieP6UCirGvobB0ycNUUrL6DjP1wz9oHY68owZDRv7yJDgwIFIAxj16w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YztYbYMUrAhwLkKZ9B21KzDJ13IcsYRhCR4lssHfmOs76aPj1YM ZrHVQf+mlZSIxxsHu6Zql+lRl2Vle3Ps2RWk6gcEC4XFMg2ay3Jmq9kwoDcwuUZBYqOtnnsaXv+ /8PDW1eqmE6UqIJm6ASM9hazCopMNUn0+wQbDDw== X-Google-Smtp-Source: AGHT+IFkMjEAIWNiWwUE8M3EizWI+S6g3mScFbkn+YEKTQ88wXOEL/Wrs270zINkUlcu/a0kH4Kun4ch1Qx9GECUTeo= X-Received: by 2002:a05:6830:3808:b0:709:396c:c465 with SMTP id 46e09a7af769-7154e83a6a3mr14635333a34.18.1728408008703; Tue, 08 Oct 2024 10:20:08 -0700 (PDT) MIME-Version: 1.0 References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> In-Reply-To: <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> From: Greg Hogan Date: Tue, 8 Oct 2024 13:19:57 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Oct 2024 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Greg Hogan Cc: 69554@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172845915322830 (code B ref 69554); Wed, 09 Oct 2024 07:33:02 +0000 Received: (at 69554) by debbugs.gnu.org; 9 Oct 2024 07:32:33 +0000 Received: from localhost ([127.0.0.1]:55501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syRBR-0005wA-DR for submit@debbugs.gnu.org; Wed, 09 Oct 2024 03:32:33 -0400 Received: from mail03.noris.net ([62.128.1.223]:40239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syRBN-0005vy-8u for 69554@debbugs.gnu.org; Wed, 09 Oct 2024 03:32:31 -0400 Received: from p57b097e4.dip0.t-ipconnect.de ([87.176.151.228] helo=[192.168.110.2]) by mail03.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1syRBC-0002ZZ-Bc; Wed, 09 Oct 2024 09:32:18 +0200 Content-Type: multipart/alternative; boundary="------------vP5e65F4D0mF2Wvl7LbnNAYw" Message-ID: <7a1b7263-3526-43f9-910b-3148fb9b56ba@crazy-compilers.com> Date: Wed, 9 Oct 2024 09:32:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> From: Hartmut Goebel Content-Language: de-DE, en-US Autocrypt: addr=h.goebel@crazy-compilers.com; keydata= xsFNBFJQM3oBEACiUXmMppc3+A7JpF3lPz8O/mRhfz1U6F4EOTlacTrCcm7Xg5U2JsPPNapV r5+vHnKBK+xbaX3s/A/G+SwrUZhi1X1HRnSNY1CqL8CT7rZmOtfjg4ExnOuCjie2bKhb9JKm lJ7MrNimIbNQoX1mRcQ4VMEflhyWfaPGbT73siuMkbr020ExhzW8T18JIC01SgWMULYMBXOB oGY21am/vaTFCK8bym1P4HVN8i64uOWL0agkAMHbju6SZtG2fYJ68eS3P/97bXRg1pveEdpa FgaFZhquecw4WdedwLwt1xNcjAg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Ye tng4kEdmcAzT/eeL279Tu0GolFHQSkBZMeAp6qJu+JmFTsDAFhx+X+14mpU2CP352xDF9tDf Gw51b9jIhuKgkB1uukYSDghUTH3rW5+rxuwvNgQ7YDgznyykESfaCUeqVAabA8xKbErKM8G6 PLS93Zu1FJKCr2R2Br2HsI7Yi6g9VTM5Rws1COE0ApJr/GEnebpUh0QcOUiRxtx2LCR4nQI9 Vb6Dky+6aaWz4NsawdLJCym9MxKsGBwV70+xoqOVyA3NNWAZAnPYyEntPWMKTYlwJZDNURqT NSE3TlS3RUpHJ/y7FeSUQ0kVMmpFZjRY671qAvt6Q4uEsnDcz1g06zLnJKQLs9tEg4kCP32w kgMrrtAFQwbWzGTxf3xnjVooEJHHI7vOCzj83BQM4sq2Mp6kyuKjrAM+kLZChg8gd+Koj7fj eUIfwDjLCf3Ax7+g1QEqSqVsYxEB60oLONGMy0V31mofwefbWyFEhf7Mkb3lq01JtJ8TYNIL piWwGAMdoMZO8fXmTslMrRAStK3PpuUV1R3iAiqBHfyGYPQD5snxA4sHmWDSqI4OfUbVVkA6 OY6DWb43/DE= Organization: crazy-compilers.com In-Reply-To: X-Noris-IP: 87.176.151.228 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------vP5e65F4D0mF2Wvl7LbnNAYw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 08.10.24 um 19:19 schrieb Greg Hogan: > 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.") This is a neat trick! Did you check whether this also overwrites any default in CMakeList.txt? Otherwise we might need to pass `-DBUILD_TESTING=…` on the command line, too. -- Regards Hartmut Goebel | Hartmut Goebel |h.goebel@crazy-compilers.com | |www.crazy-compilers.com | compilers which you thought are impossible | --------------vP5e65F4D0mF2Wvl7LbnNAYw Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Am 08.10.24 um 19:19 schrieb Greg Hogan:
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.")

This is a neat trick!

Did you check whether this also overwrites any default in CMakeList.txt? Otherwise we might need to pass `-DBUILD_TESTING=…` on the command line, too.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
--------------vP5e65F4D0mF2Wvl7LbnNAYw-- From unknown Sat Aug 16 18:43:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. Resent-From: Greg Hogan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Oct 2024 15:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hartmut Goebel Cc: 69554@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 69554-submit@debbugs.gnu.org id=B69554.172848638919811 (code B ref 69554); Wed, 09 Oct 2024 15:07:02 +0000 Received: (at 69554) by debbugs.gnu.org; 9 Oct 2024 15:06:29 +0000 Received: from localhost ([127.0.0.1]:57371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syYGi-00059T-Pf for submit@debbugs.gnu.org; Wed, 09 Oct 2024 11:06:29 -0400 Received: from mail-ot1-f41.google.com ([209.85.210.41]:57723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syYGg-000597-FQ for 69554@debbugs.gnu.org; Wed, 09 Oct 2024 11:06:27 -0400 Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-710e01dd554so3917621a34.3 for <69554@debbugs.gnu.org>; Wed, 09 Oct 2024 08:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greghogan-com.20230601.gappssmtp.com; s=20230601; t=1728486310; x=1729091110; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ux0mSKXFDDu6YMJofE0WffTZpE6xbY7874QwhlHfhCA=; b=LvDmlxIlNFCQmK5RY8GFU1E40S9lE91W0zUFWuGabDqB3t0sOGfvb8oitBPu+tHtvK 35mm/UW1XFxtt1vBNBRnhlgWhw7tOcURtxG/4Clfj++/SbJJj7s9zhc/S71WwbaV7QVM u+mm/NvJ2GTLPAbl4wOTXt2nMXm1Gtc7P9sOJ8CB1kjiwn06O1sPNg3U68hJ6pl3rzYk Ab9mo25f/OeTPKnfZnTsrBD63m8/eCqzpQU/VQpjlxJZN98uRwey2F2if+anHPR/KPrQ GycdLM9MbtLjZs8ohcPmm7+SYSJuSWx8SQM3Ih3nfkGF4bmD3qpGfzJSWUj/YW5ER9EM ePJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728486310; x=1729091110; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ux0mSKXFDDu6YMJofE0WffTZpE6xbY7874QwhlHfhCA=; b=YoMek5+VxEncTpoYgKE1DaoyEz01ccSbC9rqgAC11WPchu1mCe+ko5b7zbFWlssD5F O2CEA3yUOQLqoKNcaN7RWHQqRgkM4fxYJQJbMbyiIowICA+F5As471JtWc2DJuXnoJsE x+ZGdorVWKqFu3zEriERV/843iBK116IuWqqxZP/u/QfsltmQk2YJmXMm1YtjZ/djaZL UukmZSrHUTvBucjqLffyWau3ffJfkgrsWuq8AnUmlbEv3nmTL7lpTdntO9vdm5PMsopj BLMh1lG3csS2k7veE0YGwfJG7nwtL+pxHqn1AdtzuNEfjQm5P7eeTAY9jHh8heSbIHoK bAyQ== X-Forwarded-Encrypted: i=1; AJvYcCXODqn5KWs5U3ZIP12mW8onxAWMuHsAshw0kneISuLI57JQdEHje/4NQ4fM09kx+ILmYUZjng==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyuSBW8TB8qO5uSfubnivNwm5X9eigR/UtReRwXoXC4nRKEDGp8 Z8F1XFwr9lLH1Z39T2JXvCVYu+xoB/seIKRiJ6w7glmquNrztk/wseMRwIJ/PUilQ/dnkiYA3Zp 55BLw32GahLWwhhq2eIuSq4Yik93RBV2OjQ5hxw== X-Google-Smtp-Source: AGHT+IEq9N2pQrbtn/N1enOJBG9R2eExvQf1MBRZrNWjND/mLd39KHS8f3cy1BzDuBvfg8koVslh8CG3dQo92c/Cslg= X-Received: by 2002:a05:6830:3883:b0:709:49c5:fd99 with SMTP id 46e09a7af769-716a419729amr2561678a34.4.1728486310431; Wed, 09 Oct 2024 08:05:10 -0700 (PDT) MIME-Version: 1.0 References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> <7a1b7263-3526-43f9-910b-3148fb9b56ba@crazy-compilers.com> In-Reply-To: <7a1b7263-3526-43f9-910b-3148fb9b56ba@crazy-compilers.com> From: Greg Hogan Date: Wed, 9 Oct 2024 11:04:58 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Oct 9, 2024 at 3:32=E2=80=AFAM Hartmut Goebel wrote: > > Am 08.10.24 um 19:19 schrieb Greg Hogan: > > 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.") > > This is a neat trick! > > Did you check whether this also overwrites any default in CMakeList.txt? = Otherwise we might need to pass `-DBUILD_TESTING=3D=E2=80=A6` on the comman= d line, too. As I understand it, setting a variable in a "-C" cache file and with a "-D" command-line argument is equivalent. The only difference is the requisite precedence, and since we are not specifying "FORCE" for the "-C" cache file entries any "-D" configure-flags from a Guix package take precedence. I also noticed the following in my simple test project, so I am looking to also move these "-D" arguments into the "-C" cache file in cmake-build's configure. --8<---------------cut here---------------start------------->8--- CMake Warning: Manually-specified variables were not used by the project: CMAKE_INSTALL_LIBDIR --8<---------------cut here---------------end--------------->8--- This persistent cache is the lowest-level scope [1] so is overwritten by a "set" command in any CMakeLists.txt. An "option" (for example BUILD_TESTING in the CTest module) does not affect a normal or cache variable [2]. [1] https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#cmake-= language-variables [2] https://cmake.org/cmake/help/latest/command/option.html From unknown Sat Aug 16 18:43:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Hartmut Goebel Subject: bug#69554: closed (Re: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`.) Message-ID: References: <8ddae1f4-da16-42b2-9281-6f71c9b3fed9@crazy-compilers.com> X-Gnu-PR-Message: they-closed 69554 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 69554@debbugs.gnu.org Date: Tue, 15 Oct 2024 09:18:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1728983882-30350-1" This is a multi-part message in MIME format... ------------=_1728983882-30350-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #69554: [PATCH] build-system: cmake: Build tests depending on `#:tests?`. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 69554@debbugs.gnu.org. --=20 69554: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69554 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1728983882-30350-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 69554-close) by debbugs.gnu.org; 15 Oct 2024 09:17:26 +0000 Received: from localhost ([127.0.0.1]:54096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t0dgE-0007sP-EK for submit@debbugs.gnu.org; Tue, 15 Oct 2024 05:17:26 -0400 Received: from mail02.noris.net ([62.128.1.232]:58577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t0dgB-0007sE-B7 for 69554-close@debbugs.gnu.org; Tue, 15 Oct 2024 05:17:25 -0400 Received: from p5b394a5f.dip0.t-ipconnect.de ([91.57.74.95] helo=hermia.goebel-consult.de) by mail02.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1t0dfs-0006lI-2Q; Tue, 15 Oct 2024 11:17:04 +0200 Received: from [127.0.0.1] (hermia.goebel-consult.de [192.168.110.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hermia.goebel-consult.de (Postfix) with ESMTPS id 26A885F524; Tue, 15 Oct 2024 11:17:01 +0200 (CEST) Message-ID: <8ddae1f4-da16-42b2-9281-6f71c9b3fed9@crazy-compilers.com> Date: Tue, 15 Oct 2024 11:17:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`. To: Greg Hogan References: <7676fd973fa640750306df216feb95c335b345de.1709593063.git.h.goebel@crazy-compilers.com> <87ed7v0z8m.fsf@gnu.org> <079bf725-1855-498f-8863-d7ac7a6c6065@crazy-compilers.com> <59738aa6-a912-4b21-b559-1a952d7d6bb9@crazy-compilers.com> <7a1b7263-3526-43f9-910b-3148fb9b56ba@crazy-compilers.com> From: Hartmut Goebel Content-Language: de-DE, en-US Autocrypt: addr=h.goebel@crazy-compilers.com; keydata= xsFNBFJQM3oBEACiUXmMppc3+A7JpF3lPz8O/mRhfz1U6F4EOTlacTrCcm7Xg5U2JsPPNapV r5+vHnKBK+xbaX3s/A/G+SwrUZhi1X1HRnSNY1CqL8CT7rZmOtfjg4ExnOuCjie2bKhb9JKm lJ7MrNimIbNQoX1mRcQ4VMEflhyWfaPGbT73siuMkbr020ExhzW8T18JIC01SgWMULYMBXOB oGY21am/vaTFCK8bym1P4HVN8i64uOWL0agkAMHbju6SZtG2fYJ68eS3P/97bXRg1pveEdpa FgaFZhquecw4WdedwLwt1xNcjAg/p6tN73W3asEZTgMHa+iNzbJgcyhWpci09wQZfZ1uL0Hd M+ohng38ccgu9hJx6YzCN7Fe14JooKbPukG/WfClAgAzZSHRKpS4zGdGlg6D6EWayyWWoLR3 KoMA4LIIlaQbqaOhfe85b4mNgB1hqd0uRTHOah/6T+FUoSQ1IAeKLIDqj6rW7X4ISRn1CXGS LGDn2QKqR3KtU3cLf8hAeDeO7Qe1jTvLrG1Mfca8lEmC7/yN1gI7L4/cs6lhmXUgMaevuxss BxO2kkh0OS8HVFf+QQ7LZ5vt91yQVT9HVvOuVob0YtG+3rvkpMaHQilKloNoEkmMiHpwypBa IfAC6NP9smgionvvmQ5RWSEaH5/pfSUAYbqzWbqDxtqEF/mPOwARAQAB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HI7vOCzj83BQM4sq2Mp6kyuKjrAM+kLZChg8gd+Koj7fj eUIfwDjLCf3Ax7+g1QEqSqVsYxEB60oLONGMy0V31mofwefbWyFEhf7Mkb3lq01JtJ8TYNIL piWwGAMdoMZO8fXmTslMrRAStK3PpuUV1R3iAiqBHfyGYPQD5snxA4sHmWDSqI4OfUbVVkA6 OY6DWb43/DE= Organization: crazy-compilers.com In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Noris-IP: 91.57.74.95 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69554-close Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 69554-close@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Greg, I did some testing with different combinations and with defining the option in CMakeList.txt. Everything works as I would expect. So please go for it. I'm closing this patch in favor of your #70031. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | ------------=_1728983882-30350-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Mar 2024 21:49:39 +0000 Received: from localhost ([127.0.0.1]:45072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhGBm-0003Ns-LF for submit@debbugs.gnu.org; Mon, 04 Mar 2024 16:49:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:52464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhGBi-0003NW-2p for submit@debbugs.gnu.org; Mon, 04 Mar 2024 16:49:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhGBD-0007UC-U4 for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:03 -0500 Received: from mail01.noris.net ([62.128.1.221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhGBA-0005Fn-BN for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:03 -0500 Received: from p57b08d98.dip0.t-ipconnect.de ([87.176.141.152] helo=hermia.goebel-consult.de) by mail01.noris.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1rhGB4-0003zV-Tn for guix-patches@gnu.org; Mon, 04 Mar 2024 22:48:54 +0100 Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id B53515F4DE; Mon, 4 Mar 2024 22:48:51 +0100 (CET) From: Hartmut Goebel To: guix-patches@gnu.org Subject: [PATCH] build-system: cmake: Build tests depending on `#:tests?`. Date: Mon, 4 Mar 2024 22:48:51 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Noris-IP: 87.176.141.152 Received-SPF: pass client-ip=62.128.1.221; envelope-from=h.goebel@crazy-compilers.com; helo=mail01.noris.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/build/cmake-build-system.scm (configure): New paremeter `#:tests?`. Add cmake option "-DBUILD_TESTING=" with value "ON" or "OFF" depending on build-system argument `#:tests?`. * * doc/guix.texi (Inspecting Services)[cmake-build-system]: Document it. --- doc/guix.texi | 10 ++++++++++ guix/build/cmake-build-system.scm | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 87fe9f803c..409d076d12 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9617,6 +9617,16 @@ parameter specifies in abstract terms the flags passed to the compiler; it defaults to @code{"RelWithDebInfo"} (short for ``release mode with debugging information''), which roughly means that code is compiled with @code{-O2 -g}, as is the case for Autoconf-based packages by default. + +Depending on the @code{#:tests?} parameter, the configure-flag +@code{BUILD_TESTING} is set to @code{ON} resp. @code{OFF}. +@code{BUILD_TESTING} is a +@url{https://cmake.org/cmake/help/v3.28/module/CTest.html, standard +defined by CMake} to enable or disable building tests. This aims to +save build time if tests are not run anyway, while trying to ensure +tests are build if they should be run. Anyhow, the CMakeLists.txt needs +to implement handling this flag. + @end defvar @defvar composer-build-system diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d1ff5071be..71e8ca8a83 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -33,7 +33,7 @@ (define-module (guix build cmake-build-system) ;; Code: (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) - build-type target + (tests? #t) build-type target #:allow-other-keys) "Configure the given package." (let* ((out (assoc-ref outputs "out")) @@ -62,6 +62,11 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib") ;; enable verbose output from builds "-DCMAKE_VERBOSE_MAKEFILE=ON" + ;; ask for (not) building tests depending on #:tests? + ;; (CMakeLists.txt may or may not implement this check) + ,@(if tests? + '("-DBUILD_TESTING=OFF") ; not run anyway + '("-DBUILD_TESTING=ON")) ; overwrite any default option ;; Cross-build ,@(if target base-commit: 3da49b1472919a62df1fe399638f23a246aa325d -- 2.41.0 ------------=_1728983882-30350-1--