[packages/rpm-pld-macros] - 2.047: added __ON_OFF / __ON_OFF_not for cmake
qboosh
qboosh at pld-linux.org
Mon Mar 31 22:03:04 CEST 2025
commit ad50fe9d075b2314dc7c6de3e166c53036c822f3
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon Mar 31 20:08:54 2025 +0200
- 2.047: added __ON_OFF / __ON_OFF_not for cmake
macros.pld | 10 +++++++---
rpm-pld-macros.spec | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index 4c91c1f..13188b3 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define rpm_macros_rev 2.046
+%define rpm_macros_rev 2.047
%define find_lang_rev 1.42
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15
diff --git a/macros.pld b/macros.pld
index 9df286c..d76a5e3 100644
--- a/macros.pld
+++ b/macros.pld
@@ -618,13 +618,17 @@ LINKFLAGS="%{rpmldflags}" \
%__true_false() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}}
%__true_false_not() %{expand:%%{?with_%{1}:false}%%{!?with_%{1}:true}}
-# expands to enabled or disabled based on bcond; for use with meson or cmake (since 2.000)
+# expands to enabled or disabled based on bcond; for use with meson (since 2.000)
%__enabled_disabled() %{expand:%%{?with_%{1}:enabled}%%{!?with_%{1}:disabled}}
%__enabled_disabled_not() %{expand:%%{?with_%{1}:disabled}%%{!?with_%{1}:enabled}}
-# for use with cmake:
+# expands to enabled or disabled based on bcond; for use with cmake (since 2.047)
+%__ON_OFF() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
+%__ON_OFF_not() %{expand:%%{?with_%{1}:OFF}%%{!?with_%{1}:ON}}
+
+# for use with cmake (since 1.742):
# Usage: cmake_on_off BCOND_NAME [OPTION_NAME]
-# BuildRequires: rpmbuild(macros) >= 1.742
+# Deprecated: use clearer -DOPTION_NAME=%{__ON_OFF BCOND_NAME} instead
%cmake_on_off() -D%{?2}%{!?2:%{1}}:BOOL=%{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
#-----------------------------------------------------------------
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/ad50fe9d075b2314dc7c6de3e166c53036c822f3
More information about the pld-cvs-commit
mailing list