From d09698f19f3a57ce00baddc6142aa484d7d908f6 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Fri, 25 Dec 2015 17:36:08 -0500 Subject: [PATCH] Add -DNDEBUG to std_cmake_args CMake has -DNDEBUG and -O3 as its default flags for Release builds. Homebrew clears out the default CMake flags, which is fine for optimization because Homebrew passes its own optimization flag(s). -DNDEBUG wasn't added back in, though. This ensures -DNDEBUG is passed to CMake release builds by default, instead of individual formulas having to add it explicitly. This also removes explicit additions of -DNDEBUG from the formulae that had them -- gflags, llvm, and taglib. Closes Homebrew/homebrew#47378. Signed-off-by: Mike McQuaid --- Library/Homebrew/formula.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 68c836f2b3..36bdb0ffec 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1041,8 +1041,8 @@ class Formula # less consistent and the standard parameters are more memorable. def std_cmake_args %W[ - -DCMAKE_C_FLAGS_RELEASE= - -DCMAKE_CXX_FLAGS_RELEASE= + -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG + -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST