summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2024-05-21 20:07:44 -0600
committerKiritoDv <kiritodev01@gmail.com>2024-05-21 20:07:44 -0600
commitc28ca79c0429515ec2ea41239e968978cc1a97ec (patch)
tree0a0242df5a8c3dd19a8a77235cb2f757d124398f
parent08c0a13e9f4aa61eeefff692e7aa58b923bd5cc6 (diff)
Fix MSVC CMake
-rw-r--r--CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0fb65b..206aeaa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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