From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2KKiHgNC5mVOmwAA62LTzQ:P1 (envelope-from ) for ; Mon, 04 Mar 2024 22:49:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 2KKiHgNC5mVOmwAA62LTzQ (envelope-from ) for ; Mon, 04 Mar 2024 22:49:55 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709588995; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l9qJKstBQYRbwo6xOuAmFBcL4kpF3zOtpuJpXOWyBHc=; b=Mmz6pPCvlg1LNiBAoNXnkqz7/PscolltRgJsAMsbeue4CnLPqQpcXB6hZkWJO6f7Kb3m/b bEB8lRxYP4EhDzX8Ts2T7Pr3DynuHCqFWwDCtuyAWDUcjKCMaSGRfh+l0tY1AeSHA+RbBj 4ATXt6C9QmCaelUK+PlkO00mHLSvDt5m5SvRHoH6G+Qf5FNjoHJ2iUKC3OhLph+Fd6WE1C IgwbLOsBzudxQ2cNmZuGIkfkQlo1CCCyV0EAjcgUjYPRFwKR0ZN1oBd2KY+ragAeG+pEjG JGs11A0+FmVe3RRv/ZMMQ/Hy4TPWOxX+yK9StK6R8RnKUXuA9p/Be5mjhOT4tQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709588995; a=rsa-sha256; cv=none; b=MJuIuYfmvPqXAlDfQUMTCvwZP5WK3muKy/1gu51L2JhA71O8pnWSEzzOe8ydBsXiR0NVXf /8lE7MHcAR04MbbYkedRApT+Ydld0gkVQDiQersuxkRRdl2adZ6tAYq4pV85PGsUOspQBL IT9kblhLb48UvnWG5SXwMkmbxqrlNt3Q2v8/K4PDqn3p0bYEVJAyqhwmnYS1dDidOfMXTE 75oIqeQ/wzmfOAUByG+WmZLZE/PBn3tNfkQ+ZPi5J7Mmmq1AY1bvKgQardWx8qjIopJPyS maXqN5UvqWhgfHTjV8JrY0mcsGKAxuR7G/cY7VVxjEUthv7sSSG7kyjLbV6D/Q== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 326036BFD5 for ; Mon, 4 Mar 2024 22:49:55 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhGBj-0007Yk-CC; Mon, 04 Mar 2024 16:49:35 -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 1rhGBh-0007YQ-5w for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:33 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhGBg-0005Jh-JX for guix-patches@gnu.org; Mon, 04 Mar 2024 16:49:32 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhGCA-0003OY-0T for guix-patches@gnu.org; Mon, 04 Mar 2024 16:50:02 -0500 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -3.21 X-Spam-Score: -3.21 X-Migadu-Queue-Id: 326036BFD5 X-TUID: uVXK82YZ1gao * 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