diff --git a/CMakeLists.txt b/CMakeLists.txt index d4b7edadb7..0821c51468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,10 @@ cmake_minimum_required(VERSION 3.10) project(adxe) +if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) +endif() + # adxe root path set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/) diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index d4eb800e80..7f1399fc93 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -322,6 +322,18 @@ function(setup_cocos_app_config app_name) target_compile_definitions(${app_name} PRIVATE SPINEPLUGIN_API=DLLIMPORT) # spine dll endif() target_link_libraries(${app_name} ${CC_EXTENSION_LIBS}) + + if(XCODE AND BUILD_DEP_ALSOFT AND ALSOFT_OSX_FRAMEWORK) + # Embedded soft_oal embedded framework + # XCODE_LINK_BUILD_PHASE_MODE BUILT_ONLY + message(STATUS "Embedding framework soft_oal...") + set_target_properties(${app_name} PROPERTIES + XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION + XCODE_EMBED_FRAMEWORKS OpenAL + XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON + XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY ON + ) + endif() endfunction() # if cc_variable not set, then set it cc_value diff --git a/cmake/ios.mini.cmake b/cmake/ios.mini.cmake index 2def20b8bc..3cf1320910 100644 --- a/cmake/ios.mini.cmake +++ b/cmake/ios.mini.cmake @@ -14,6 +14,9 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO) set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO) +# set(CMAKE_BUILD_WITH_INSTALL_RPATH YES) +# set(CMAKE_INSTALL_RPATH "@executable_path/Frameworks") +set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" ${CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS}) # Default deployment target is 9.0 # a. armv7 maximum deployment 10.x diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 0cee3f4a1f..33226e0dd2 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -30,6 +30,10 @@ set(APP_NAME HelloCpp) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 2eb2f12c41..52cbb10ec0 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -29,6 +29,10 @@ project(${APP_NAME}) set(ADXE_ROOT "$ENV{ADXE_ROOT}") +if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) +endif() + if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}") file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH}) diff --git a/tests/cpp-empty-test/CMakeLists.txt b/tests/cpp-empty-test/CMakeLists.txt index 98c3f1ff9b..a4f9f60d1c 100644 --- a/tests/cpp-empty-test/CMakeLists.txt +++ b/tests/cpp-empty-test/CMakeLists.txt @@ -28,6 +28,10 @@ set(APP_NAME cpp-empty-test) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}") diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 43ea3a82eb..840c20a0e1 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -5,6 +5,10 @@ set(APP_NAME cpp-tests) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}") diff --git a/tests/fairygui-tests/CMakeLists.txt b/tests/fairygui-tests/CMakeLists.txt index 087db88693..61032c13fb 100644 --- a/tests/fairygui-tests/CMakeLists.txt +++ b/tests/fairygui-tests/CMakeLists.txt @@ -28,6 +28,10 @@ set(APP_NAME fairygui-tests) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}") diff --git a/tests/lua-empty-test/project/CMakeLists.txt b/tests/lua-empty-test/project/CMakeLists.txt index f5fefa87a3..3898c648da 100644 --- a/tests/lua-empty-test/project/CMakeLists.txt +++ b/tests/lua-empty-test/project/CMakeLists.txt @@ -5,6 +5,10 @@ set(APP_NAME lua-empty-test) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}") diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index b9d20a0b40..cc485b0c10 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -5,6 +5,10 @@ set(APP_NAME lua-tests) project(${APP_NAME}) if(NOT DEFINED BUILD_ENGINE_DONE) + if(XCODE) + set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) + endif() + set(ADXE_ROOT "$ENV{ADXE_ROOT}") if(NOT (ADXE_ROOT STREQUAL "")) set(ADXE_ROOT_PATH "${ADXE_ROOT}")