diff options
| -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 |
