diff --git a/CMakeLists.txt b/CMakeLists.txt index cdcf2070e..dbaa5921e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,11 +120,15 @@ foreach(dir ${DIRLIST}) endforeach() # Detect CPU type and word size -if(CMAKE_OSX_ARCHITECTURES MATCHES "ppc") - set(CMAKE_SYSTEM_PROCESSOR ppc) -endif() math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8") string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC) +set(COUNT 1) +foreach(ARCH ${CMAKE_OSX_ARCHITECTURES}) + if(COUNT GREATER 1) + message(FATAL_ERROR "TurboVNC contains JNI code, so it cannot be built with multiple values in CMAKE_OSX_ARCHITECTURES.") + endif() + math(EXPR COUNT "${COUNT}+1") +endforeach() if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR @@ -151,6 +155,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" AND BITS EQUAL 32) else() set(CPU_TYPE ${CMAKE_SYSTEM_PROCESSOR_LC}) endif() +if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR + CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR + CMAKE_OSX_ARCHITECTURES MATCHES "i386" OR + CMAKE_OSX_ARCHITECTURES MATCHES "ppc") + set(CPU_TYPE ${CMAKE_OSX_ARCHITECTURES}) +endif() message(STATUS "${BITS}-bit build (${CPU_TYPE})") include(cmakescripts/FindTurboJPEG.cmake)