[cmake] Rename BUILD_LUA_LIBS to AX_ENABLE_EXT_LUA

This commit is contained in:
halx99 2022-02-17 21:31:39 +08:00
parent 67fad92cbf
commit 67c6bcec4f
9 changed files with 16 additions and 20 deletions

View File

@ -45,16 +45,16 @@ include(PreventInSourceBuilds)
# works before build libcocos2d
include(CocosBuildSet)
option(BUILD_TESTS "Build cpp & lua tests" ON)
option(AX_BUILD_TESTS "Build cpp & lua tests" ON)
set(BUILD_LUA_LIBS ON)
set(AX_ENABLE_EXT_LUA ON)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
# prevent tests project to build "adxe/core" again
set(BUILD_ENGINE_DONE ON)
if(BUILD_TESTS)
if(AX_BUILD_TESTS)
# add cpp-template-default into project(adxe) for tmp test
add_subdirectory(${ADXE_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp)
@ -66,9 +66,9 @@ if(BUILD_TESTS)
add_subdirectory(${ADXE_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests)
endif()
if(BUILD_LUA_LIBS)
if(AX_ENABLE_EXT_LUA)
add_subdirectory(${ADXE_ROOT_PATH}/templates/lua-template-default ${ENGINE_BINARY_PATH}/tests/HelloLua)
add_subdirectory(${ADXE_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test)
endif(BUILD_LUA_LIBS)
endif(AX_ENABLE_EXT_LUA)
endif()

View File

@ -162,7 +162,7 @@ function(copy_thirdparty_dlls cocos_target destDir)
# list(APPEND DEPENDENCIES ${INTERFACE_LINK_LIBRARIES})
# endif()
if(BUILD_LUA_LIBS) # TODO: rename to AX_ENABLE_EXT_LUA
if(AX_ENABLE_EXT_LUA)
list(APPEND DEPENDENCIES ${LUA_ENGINE})
list(APPEND DEPENDENCIES tolua)
endif()

View File

@ -29,7 +29,7 @@ message(STATUS "PYTHON_PATH:" ${PYTHON_COMMAND})
message(STATUS "COCOS_COMMAND_PATH:" ${COCOS_COMMAND})
message(STATUS "HOST_SYSTEM:" ${CMAKE_HOST_SYSTEM_NAME})
# the default behavior of build module
option(BUILD_LUA_LIBS "Build lua libraries" OFF)
option(AX_ENABLE_EXT_LUA "Build lua libraries" OFF)
# hold the extensions list to auto link to app
set(CC_EXTENSION_LIBS "" CACHE INTERNAL "extensions for auto link to target application")

View File

@ -27,7 +27,7 @@
# this CMakeLists is to generate Cocos2d-x Engine Library
# build adxe
# build adxelua if BUILD_LUA_LIBS=ON
# build adxelua if AX_ENABLE_EXT_LUA=ON
# The version number
set(ADXE_VERSION 1.0)
@ -149,7 +149,7 @@ set_target_properties(${ADXE_CORE_LIB}
)
## Lua bindings lib
# if(BUILD_LUA_LIBS)
# if(AX_ENABLE_EXT_LUA)
# add_subdirectory(${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings ${ENGINE_BINARY_PATH}/core/lua-bindings)
# endif()

View File

@ -117,7 +117,7 @@ if(AX_ENABLE_EXT_COCOSTUDIO)
endif()
endif()
if(BUILD_LUA_LIBS) # TODO: rename to AX_ENABLE_EXT_LUA
if(AX_ENABLE_EXT_LUA)
add_subdirectory(scripting/lua-bindings)
endif()

View File

@ -33,7 +33,7 @@ set(SOURCE
#~ implot/implot_demo.cpp
)
#~ if(BUILD_LUA_LIBS)
#~ if(AX_ENABLE_EXT_LUA)
#~ include_directories(
#~ lua-bindings
#~ ${ADXE_ROOT_PATH}/thirdparty/lua/luajit/include

View File

@ -52,7 +52,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(BUILD_LUA_LIBS ON)
set(AX_ENABLE_EXT_LUA ON)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
endif()

View File

@ -20,7 +20,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(BUILD_LUA_LIBS ON)
set(AX_ENABLE_EXT_LUA ON)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
endif()

View File

@ -66,7 +66,8 @@ add_library(thirdparty STATIC empty.cpp)
# header only libs
target_include_directories(thirdparty
INTERFACE "robin-map/include"
INTERFACE "fmt/include"
INTERFACE "robin-map/include"
)
if (ANDROID)
@ -207,7 +208,7 @@ if(AX_WITH_ASTC)
endif(AX_WITH_ASTC)
# use lua/js specific libs by property to prevent conflict
if(BUILD_LUA_LIBS)
if(AX_ENABLE_EXT_LUA)
add_subdirectory(lua/${AX_LUA_ENGINE})
add_subdirectory(lua/tolua)
add_subdirectory(lua/lua-cjson)
@ -335,11 +336,6 @@ if(AX_WITH_KCP)
target_compile_definitions(thirdparty PUBLIC YASIO_HAVE_KCP=1)
endif()
# fmt-lib
add_subdirectory(fmt)
target_link_libraries(thirdparty fmt-header-only)
configure_target_outdir(fmt)
# put "thirdparty" into thirdparty folder, too
configure_target_outdir(thirdparty)