From 740488d89e69d026b8db0bf75b8bfe02ee464a3d Mon Sep 17 00:00:00 2001 From: kinichiro Date: Sat, 9 May 2020 18:46:13 +0900 Subject: Fix cmake build to enable masm with VS2019 To specify architecture Visual Studio 16 2019 requires -A option, and it is stored in variable CMAKE_GENERATOR_PLATFORM. Until Visual Studio 15 2017, architecture was indicated as part of generator string (e.g. "Visual Studio 15 2017 Win64") --- CMakeLists.txt | 2 +- crypto/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 515b3fc..a56f2e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,7 +299,7 @@ if(ENABLE_ASM) endif() elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") set(HOST_ASM_MACOSX_X86_64 true) - elseif(MSVC AND "${CMAKE_GENERATOR}" MATCHES "Win64") + elseif(MSVC AND ("${CMAKE_GENERATOR}" MATCHES "Win64" OR "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64")) set(HOST_ASM_MASM_X86_64 true) ENABLE_LANGUAGE(ASM_MASM) elseif(CMAKE_SYSTEM_NAME MATCHES "MINGW" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 01effbf..7867249 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -936,7 +936,8 @@ if(NOT ENABLE_ASM) add_definitions(-DOPENSSL_NO_ASM) else() if(MSVC) - if(NOT "${CMAKE_GENERATOR}" MATCHES "Win64") + if((NOT "${CMAKE_GENERATOR}" MATCHES "Win64") AND + (NOT "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64")) add_definitions(-DOPENSSL_NO_ASM) endif() elseif(WIN32) -- cgit v1.2.3-55-g6feb