Skip to content

Commit

Permalink
update libpd cmake for xcode 10
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreguillot committed Sep 30, 2018
1 parent 0b424b4 commit d9cc0d8
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions Dependencies/LibPdBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,24 @@ project(libpd C)
#------------------------------------------------------------------------------#
# CMAKE MAC OS SPECIFIC
#------------------------------------------------------------------------------#

if(CMAKE_GENERATOR STREQUAL Xcode)
if(XCODE_VERSION VERSION_LESS "10.0")
set(XCODE_32BIT_LIMITATION OFF)
else()
set(XCODE_32BIT_LIMITATION ON)
message("32 bit limitation")
endif()
endif()

set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")

if(XCODE_32BIT_LIMITATION)
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()

set(LIBPD_PATH "${PROJECT_SOURCE_DIR}/../LibPd")
set(LIBPD_OUTPUT_DIRECTORY "./..")
Expand Down Expand Up @@ -314,15 +329,18 @@ endif()
#------------------------------------------------------------------------------#
set(THREADS_PREFER_PTHREAD_FLAG On)
set(CMAKE_THREAD_PREFER_PTHREAD True)
find_package(Threads REQUIRED)
if(NOT XCODE_32BIT_LIMITATION)
find_package(Threads REQUIRED)

if(LIBPD_INCLUDE_DYNAMIC_LIBRARY)
target_link_libraries(libpdshared Threads::Threads)
endif()
if(LIBPD_INCLUDE_STATIC_LIBRARY)
target_link_libraries(libpdstatic Threads::Threads)
if(LIBPD_INCLUDE_DYNAMIC_LIBRARY)
target_link_libraries(libpdshared Threads::Threads)
endif()
if(LIBPD_INCLUDE_STATIC_LIBRARY)
target_link_libraries(libpdstatic Threads::Threads)
endif()
endif()


if(MSVC)
link_directories(${PROJECT_SOURCE_DIR}/pure-data)
if(LIBPD_INCLUDE_DYNAMIC_LIBRARY)
Expand Down

0 comments on commit d9cc0d8

Please sign in to comment.