summaryrefslogtreecommitdiff
path: root/dev-util/binaryen/files/binaryen-undo-compile-flag-braindamage.patch
blob: 93a7b9aaf9ebd524b52eec77a48b8aba541314db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff -ru a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2021-04-16 14:09:26.000000000 -0400
+++ b/CMakeLists.txt	2021-04-24 09:48:11.792348791 -0400
@@ -137,17 +137,6 @@
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY${SUFFIX} "${PROJECT_BINARY_DIR}/lib")
 endforeach()
 
-option(BYN_ENABLE_LTO "Build with LTO" Off)
-if(BYN_ENABLE_LTO)
-  if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    message(FATAL_ERROR "ThinLTO is only supported by clang")
-  endif()
-  if(NOT APPLE)
-    add_link_flag("-fuse-ld=lld")
-  endif()
-  add_compile_flag("-flto=thin")
-endif()
-
 if(MSVC)
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") # VS2013 and older explicitly need /arch:sse2 set, VS2015 no longer has that option, but always enabled.
     add_compile_flag("/arch:sse2")
@@ -212,15 +201,6 @@
   set(CMAKE_THREAD_PREFER_PTHREAD ON)
   find_package(Threads REQUIRED)
   add_cxx_flag("-std=c++${CXX_STANDARD}")
-  if(NOT EMSCRIPTEN)
-    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
-      # wasm doesn't allow for x87 floating point math
-      add_compile_flag("-msse2")
-      add_compile_flag("-mfpmath=sse")
-    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv[2-6]" AND NOT CMAKE_CXX_FLAGS MATCHES "-mfpu=")
-      add_compile_flag("-mfpu=vfpv3")
-    endif()
-  endif()
   add_compile_flag("-Wall")
   if(ENABLE_WERROR)
     add_compile_flag("-Werror")
@@ -244,14 +224,6 @@
   elseif(NOT EMSCRIPTEN)
     add_compile_flag("-fPIC")
   endif()
-  add_debug_compile_flag("-O0")
-  add_debug_compile_flag("-g3")
-  if(EMSCRIPTEN)
-    # really focus on minimizing output size when compiling sources
-    add_nondebug_compile_flag("-Oz")
-  else()
-    add_nondebug_compile_flag("-O2")
-  endif()
   if(BYN_ENABLE_ASSERTIONS)
     # On non-Debug builds cmake automatically defines NDEBUG, so we
     # explicitly undefine it:
@@ -273,15 +245,6 @@
   add_nondebug_compile_flag("-flto")
 endif()
 
-# clang doesn't print colored diagnostics when invoked from Ninja
-if(UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
-  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-    add_compile_flag("-fdiagnostics-color=always")
-  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    add_compile_flag("-fcolor-diagnostics")
-  endif()
-endif()
-
 # Static libraries
 # Current (partial) dependency structure is as follows:
 # passes -> wasm -> asmjs -> support