diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 50349bfbd0..f0e83af990 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -153,6 +153,12 @@ if(WINDOWS) set_source_files_properties(${COCOS_SPINE_SRC} base/ccFPSImages.c PROPERTIES LANGUAGE CXX) endif() +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(cocos2d IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() +endif() + #if(XCODE) # # Later versions of Xcode clang want to compile C++17 with aligned allocation turned on and this is only supported on iOS 11.0+ # # TODO: Only turn this off if ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} < 11.0 diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index a694ef80fe..312a719fd9 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -139,6 +139,9 @@ if(APPLE) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() # For code-signing, set the DEVELOPMENT_TEAM: diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index a5c669fab1..cbd8910c85 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -131,6 +131,9 @@ if(APPLE) set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() elseif(WINDOWS) cocos_copy_target_dll(${APP_NAME}) diff --git a/tests/cpp-empty-test/CMakeLists.txt b/tests/cpp-empty-test/CMakeLists.txt index ca691c764e..cba97253ad 100644 --- a/tests/cpp-empty-test/CMakeLists.txt +++ b/tests/cpp-empty-test/CMakeLists.txt @@ -132,6 +132,9 @@ if(XCODE) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() # For code-signing, set the DEVELOPMENT_TEAM: diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 28e33d2db9..6aef4dbf4b 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -403,6 +403,9 @@ if(APPLE) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() # For code-signing, set the DEVELOPMENT_TEAM: diff --git a/tests/lua-empty-test/project/CMakeLists.txt b/tests/lua-empty-test/project/CMakeLists.txt index 4aaa2d4eac..202fe0d143 100644 --- a/tests/lua-empty-test/project/CMakeLists.txt +++ b/tests/lua-empty-test/project/CMakeLists.txt @@ -105,6 +105,9 @@ if(APPLE) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() # For code-signing, set the DEVELOPMENT_TEAM: diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index 5becda024a..93bcd99285 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -118,6 +118,9 @@ if(APPLE) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + set_xcode_property(${APP_NAME} IPHONEOS_DEPLOYMENT_TARGET "8.0") + endif() endif() # For code-signing, set the DEVELOPMENT_TEAM: