Skip to content

Commit

Permalink
Fix MSVC CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed May 22, 2024
1 parent 08c0a13 commit c28ca79
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c28ca79

Please sign in to comment.