mirror of https://github.com/axmolengine/axmol.git
Add CMake macro BUILD_TESTS=OFF to support exclude all tests project
This commit is contained in:
parent
540c9375ff
commit
5ab0b04d01
|
@ -40,6 +40,8 @@ include(PreventInSourceBuilds)
|
||||||
# works before build libcocos2d
|
# works before build libcocos2d
|
||||||
include(CocosBuildSet)
|
include(CocosBuildSet)
|
||||||
|
|
||||||
|
option(BUILD_TESTS "Build cpp & lua tests" ON)
|
||||||
|
|
||||||
set(BUILD_LUA_LIBS ON)
|
set(BUILD_LUA_LIBS ON)
|
||||||
|
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
||||||
|
@ -47,6 +49,7 @@ add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
||||||
# prevent tests project to build "cocos2d-x/cocos" again
|
# prevent tests project to build "cocos2d-x/cocos" again
|
||||||
set(BUILD_ENGINE_DONE ON)
|
set(BUILD_ENGINE_DONE ON)
|
||||||
|
|
||||||
|
if(BUILD_TESTS)
|
||||||
# add cpp tests default
|
# 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-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test)
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
|
||||||
|
@ -62,3 +65,4 @@ endif(BUILD_LUA_LIBS)
|
||||||
|
|
||||||
# add cpp-template-default into project(Cocos2d-x) for tmp test
|
# 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)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue