Fix build using clang-cl on windows and improve driver detection (#129)

This commit is contained in:
Jun Bo Bi 2022-09-04 17:15:40 -04:00 committed by GitHub
parent 4ed18a65c3
commit a54a3ec74e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 9 deletions

View file

@ -39,7 +39,15 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
# floating point model: precise, fiber safe optimizations
add_compile_options(/EHsc /fp:precise /GT)
add_compile_options(/EHsc /fp:precise)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Speeds up static linking (especially helpful in incremental compilation)
if((CMAKE_LINKER MATCHES ".*lld-link.*") AND (CMAKE_AR MATCHES ".*llvm-lib.*"))
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY STATIC_LIBRARY_OPTIONS /llvmlibthin)
endif()
else()
add_compile_options(/GT)
endif()
if (PUBLIC_RELEASE)
message(STATUS "Using additional optimization flags for MSVC")
add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed