From 2bb4a4901bcbe3bb1d7c4b88064fd8c6bcc405e4 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Wed, 19 Dec 2018 18:01:42 +0000 Subject: [PATCH] Revert r349517 "[CMake] Default options for faster executables on MSVC" llvm-svn: 349656 --- llvm/CMakeLists.txt | 4 ---- llvm/cmake/modules/ChooseMSVCCRT.cmake | 9 --------- llvm/cmake/modules/HandleLLVMOptions.cmake | 8 -------- 3 files changed, 21 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 15f95d2e580c..e2e35dcebdb5 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -370,10 +370,6 @@ option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF) option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) -if (MSVC) - option(LLVM_ENABLE_INCREMENTAL_LINK "Link incrementally. Enabling it might produce slower executables." OFF) -endif() - option(LLVM_ENABLE_DUMP "Enable dump functions even when assertions are disabled" OFF) if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) diff --git a/llvm/cmake/modules/ChooseMSVCCRT.cmake b/llvm/cmake/modules/ChooseMSVCCRT.cmake index cdd7deec4c84..0e6e1aa55254 100644 --- a/llvm/cmake/modules/ChooseMSVCCRT.cmake +++ b/llvm/cmake/modules/ChooseMSVCCRT.cmake @@ -66,15 +66,6 @@ variables (LLVM_USE_CRT_DEBUG, etc) instead.") get_current_crt(LLVM_USE_CRT_${build} MSVC_CRT_REGEX CMAKE_CXX_FLAGS_${build}) - - # Make /MT the default in Release builds to make them faster - # and avoid the DLL function thunking. - if ((${build} STREQUAL "MINSIZEREL") OR - (${build} STREQUAL "RELEASE") OR - (${build} STREQUAL "RELWITHDEBINFO")) - set(LLVM_USE_CRT_${build} "MT") - endif() - set(LLVM_USE_CRT_${build} "${LLVM_USE_CRT_${build}}" CACHE STRING "Specify VC++ CRT to use for ${build_type} configurations." diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index e8b0e27e000d..49db3088bbc4 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -381,14 +381,6 @@ if( MSVC ) # "Enforce type conversion rules". append("/Zc:rvalueCast" CMAKE_CXX_FLAGS) - if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT LLVM_ENABLE_INCREMENTAL_LINK) - foreach(CONFIG RELEASE RELWITHDEBINFO MINSIZEREL) - foreach(FLAG EXE MODULE SHARED STATIC) - string(REGEX REPLACE "[-/](INCREMENTAL:YES|INCREMENTAL:NO|INCREMENTAL)" "/INCREMENTAL:NO" CMAKE_${FLAG}_LINKER_FLAGS_${CONFIG} "${CMAKE_${FLAG}_LINKER_FLAGS_${CONFIG}}") - endforeach() - endforeach() - endif() - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT LLVM_ENABLE_LTO) # clang-cl and cl by default produce non-deterministic binaries because # link.exe /incremental requires a timestamp in the .obj file. clang-cl