void-packages/srcpkgs/llvm11/files/patches/llvm/llvm-004-override-opt.patch
Robin Voetter f8b6ce4acc new package: llvm11-11.0.0
Additional fixes by q66.
2020-11-17 04:14:14 +01:00

18 lines
553 B
Diff

This allows us to override the optimization level as not all platforms can
deal with -O3.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -999,6 +999,12 @@
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
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)