Skip to content

Commit

Permalink
Build: Support CMAKE_OSX_ARCHITECTURES
Browse files Browse the repository at this point in the history
... as long as it contains only a singular value, which must equal
"x86_64", "arm64", "i386", or "ppc".
  • Loading branch information
dcommander committed Dec 13, 2024
1 parent dda0283 commit c34e3e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ 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)
if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
Expand Down Expand Up @@ -158,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)

Expand Down

0 comments on commit c34e3e1

Please sign in to comment.