Skip to content

Commit c62d094

Browse files
committed
Merge commit 'bb32eee94438f92b61799781211ddd3f5afd7736' into scgamex-v3
STEVE: removed js/lua new files from merge * commit 'bb32eee94438f92b61799781211ddd3f5afd7736': make code more clean and make comment more clear (cocos2d#19155) [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#19152) prevent cmake in-source-build friendly (cocos2d#19151) UIButton fix setTitleLabel memleaks (cocos2d#19148) correct lua template cmake build (cocos2d#19149) modern cmake, cmake_cleanup_remove_unused_variables (cocos2d#19146) refine CCDevice-win32 BitmapDC (cocos2d#19144) modern cmake, improve cmake_compiler_flags (cocos2d#19145) add ui::LoadingBar support to Progress actions (cocos2d#18748) [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#19142) modern cmake, compile definitions improvement (cocos2d#19139) [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#19141) Add `GLView::setCursor` for desktop platforms (cocos2d#19129) add line spacing support for system font on iOS and Android (cocos2d#18993) Bugfix for aviod reading outside of the buffer. (cocos2d#19098) Fix bug: Not support sprite frame when ignoreContentAdaptWithSize is true (cocos2d#19107) iPhone X home indicator handling (cocos2d#19132) # Conflicts: # build/cocos2d_tests.xcodeproj/project.pbxproj # cocos/base/CCConsole.cpp # cocos/scripting/js-bindings/CMakeLists.txt # cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js # cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp # cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp # cocos/scripting/js-bindings/proj.android/CMakeLists.txt # cocos/scripting/lua-bindings/CMakeLists.txt # cocos/scripting/lua-bindings/auto/api/GLView.lua # cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp # cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp # templates/js-template-default/CMakeLists.txt # templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle # templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm # templates/lua-template-default/CMakeLists.txt # templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle # templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm # tests/js-tests/project/CMakeLists.txt # tests/js-tests/project/proj.android/app/build.gradle # tests/lua-empty-test/project/CMakeLists.txt # tests/lua-empty-test/project/proj.android/app/build.gradle # tests/lua-tests/project/CMakeLists.txt # tests/lua-tests/project/proj.android/app/build.gradle
2 parents 88e5459 + bb32eee commit c62d094

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+590
-567
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,14 @@ android-backup.zip
171171
cmake-build-*/
172172
.vs
173173
cmake_build*
174+
175+
# tmp android build files
176+
cocos/platform/android/libcocos2dx/.project
177+
tests/lua-tests/project/proj.android/.project
178+
tests/lua-tests/project/proj.android/app/.project
179+
tests/*/proj.android/.settings/org.eclipse.buildship.core.prefs
180+
tests/*/project/proj.android/.settings/org.eclipse.buildship.core.prefs
181+
182+
# tmp folder for temp usage
183+
tmp/
184+
temp/

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ project(Cocos2d-x)
3434
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
3535
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
3636

37+
# prevent in-source-build
38+
include(PreventInSourceBuilds)
39+
AssureOutOfSourceBuilds()
40+
3741
# works before build libcocos2d
3842
include(CocosBuildSet)
3943

4044
# default tests include lua, js test project, so we set those option on to build libs
4145
set(BUILD_LUA_LIBS ON)
4246
set(BUILD_JS_LIBS ON)
4347

44-
if(NOT USE_COCOS_PREBUILT)
45-
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
46-
endif()
48+
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
4749
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests ${ENGINE_BINARY_PATH}/tests)
4850

