llvm.org GIT mirror llvm / a7c6704
Revert r349517 "[CMake] Default options for faster executables on MSVC" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349656 91177308-0d34-0410-b5e6-96231b3b80d8 Alexandre Ganea 9 months ago
3 changed file(s) with 0 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
368368 option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF)
369369 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
370370 option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
371
372 if (MSVC)
373 option(LLVM_ENABLE_INCREMENTAL_LINK "Link incrementally. Enabling it might produce slower executables." OFF)
374 endif()
375371
376372 option(LLVM_ENABLE_DUMP "Enable dump functions even when assertions are disabled" OFF)
377373
6565 get_current_crt(LLVM_USE_CRT_${build}
6666 MSVC_CRT_REGEX
6767 CMAKE_CXX_FLAGS_${build})
68
69 # Make /MT the default in Release builds to make them faster
70 # and avoid the DLL function thunking.
71 if ((${build} STREQUAL "MINSIZEREL") OR
72 (${build} STREQUAL "RELEASE") OR
73 (${build} STREQUAL "RELWITHDEBINFO"))
74 set(LLVM_USE_CRT_${build} "MT")
75 endif()
76
7768 set(LLVM_USE_CRT_${build}
7869 "${LLVM_USE_CRT_${build}}"
7970 CACHE STRING "Specify VC++ CRT to use for ${build_type} configurations."
379379
380380 # "Enforce type conversion rules".
381381 append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)
382
383 if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT LLVM_ENABLE_INCREMENTAL_LINK)
384 foreach(CONFIG RELEASE RELWITHDEBINFO MINSIZEREL)
385 foreach(FLAG EXE MODULE SHARED STATIC)
386 string(REGEX REPLACE "[-/](INCREMENTAL:YES|INCREMENTAL:NO|INCREMENTAL)" "/INCREMENTAL:NO" CMAKE_${FLAG}_LINKER_FLAGS_${CONFIG} "${CMAKE_${FLAG}_LINKER_FLAGS_${CONFIG}}")
387 endforeach()
388 endforeach()
389 endif()
390382
391383 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT LLVM_ENABLE_LTO)
392384 # clang-cl and cl by default produce non-deterministic binaries because