From 578fe416570abe90d09ab036a6aeff68ebb7b5d2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 29 May 2021 22:12:50 -0700 Subject: [PATCH] Stop overriding CMake's release compile flags. These flags include basic compiler optimization flags without which software can get built completely unoptimized. While the shims appear to add their own optimization flag on macOS (at least, based on my ARM testing), they do not in the default Linux build which results in CMake packages like LLVM being built without optimizations. This both results in a very large bottle and exceedingly bad performance. This seems like the best fix to me, as the shims already seem to have the necessary logic to *re-map* optimization flag levels to what Homebrew prefers for platforms like macOS, and so leaving CMake alone to just do its thing seems like the cleanest solution. But I'm open to other suggested fixes if needed. I will note that without this, LLVM and any other CMake-built software on Linux is ... mostly unusable for me. --- Library/Homebrew/formula.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 96652ef5ae..e69e13500a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1461,8 +1461,6 @@ class Formula sig { returns(T::Array[String]) } def std_cmake_args args = %W[ - -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG - -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release