build/cocos2d_tests.xcodeproj/project.pbxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@
382382
50921EB01B746D5F00C085CC /* DownloaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50921EAD1B746D5F00C085CC /* DownloaderTest.cpp */; };
383383
52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; };
384384
53367D561DC22891005862DE /* WindowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53367D541DC22891005862DE /* WindowTest.cpp */; };
385+
53E6A008218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; };
386+
53E6A009218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; };
387+
53E6A00A218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; };
385388
59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
386389
59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
387390
688669711AE8E8B500C2CFD9 /* SpritePolygonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6886696F1AE8E8B500C2CFD9 /* SpritePolygonTest.cpp */; };
@@ -850,6 +853,7 @@
850853
52B47A331A534B2B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
851854
53367D541DC22891005862DE /* WindowTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowTest.cpp; sourceTree = "<group>"; };
852855
53367D551DC22891005862DE /* WindowTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowTest.h; sourceTree = "<group>"; };
856+
53E6A007218FA06D002BE515 /* InputTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = InputTest; path = "../tests/cpp-tests/Resources/InputTest"; sourceTree = "<group>"; };
853857
59620E8D1921E5CF002021B6 /* Bug-Child.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-Child.cpp"; sourceTree = "<group>"; };
854858
59620E8E1921E5CF002021B6 /* Bug-Child.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-Child.h"; sourceTree = "<group>"; };
855859
6886696F1AE8E8B500C2CFD9 /* SpritePolygonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpritePolygonTest.cpp; sourceTree = "<group>"; };
@@ -1747,6 +1751,7 @@
17471751
1AC35CBC18CED84500F37B72 /* hd */,
17481752
1AC35CBD18CED84500F37B72 /* Hello.png */,
17491753
1AC35CBE18CED84500F37B72 /* Images */,
1754+
53E6A007218FA06D002BE515 /* InputTest */,
17501755
15B3709219EE5D1000ABE682 /* Manifests */,
17511756
5046AB5A1AF2C4180060550B /* Materials */,
17521757
1AC35CC118CED84500F37B72 /* Misc */,
@@ -2399,6 +2404,7 @@
23992404
5046AB5B1AF2C4180060550B /* Materials in Resources */,
24002405
B63993311A49359F00B07923 /* Particle3D in Resources */,
24012406
1AC35CEC18CED84500F37B72 /* fonts in Resources */,
2407+
53E6A008218FA06E002BE515 /* InputTest in Resources */,
24022408
460629781CDB4DBA00B44058 /* ccs-res in Resources */,
24032409
1AC35CCA18CED84500F37B72 /* animations in Resources */,
24042410
1AC35CEA18CED84500F37B72 /* fileLookup.plist in Resources */,
@@ -2439,6 +2445,7 @@
24392445
1AC35CE918CED84500F37B72 /* extensions in Resources */,
24402446
3E2BDAD219BEA3E20055CDCD /* audio in Resources */,
24412447
5046AB5C1AF2C4180060550B /* Materials in Resources */,
2448+
53E6A009218FA06E002BE515 /* InputTest in Resources */,
24422449
C08689C318D370C90093E810 /* background.caf in Resources */,
24432450
15B3709419EE5D1000ABE682 /* Manifests in Resources */,
24442451
1AC35D0B18CED84500F37B72 /* zwoptex in Resources */,

cmake/Modules/CocosBuildSet.cmake

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,35 @@
1-
# Disable in-source builds to prevent source tree corruption.
2-
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
3-
message(FATAL_ERROR "
4-
FATAL: In-source builds are not allowed.
5-
You should create a separate directory for build files.
6-
")
7-
endif()
8-
91
# print cmake debug info
102
set(CMAKE_DEBUG_TARGET_PROPERTIES
113
# INCLUDE_DIRECTORIES
124
# COMPILE_DEFINITIONS
5+
# COMPILE_OPTIONS
6+
# AUTOUIC_OPTIONS
137
# POSITION_INDEPENDENT_CODE
14-
# CONTAINER_SIZE_REQUIRED
15-
# LIB_VERSION
168
)
17-
# It ensures that when Find*.cmake files included from cmake's Modules dir
18-
# include another *.cmake file with relative path, that file will be included
19-
# also from cmake's Modules dir, to not clash with per-project files.
20-
cmake_policy(SET CMP0017 NEW)
21-
22-
# Use new behaviour with cmake >= 3.1:
23-
# Only interpret if() arguments as variables or keywords when unquoted.
24-
cmake_policy(SET CMP0054 NEW)
25-
26-
# print the info of CMAKE_TOOLCHAIN_FILE, if defined it
27-
if(DEFINED CMAKE_TOOLCHAIN_FILE)
28-
message(STATUS "using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
29-
endif()
309

3110
# some useful variables for every one cocos project
32-
set(COCOS_EXTERNAL_DIR ${COCOS2DX_ROOT_PATH}/external)
3311
set(ENGINE_BINARY_PATH ${PROJECT_BINARY_DIR}/engine)
3412

3513
message(STATUS "PROJECT_NAME:" ${PROJECT_NAME})
3614
message(STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR})
3715
message(STATUS "COCOS2DX_ROOT_PATH:" ${COCOS2DX_ROOT_PATH})
3816
message(STATUS "CMAKE_MODULE_PATH:" ${CMAKE_MODULE_PATH})
39-
message(STATUS "COCOS_EXTERNAL_DIR:" ${COCOS_EXTERNAL_DIR})
4017
# delete binary dir if you hope a full clean re-build
4118
message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR})
4219
message(STATUS "ENGINE_BINARY_PATH:" ${ENGINE_BINARY_PATH})
4320

44-
# include helper functions for cmake build
45-
include(CocosBuildHelpers)
21+
# the default behavior of build module
22+
option(DEBUG_MODE "Debug or Release?" ON)
23+
option(BUILD_LUA_LIBS "Build lua libraries" OFF)
24+
option(BUILD_JS_LIBS "Build js libraries" OFF)
4625

47-
# select building modules
48-
include(CocosSelectModule)
26+
# include helper functions
27+
include(CocosBuildHelpers)
4928

5029
# set common compiler options
51-
include(CocosCompileOptions)
30+
# add target compile define function
31+
# add target compile options function
32+
include(CocosConfigDefine)
5233

34+
# config libraries dependence
5335
include(CocosConfigDepend)

cmake/Modules/CocosCompileOptions.cmake

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)