Updated Objective-C implementation to use ARC; removed i386 support

This commit is contained in:
Marco Antognini 2014-04-13 12:42:14 +02:00
parent ac28902b57
commit 0d47056132
10 changed files with 31 additions and 80 deletions

View file

@ -40,7 +40,7 @@ sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentatio
if(SFML_OS_MACOSX)
# add an option to build frameworks instead of dylibs (release only)
sfml_set_option(SFML_BUILD_FRAMEWORKS FALSE BOOL "TRUE to build SFML as frameworks libraries (release only), FALSE to build according to BUILD_SHARED_LIBS")
# add an option to let the user specify a custom directory for frameworks installation (SFML, sndfile, ...)
sfml_set_option(CMAKE_INSTALL_FRAMEWORK_PREFIX "/Library/Frameworks" STRING "Frameworks installation directory")
@ -101,6 +101,12 @@ if(SFML_OS_MACOSX)
return()
endif()
endif()
# Objective-C ARC requires a 64 bit runtime.
if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES should be 'x86_64' to support ARC")
return()
endif()
endif()
if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
@ -161,7 +167,7 @@ else()
add_library(SFML ${SFML_SOURCES})
# edit target properties
set_target_properties(SFML PROPERTIES
set_target_properties(SFML PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
MACOSX_FRAMEWORK_IDENTIFIER org.sfml-dev.SFML
@ -170,14 +176,14 @@ else()
PUBLIC_HEADER "${SFML_HEADERS}")
# add the remaining headers
add_custom_command(TARGET SFML
add_custom_command(TARGET SFML
POST_BUILD
COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* SFML.framework/Versions/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/Headers)
# adapt install directory to allow distributing dylibs/frameworks in users frameworks/application bundle
# NOTE : it's not required to link agains SFML.framework
set_target_properties(SFML PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
set_target_properties(SFML PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path/../Frameworks")
# install rule