SHA256
3
0
forked from pool/cmake

Accepting request 1119169 from home:jengelh:branches:devel:tools:building

- Stick -DNDEBUG back into CMAKE_C_FLAGS. Can't find a spontaneous
  resolution for projects relying on its presence.

OBS-URL: https://build.opensuse.org/request/show/1119169
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=551
This commit is contained in:
Dirk Mueller 2023-10-26 06:40:59 +00:00 committed by Git OBS Bridge
parent 5ffbae606f
commit 92274bd9cc
2 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 20 07:25:25 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Stick -DNDEBUG back into CMAKE_C_FLAGS. Can't find a spontaneous
resolution for projects relying on its presence.
-------------------------------------------------------------------
Fri Oct 13 08:06:23 UTC 2023 - Paolo Stivanin <info@paolostivanin.com>

View File

@ -10,6 +10,11 @@
%__cmake_make_prefix_relative() %{lua:print((string.gsub((rpm.expand("%1")), ((rpm.expand("%{_prefix}")) .. "/"), "", 1)))}
%__cmake_make_root_relative() %{lua:print((string.gsub((rpm.expand("%1")), "/", "", 1)))}
#
# Some cmake-using software has an unfortunate reliance on -DNDEBUG being
# present (when cmake is used without explicitly selecting a build type or
# cflags). Cf. https://bugzilla.redhat.com/show_bug.cgi?id=1692426
#
%cmake \
find %__sourcedir -type f -name CMakeLists.txt \\\
-exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\\\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\\\)/{s/^/#IGNORE /}' {} + \
@ -37,12 +42,12 @@
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
-DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
-DCMAKE_C_FLAGS="${CFLAGS:-%optflags}" \\\
-DCMAKE_C_FLAGS_RELWITHDEBINFO="${CFLAGS:-%optflags}" \\\
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags}" \\\
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${CXXFLAGS:-%optflags}" \\\
-DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" \\\
-DCMAKE_Fortran_FLAGS_RELWITHDEBINFO="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" \\\
-DCMAKE_C_FLAGS="-DNDEBUG ${CFLAGS:-%optflags}" \\\
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-DNDEBUG ${CFLAGS:-%optflags}" \\\
-DCMAKE_CXX_FLAGS="${CXXFLAGS:--DNDEBUG %optflags}" \\\
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${CXXFLAGS:--DNDEBUG %optflags}" \\\
-DCMAKE_Fortran_FLAGS="${FFLAGS:--DNDEBUG %optflags%{?_fmoddir: -I%_fmoddir}}" \\\
-DCMAKE_Fortran_FLAGS_RELWITHDEBINFO="${FFLAGS:--DNDEBUG %optflags%{?_fmoddir: -I%_fmoddir}}" \\\
-DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \\\
-DCMAKE_MODULE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed" \\\
-DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \\\