diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-01-27 00:56:38 -0800 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-01-27 02:50:36 -0800 |
| commit | 4a422dffaa8cbf4af2ccf8f126bc15d07bdca710 (patch) | |
| tree | 8c4cf38c297fc24fe0aa56184e4f46666a3feefa | |
| parent | f37c5f1f1c7f4e10bdbe8b510edf21a090842fdd (diff) | |
CMake: CMAKE_SIZEOF_VOID_P must be 8 for an x86_64 build
This is an issue because CMAKE_SYSTEM_PROCESSOR is defined as the host
processor when not cross-compiling, and building for Win32 doesn't count
as cross-compiling.
| -rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b56f9a4ea..c6f4b81a10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,7 @@ if(ENABLE_GENERIC) message(STATUS "Warning! Building generic build!") set(_M_GENERIC 1) add_definitions(-D_M_GENERIC=1) -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") +elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") set(_M_X86 1) set(_M_X86_64 1) add_definitions(-D_M_X86=1) @@ -180,7 +180,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") # CRC instruction set is used in the CRC32 hash function check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc) else() - message(FATAL_ERROR "You're building on an unsupported platform '${CMAKE_SYSTEM_PROCESSOR}'. Enable generic build if you really want a JIT-less binary.") + message(FATAL_ERROR "You're building on an unsupported platform: " + "'${CMAKE_SYSTEM_PROCESSOR}' with ${CMAKE_SIZEOF_VOID_P}-byte pointers." + " Enable generic build if you really want a JIT-less binary.") endif() |
