Fix MSVC CMake

This commit is contained in:
KiritoDv
2024-05-21 20:07:44 -06:00
parent 08c0a13e9f
commit c28ca79c04
+16
View File
@@ -5,6 +5,22 @@ include(FetchContent)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 11)
################################################################################
# Set target arch type if empty. Visual studio solution generator provides it.
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(NOT CMAKE_VS_PLATFORM_NAME)
set(CMAKE_VS_PLATFORM_NAME "x64")
endif()
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
endif()
endif()
# Link libgfxd
# Because libgfxd is not a CMake project, we have to manually fetch it and add it to the build