mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add IOS_DEPLOYMENT_TARGET variable to iOS.cmake
- Gives an option to specify a lower deployment target version than the current SDK for backward compatibility. Change-Id: Ieb84ba7f42cdf925510f84b8e0cd01b5e9fc051b
This commit is contained in:
+3
-3
@@ -148,9 +148,9 @@ if (IOS)
|
||||
message(STATUS "Building Ceres for iOS platform: ${IOS_PLATFORM}")
|
||||
|
||||
# Ceres requires at least iOS 7.0+.
|
||||
if (IOS_SDK_VERSION VERSION_LESS 7.0)
|
||||
message(FATAL_ERROR "Unsupported iOS SDK version: ${IOS_SDK_VERSION}, Ceres "
|
||||
"required at least iOS version 7.0")
|
||||
if (IOS_DEPLOYMENT_TARGET VERSION_LESS 7.0)
|
||||
message(FATAL_ERROR "Unsupported iOS version: ${IOS_DEPLOYMENT_TARGET}, Ceres "
|
||||
"requires at least iOS version 7.0")
|
||||
endif()
|
||||
|
||||
update_cache_variable(MINIGLOG ON)
|
||||
|
||||
+13
-6
@@ -222,22 +222,29 @@ set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
|
||||
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
|
||||
set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
|
||||
|
||||
# Specify minimum version as latest SDK version. Note that only Xcode 7+
|
||||
# supports the newer more specific: -m${XCODE_IOS_PLATFORM}-version-min flags,
|
||||
# older versions of Xcode use: -m(ios/ios-simulator)-version-min instead.
|
||||
# Specify minimum version of deployment target.
|
||||
# Unless specified, the latest SDK version is used by default.
|
||||
set(IOS_DEPLOYMENT_TARGET "${IOS_SDK_VERSION}"
|
||||
CACHE STRING "Minimum iOS version to build for." )
|
||||
message(STATUS "Building for minimum iOS version: ${IOS_DEPLOYMENT_TARGET}"
|
||||
" (SDK version: ${IOS_SDK_VERSION})")
|
||||
|
||||
# Note that only Xcode 7+ supports the newer more specific:
|
||||
# -m${XCODE_IOS_PLATFORM}-version-min flags, older versions of Xcode use:
|
||||
# -m(ios/ios-simulator)-version-min instead.
|
||||
if (XCODE_VERSION VERSION_LESS 7.0)
|
||||
if (IOS_PLATFORM STREQUAL "OS")
|
||||
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
|
||||
"-mios-version-min=${IOS_SDK_VERSION}")
|
||||
"-mios-version-min=${IOS_DEPLOYMENT_TARGET}")
|
||||
else()
|
||||
# SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
|
||||
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
|
||||
"-mios-simulator-version-min=${IOS_SDK_VERSION}")
|
||||
"-mios-simulator-version-min=${IOS_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
else()
|
||||
# Xcode 7.0+ uses flags we can build directly from XCODE_IOS_PLATFORM.
|
||||
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
|
||||
"-m${XCODE_IOS_PLATFORM}-version-min=${IOS_SDK_VERSION}")
|
||||
"-m${XCODE_IOS_PLATFORM}-version-min=${IOS_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS
|
||||
|
||||
Reference in New Issue
Block a user