[cmake] Disable manifest generation when LLD is the linker

Running mt.exe to make the manifest is really slow. Disabling manifest
generation doesn't seem to break anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner 2016-01-22 23:27:13 +00:00
parent be7879e869
commit 0fdcaf7ce8

View File

@ -55,6 +55,14 @@ int main() { return (float)x; }"
endif()
endif()
if (CMAKE_LINKER MATCHES "lld-link.exe")
# Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries. Adding
# manifests with mt.exe breaks LLD's symbol tables and takes as much time as
# the link. See PR24476.
append("/MANIFEST:NO"
CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
endif()
if( LLVM_ENABLE_ASSERTIONS )
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
if( NOT MSVC )
@ -514,10 +522,6 @@ macro(append_common_sanitizer_flags)
if (CMAKE_LINKER MATCHES "lld-link.exe")
# Use DWARF debug info with LLD.
append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
# Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries.
# Adding manifests with mt.exe breaks LLD's symbol tables. See PR24476.
append("/MANIFEST:NO"
CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
else()
# Enable codeview otherwise.
append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)