fix: msvc fixes

This commit is contained in:
Hyblocker committed 2026-03-01 20:08:19 +01:00
1 parent 33d2baae9c
commit 6e0ca20bda
3 files changed
+15 -3

No files matched your search

+12
View File
@@ -17,6 +17,11 @@ function(adjust_bin_paths lib)
)
endfunction()
# windows prefers win8.1 sdk instead of win 10 sdk for some god forsaken reason
if(WIN32)
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "Forcing Win10 SDK" FORCE)
endif()
project("SpaceCalibrator")
# 3rd party stuff
@@ -57,5 +62,12 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_C_COMPILER_ID}" S
/GF) # eliminate duplicate strings
endif()
# Match SteamVR build flags on MSVC
if(MSVC)
add_compile_options(/guard:cf /GS)
add_link_options("/GUARD:CF")
add_compile_options($<$<CONFIG:Release>:/Ot> $<$<CONFIG:Release>:/Oi> $<$<CONFIG:Release>:/Gy>)
endif()
# Include project
add_subdirectory ("src")
+1 -1
View File
@@ -1,2 +1,2 @@
@ECHO OFF
cmake -G "Visual Studio 17 2022" -T ClangCL -A x64 -B bin -S .
cmake -G "Visual Studio 17 2022" -A x64 -B bin -S .
+2 -2
View File
@@ -76,7 +76,7 @@ target_compile_definitions(SpaceCalibratorCommon
$<$<NOT:$<CONFIG:Debug>>:QUILL_COMPILE_ACTIVE_LOG_LEVEL=QUILL_COMPILE_ACTIVE_LOG_LEVEL_INFO>
)
if (MSVC)
if(NOT MSVC)
target_compile_options(SpaceCalibratorCommon
PRIVATE -fno-exceptions)
endif()
@@ -96,7 +96,7 @@ target_compile_definitions(SpaceCalibratorCommon
if (MSVC)
target_compile_options(SpaceCalibratorCommon
PRIVATE
/EHs-
/EHsc
$<$<CONFIG:RELEASE>:/Ob2 /Zc:inline>
$<$<CONFIG:RELWITHDEBINFO>:/Ob2 /Zc:inline>
$<$<CONFIG:MINSIZEREL>:/Ob2 /Zc:inline>