diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index 984822ede..9876f3f16 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -272,18 +272,33 @@ 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) - overrule_arch(32 "CPU width is 64 bits") - endif() - if(${SIZEOF_CPU} EQUAL 32) - overrule_arch(64 "CPU width is 32 bits") + if(CMAKE_VERSION VERSION_LESS 3.10) + check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) + if(${SIZEOF_CPU} EQUAL 64) + overrule_arch(32 "CPU width is 64 bits") + endif() + if(${SIZEOF_CPU} EQUAL 32) + overrule_arch(64 "CPU width is 32 bits") + endif() + else() + cmake_host_system_information(RESULT ASSUME_64BIT_HOST QUERY IS_64BIT) + if(ASSUME_64BIT_HOST) + overrule_arch(32 "CPU width is 64 bits") + else() + overrule_arch(64 "CPU width is 32 bits") + endif() endif() # MSVC 64 bit does not have MMX, overrule it if(MSVC) - if(${SIZEOF_CPU} EQUAL 64) - overrule_arch(mmx "No MMX for Win64") + if(CMAKE_VERSION VERSION_LESS 3.10) + if(${SIZEOF_CPU} EQUAL 64) + overrule_arch(mmx "No MMX for Win64") + endif() + else() + if(ASSUME_64BIT_HOST) + overrule_arch(mmx "No MMX for Win64") + endif() endif() force_arch(sse "Built-in for MSVC > 2013") force_arch(sse2 "Built-in for MSVC > 2013")