From 37575e4ed7c3b73089691af75e796117ebc86b7e Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 15 Aug 2023 12:58:24 -0600 Subject: [PATCH] Use native CMake support for detecting architecture size --- cmake/Config.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 58ee8ee8e..62bf40fef 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -5,12 +5,10 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # don't use the OpenGL ES implementation on Windows set(OPENGL_ES 0) - # detect the architecture (note: this test won't work for cross-compilation) - include(CheckTypeSize) - check_type_size(void* SIZEOF_VOID_PTR) - if(${SIZEOF_VOID_PTR} STREQUAL "4") + # detect the architecture + if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(ARCH_32BITS 1) - elseif(${SIZEOF_VOID_PTR} STREQUAL "8") + elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) set(ARCH_64BITS 1) else() message(FATAL_ERROR "Unsupported architecture")