From: joshuakraemer <joshuakraemer@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Add -DNDEBUG to CFLAGS and CXXFLAGS in CMake build style
Date: Fri, 16 Jul 2021 17:05:16 +0200 [thread overview]
Message-ID: <20210716150516._S0ptzG832QA-Li98xHdy8h0_UzN7PFEM1rqX4_MQ9s@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31990@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
There is an updated pull request by joshuakraemer against master on the void-packages repository
https://github.com/joshuakraemer/void-packages cmake-build-style
https://github.com/void-linux/void-packages/pull/31990
Add -DNDEBUG to CFLAGS and CXXFLAGS in CMake build style
CMake adds `-DNDEBUG` with build types `Release`, `MinSizeRel` and `RelWithDebInfo` (see https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU.cmake#L57). `NDEBUG` disables `assert()`, which can improve performance.
A patch file from https://github.com/void-linux/void-packages/pull/31990.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-style-31990.patch --]
[-- Type: text/x-diff, Size: 1163 bytes --]
From 85d8a78dce4ff0346dadf37969b4e58e128249ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joshua=20Kr=C3=A4mer?= <joshua@kraemer.link>
Date: Thu, 15 Jul 2021 23:56:25 +0200
Subject: [PATCH] Add -DNDEBUG to CFLAGS and CXXFLAGS in CMake build style
CMake adds -DNDEBUG with build types Release, MinSizeRel and RelWithDebInfo.
NDEBUG disables assert(), which can improve performance.
---
common/build-style/cmake.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index a7627e7dcf21..401dabad31c8 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -63,8 +63,8 @@ _EOF
cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
- # Override flags: https://gitlab.kitware.com/cmake/cmake/issues/19590
- CFLAGS="${CFLAGS/ -pipe / }" CXXFLAGS="${CXXFLAGS/ -pipe / }" \
+ # Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
+ CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
cmake ${cmake_args} ${configure_args} ${wrksrc}/${build_wrksrc}
# Replace -isystem with -I
next prev parent reply other threads:[~2021-07-16 15:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-15 22:04 [PR PATCH] " joshuakraemer
2021-07-15 22:07 ` [PR PATCH] [Updated] " joshuakraemer
2021-07-15 22:18 ` q66
2021-07-15 22:19 ` q66
2021-07-16 15:05 ` joshuakraemer [this message]
2021-07-16 15:10 ` joshuakraemer
2021-07-16 17:48 ` q66
2021-07-16 17:48 ` [PR PATCH] [Merged]: " q66
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210716150516._S0ptzG832QA-Li98xHdy8h0_UzN7PFEM1rqX4_MQ9s@z \
--to=joshuakraemer@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).