Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add further options for slimmer builds #20758

Open
wants to merge 7 commits into
base: v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ 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
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()
10 changes: 6 additions & 4 deletions cocos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<$<COMPILE_LANGUAGE:CXX>:cocos2d.h>")
if(!APPLE)
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
message("CMake 3.16 target_precompile_headers")
target_precompile_headers(cocos2d PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:cocos2d.h>")
endif()
endif()

#if(XCODE)
Expand Down
2 changes: 1 addition & 1 deletion download-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions external/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "metal-support-22",
"version": "e8f42341de16c620179bcf25e4b539db122b7565",
"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"
}
Expand Down