diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index 01d6b4adbd..f512262d65 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -325,4 +325,3 @@ function(cocos_use_pkg target pkg) endif() endfunction() - diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index f0e83af990..50349bfbd0 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -153,12 +153,6 @@ 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 312a719fd9..e842335e8f 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -27,6 +27,12 @@ cmake_minimum_required(VERSION 3.6) set(APP_NAME HelloCpp) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project @@ -139,9 +145,6 @@ 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 cbd8910c85..a972b6582d 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -27,6 +27,12 @@ set(APP_NAME HelloLua) project(${APP_NAME}) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + set(RUNTIME_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/runtime-src) set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/cocos2d-x) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) @@ -131,9 +137,6 @@ 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 cba97253ad..2628028508 100644 --- a/tests/cpp-empty-test/CMakeLists.txt +++ b/tests/cpp-empty-test/CMakeLists.txt @@ -27,6 +27,12 @@ set(APP_NAME cpp-empty-test) project(${APP_NAME}) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + if(NOT DEFINED BUILD_ENGINE_DONE) set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) @@ -132,9 +138,6 @@ 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 6aef4dbf4b..f3aeda703e 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -4,6 +4,12 @@ set(APP_NAME cpp-tests) project(${APP_NAME}) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + if(NOT DEFINED BUILD_ENGINE_DONE) set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) @@ -403,9 +409,6 @@ 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 202fe0d143..88cb012549 100644 --- a/tests/lua-empty-test/project/CMakeLists.txt +++ b/tests/lua-empty-test/project/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.6) set(APP_NAME lua-empty-test) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) @@ -105,9 +111,6 @@ 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 93bcd99285..15ebecd0bd 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.6) set(APP_NAME lua-tests) +if(XCODE) + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET) + SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0) + endif() +endif() + project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) @@ -118,9 +124,6 @@ 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: