Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/HandleLLVMOptions.cmake
Show First 20 Lines • Show All 412 Lines • ▼ Show 20 Lines | if( MSVC ) | ||||
endif(NOT (MSVC_VERSION LESS 1900)) | endif(NOT (MSVC_VERSION LESS 1900)) | ||||
# "Generate Intrinsic Functions". | # "Generate Intrinsic Functions". | ||||
append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) | append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) | ||||
# "Enforce type conversion rules". | # "Enforce type conversion rules". | ||||
append("/Zc:rvalueCast" CMAKE_CXX_FLAGS) | 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) | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT LLVM_ENABLE_LTO) | ||||
# clang-cl and cl by default produce non-deterministic binaries because | # clang-cl and cl by default produce non-deterministic binaries because | ||||
# link.exe /incremental requires a timestamp in the .obj file. clang-cl | # link.exe /incremental requires a timestamp in the .obj file. clang-cl | ||||
# has the flag /Brepro to force deterministic binaries. We want to pass that | # has the flag /Brepro to force deterministic binaries. We want to pass that | ||||
# whenever you're building with clang unless you're passing /incremental | # whenever you're building with clang unless you're passing /incremental | ||||
# or using LTO (/Brepro with LTO would result in a warning about the flag | # or using LTO (/Brepro with LTO would result in a warning about the flag | ||||
# being unused, because we're not generating object files). | # being unused, because we're not generating object files). | ||||
# This checks CMAKE_CXX_COMPILER_ID in addition to check_cxx_compiler_flag() | # This checks CMAKE_CXX_COMPILER_ID in addition to check_cxx_compiler_flag() | ||||
▲ Show 20 Lines • Show All 561 Lines • Show Last 20 Lines |