Use native CMake support for detecting architecture size

This commit is contained in:
Chris Thrasher 2023-08-15 12:58:24 -06:00
parent 5f87a04111
commit 37575e4ed7

View File

@ -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")