Skip to content

Commit

Permalink
Fix detection of 64-bit for Visual Studio 2019 and 2022 (Snaipe#25)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Carroll <carroll.michael@gmail.com>
  • Loading branch information
traversaro and mjcarroll authored Jun 13, 2023
1 parent 5690c4b commit e300cc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ endif()
set (MMK_MANGLING "none")

if (MSVC)
if (NOT _ARCH)
# Visual Studio generator version earlier than 2017 (included) default to x86,
# after 2019 (included) it defaults to amd64
# MSVC_VERSION = 1920 corresponds to Visual Studio 2019
if (NOT CMAKE_GENERATOR_PLATFORM AND MSVC_VERSION LESS 1920)
set (_ARCH "x86")
endif ()

Expand Down

0 comments on commit e300cc8

Please sign in to comment.