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.
This commit is contained in:
Chandler Carruth 2021-05-29 22:12:50 -07:00 committed by GitHub
parent eeef3f4fe7
commit 578fe41657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1461,8 +1461,6 @@ class Formula
sig { returns(T::Array[String]) } sig { returns(T::Array[String]) }
def std_cmake_args def std_cmake_args
args = %W[ args = %W[
-DCMAKE_C_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release