diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-05-21 20:07:44 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-05-21 20:07:44 -0600 |
| commit | c28ca79c0429515ec2ea41239e968978cc1a97ec (patch) | |
| tree | 0a0242df5a8c3dd19a8a77235cb2f757d124398f | |
| parent | 08c0a13e9f4aa61eeefff692e7aa58b923bd5cc6 (diff) | |
Fix MSVC CMake
| -rw-r--r-- | CMakeLists.txt | 16 |
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 |
