diff --git a/CMakeLists.txt b/CMakeLists.txt index d6401845..8d55fa0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,9 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 3.8) +# We use `IS_64BIT now: https://cmake.org/cmake/help/latest/command/cmake_host_system_information.html +cmake_minimum_required(VERSION 3.10) + set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 0464c772..2c160b2f 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -255,17 +255,16 @@ endif() ######################################################################## if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86) include(CheckTypeSize) - check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) - if(${SIZEOF_CPU} EQUAL 64) + cmake_host_system_information(RESULT ASSUME_64BIT_HOST QUERY IS_64BIT) + if(ASSUME_64BIT_HOST) overrule_arch(32 "CPU width is 64 bits") - endif() - if(${SIZEOF_CPU} EQUAL 32) + else() overrule_arch(64 "CPU width is 32 bits") endif() #MSVC 64 bit does not have MMX, overrule it if(MSVC) - if(${SIZEOF_CPU} EQUAL 64) + if(ASSUME_64BIT_HOST) overrule_arch(mmx "No MMX for Win64") endif() force_arch(sse "Built-in for MSVC > 2013")