Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -410,6 +410,8 @@ "Use Intel JIT API to inform Intel(R) VTune(TM) Amplifier XE 2011 about JIT code" OFF) +option(LLVM_ENABLE_PDB "Generate .pdb files for profiling in Release build" OFF) + if( LLVM_USE_INTEL_JITEVENTS ) # Verify we are on a supported platform if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_SYSTEM_NAME MATCHES "Linux" ) @@ -1022,4 +1024,3 @@ if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") include(InstallRequiredSystemLibraries) endif() - Index: llvm/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/cmake/modules/HandleLLVMOptions.cmake +++ llvm/cmake/modules/HandleLLVMOptions.cmake @@ -353,6 +353,11 @@ append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND LLVM_ENABLE_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" AND LLVM_ENABLE_PDB) + # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's) # debug mode headers. Instead of only enabling them in VS2013's debug mode, # we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900)