[PATCH] D43156: Allow disabling PDB generation in Release build

Loo Rong Jie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 10 00:08:48 PST 2018


rongjiecomputer updated this revision to Diff 133743.
rongjiecomputer edited the summary of this revision.

https://reviews.llvm.org/D43156

Files:
  cmake/modules/HandleLLVMOptions.cmake


Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -354,10 +354,11 @@
   append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 
   # Generate PDB even in release for profiling.
-  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+  option(LLVM_DISABLE_PDB OFF)
+  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_DISABLE_PDB)
     append("/Zi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    append("/DEBUG" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-  endif (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+    append("/DEBUG /OPT:REF /OPT:ICF" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 
   # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's)
   # debug mode headers. Instead of only enabling them in VS2013's debug mode,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43156.133743.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180210/6a1dd4c7/attachment.bin>


More information about the llvm-commits mailing list