fix iOS build issue (#20292)

This commit is contained in:
minggo 2019-11-05 15:23:54 +08:00 committed by GitHub
parent f52df598e6
commit 5acc952a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 25 deletions

View File

@ -325,4 +325,3 @@ function(cocos_use_pkg target pkg)
endif()
endfunction()

View File

@ -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

View File

@ -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:

View File

@ -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})

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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: