From d08431177bbf3ae96c09e9c00e3db263a0cb27c1 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 24 Mar 2013 19:59:19 +0100 Subject: [PATCH] Fixed: Compilation under Mac OS X (CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT must be set on CMake command-line if needed) --- code/CMakeModules/nel.cmake | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 7f6402238..72e2d07e4 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -600,22 +600,7 @@ MACRO(NL_SETUP_BUILD) ENDIF(WIN32) IF(APPLE) - IF(IOS) - # Disable CMAKE_OSX_DEPLOYMENT_TARGET for iOS - SET(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE PATH "" FORCE) - ELSE(IOS) - IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE) - ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - ENDIF(IOS) - - IF(XCODE) - IF(IOS) - SET(CMAKE_OSX_SYSROOT "iphoneos" CACHE PATH "" FORCE) - ELSE(IOS) -# SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE) - ENDIF(IOS) - ELSE(XCODE) + IF(NOT XCODE) IF(CMAKE_OSX_ARCHITECTURES) SET(TARGETS_COUNT 0) SET(_ARCHS) @@ -791,16 +776,8 @@ MACRO(NL_SETUP_BUILD) SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) ELSE(IOS) - FOREACH(_SDK ${_CMAKE_OSX_SDKS}) - IF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") - SET(CMAKE_OSX_SYSROOT ${_SDK} CACHE PATH "" FORCE) - ENDIF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") - ENDFOREACH(_SDK) - IF(CMAKE_OSX_SYSROOT) ADD_PLATFORM_FLAGS("-isysroot ${CMAKE_OSX_SYSROOT}") - ELSE(CMAKE_OSX_SYSROOT) - MESSAGE(FATAL_ERROR "CMAKE_OSX_SYSROOT can't be determinated") ENDIF(CMAKE_OSX_SYSROOT) # Always force -mmacosx-version-min to override environement variable @@ -813,7 +790,7 @@ MACRO(NL_SETUP_BUILD) IF(HAVE_FLAG_SEARCH_PATHS_FIRST) SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first") ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST) - ENDIF(XCODE) + ENDIF(NOT XCODE) ELSE(APPLE) IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") ADD_PLATFORM_FLAGS("-m32 -march=i686")