void-packages/srcpkgs/llvm12/files/patches/llvm/llvm-004-override-opt.patch
q66 39374b4272 New package: llvm12-12.0.0
Distro changes since 11.0:

- html docs are now included (except lldb where they are broken)
- manpages are now included
- enabled linker build id
- libcxx(abi), libunwind, libomp are now built as subpackages
- disabled clangd on ppc32 (crashes assembler)
- template cleanups

Cross fixes by Leah.

Closes https://github.com/void-linux/void-packages/issues/28609
Closes https://github.com/void-linux/void-packages/issues/17935
2021-05-18 02:11:58 +02:00

18 lines
635 B
Diff

This allows us to override the optimization level as not all platforms can
deal with -O3.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
endif()
+set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
+
+if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
+ llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
+endif()
+
# Put this before tblgen. Else we have a circular dependence.
add_subdirectory(lib/Demangle)
add_subdirectory(lib/Support)