From b0031d6fd96b369a9ab2ca75393150c38e25c697 Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Wed, 16 Nov 2022 09:11:04 -0500 Subject: [PATCH 1/7] don't force BUILD_LUA_LIBS=ON --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 856d9843e173..3f653b207796 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,6 @@ include(PreventInSourceBuilds) # works before build libcocos2d include(CocosBuildSet) -set(BUILD_LUA_LIBS ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) # prevent tests project to build "cocos2d-x/cocos" again From b26d115cb5a18282f96adb9a3a7fbb3608ec75a7 Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Wed, 16 Nov 2022 09:12:12 -0500 Subject: [PATCH 2/7] add options for build_cpp_tests and build_cpp_template --- CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f653b207796..a93ddbc4f16e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,13 +53,17 @@ add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) set(BUILD_ENGINE_DONE ON) # add cpp tests default -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test) -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests) +if(BUILD_CPP_TESTS) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests) +endif() if(BUILD_LUA_LIBS) add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test) add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test) -endif(BUILD_LUA_LIBS) +endif() -# add cpp-template-default into project(Cocos2d-x) for tmp test -add_subdirectory(${COCOS2DX_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp) +if(BUILD_CPP_TEMPLATE) + # add cpp-template-default into project(Cocos2d-x) for tmp test + add_subdirectory(${COCOS2DX_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp) +endif() From 0340a77bd4f61f399c051d427e9f10f244bf8bde Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Wed, 23 Nov 2022 12:38:58 -0500 Subject: [PATCH 3/7] export file --- cocos/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 4accdfeffdfd..e3ea34f43976 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -150,7 +150,7 @@ endif() if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") message("CMake 3.16 target_precompile_headers") - target_precompile_headers(cocos2d PRIVATE + target_precompile_headers(cocos2d PRIVATE "$<$:cocos2d.h>") endif() @@ -159,3 +159,17 @@ endif() # # TODO: Only turn this off if ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} < 11.0 # target_compile_options(cocos2d PUBLIC $<$:-fno-aligned-allocation>) #endif() + +export(TARGETS cocos2d + external + ext_recast + ext_tinyxml2 + ext_xxhash + ext_xxtea + ext_clipper + ext_edtaa3func + ext_convertUTF + ext_poly2tri + ext_md5 + ext_unzip + FILE cocos2d-export.cmake) \ No newline at end of file From 96f40b933d07c2bc39a57b657332e5302b419b0e Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Wed, 23 Nov 2022 14:07:09 -0500 Subject: [PATCH 4/7] Revert "export file" This reverts commit 0340a77bd4f61f399c051d427e9f10f244bf8bde. --- cocos/CMakeLists.txt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index e3ea34f43976..4accdfeffdfd 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -150,7 +150,7 @@ endif() if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") message("CMake 3.16 target_precompile_headers") - target_precompile_headers(cocos2d PRIVATE + target_precompile_headers(cocos2d PRIVATE "$<$:cocos2d.h>") endif() @@ -159,17 +159,3 @@ endif() # # TODO: Only turn this off if ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} < 11.0 # target_compile_options(cocos2d PUBLIC $<$:-fno-aligned-allocation>) #endif() - -export(TARGETS cocos2d - external - ext_recast - ext_tinyxml2 - ext_xxhash - ext_xxtea - ext_clipper - ext_edtaa3func - ext_convertUTF - ext_poly2tri - ext_md5 - ext_unzip - FILE cocos2d-export.cmake) \ No newline at end of file From 2b58dc8aa85573908e230dfef6dcb48408a0010a Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Fri, 25 Nov 2022 10:52:52 -0500 Subject: [PATCH 5/7] don't precompile headers on apple --- cocos/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 4accdfeffdfd..26bf6cbb5086 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -148,10 +148,12 @@ if(XCODE OR VS) cocos_mark_code_files("cocos2d") endif() -if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") - message("CMake 3.16 target_precompile_headers") - target_precompile_headers(cocos2d PRIVATE - "$<$:cocos2d.h>") +if(!APPLE) + if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") + message("CMake 3.16 target_precompile_headers") + target_precompile_headers(cocos2d PRIVATE + "$<$:cocos2d.h>") + endif() endif() #if(XCODE) From efe57ec70469aff6d6ab212821b512a1939f114d Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Tue, 6 Dec 2022 14:32:27 -0500 Subject: [PATCH 6/7] download deps from heroic labs fork --- download-deps.py | 2 +- external/config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/download-deps.py b/download-deps.py index 07afedb174b9..a9f9d89bf302 100755 --- a/download-deps.py +++ b/download-deps.py @@ -5,7 +5,7 @@ # ./download-deps.py # # Downloads Cocos2D-x 3rd party dependencies from github: -# https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin) and extracts the zip +# https://github.com/heroiclabs/cocos2d-x-3rd-party-libs-bin) and extracts the zip # file # # Having the dependencies outside the official cocos2d-x repo helps prevent diff --git a/external/config.json b/external/config.json index 507ce0d56778..af43c4e73b16 100644 --- a/external/config.json +++ b/external/config.json @@ -2,7 +2,7 @@ "version": "metal-support-22", "zip_file_size": "146254799", "repo_name": "cocos2d-x-3rd-party-libs-bin", - "repo_parent": "https://github.com/cocos2d/", + "repo_parent": "https://github.com/heroiclabs/", "move_dirs": { "fbx-conv": "tools" } From 5aa9d933d49cddc0a1f16daec96254f2b81e7ead Mon Sep 17 00:00:00 2001 From: Luke Gehorsam Date: Tue, 6 Dec 2022 15:00:59 -0500 Subject: [PATCH 7/7] point to new bin commit --- external/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/config.json b/external/config.json index af43c4e73b16..dc4a83630328 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version": "metal-support-22", + "version": "e8f42341de16c620179bcf25e4b539db122b7565", "zip_file_size": "146254799", "repo_name": "cocos2d-x-3rd-party-libs-bin", "repo_parent": "https://github.com/heroiclabs/",