Fix CMAKE

This commit is contained in:
DelinWorks 2022-07-08 02:10:35 +03:00
parent 434d3fa2ab
commit 70cd6095cc
21 changed files with 206 additions and 206 deletions

View File

@ -4,7 +4,7 @@
# Copyright (c) 2015-2017 Chukong Technologies Inc.
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io/
# https://axisproject.github.io/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -29,15 +29,15 @@
cmake_minimum_required(VERSION 3.10)
project(adxe)
project(axis)
if(XCODE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
# adxe root path
set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
# axis root path
set(AXIS_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
# prevent in-source-build
include(PreventInSourceBuilds)
@ -50,35 +50,35 @@ option(AX_BUILD_EXAMPLES "Build examples" ON)
set(AX_ENABLE_EXT_LUA ON)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
# prevent tests project to build "adxe/core" again
# prevent tests project to build "axis/core" again
set(BUILD_ENGINE_DONE ON)
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)
# add cpp-template-default into project(axis) for tmp test
add_subdirectory(${AXIS_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp)
# add cpp tests default
add_subdirectory(${ADXE_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
add_subdirectory(${AXIS_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
# add fairygui tests when fairygui extension is enabled
if(AX_ENABLE_EXT_FAIRYGUI)
add_subdirectory(${ADXE_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests)
add_subdirectory(${AXIS_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests)
endif()
if(AX_ENABLE_EXT_LIVE2D)
add_subdirectory(${ADXE_ROOT_PATH}/tests/live2d-tests ${ENGINE_BINARY_PATH}/tests/live2d-tests)
add_subdirectory(${AXIS_ROOT_PATH}/tests/live2d-tests ${ENGINE_BINARY_PATH}/tests/live2d-tests)
endif()
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)
add_subdirectory(${AXIS_ROOT_PATH}/templates/lua-template-default ${ENGINE_BINARY_PATH}/tests/HelloLua)
add_subdirectory(${AXIS_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test)
endif(AX_ENABLE_EXT_LUA)
endif()
if(AX_BUILD_EXAMPLES)
# add examples/SimpleSnake into project(adxe) for tmp example
add_subdirectory(${ADXE_ROOT_PATH}/examples/SimpleSnake ${ENGINE_BINARY_PATH}/examples/SimpleSnake)
# add examples/SimpleSnake into project(axis) for tmp example
add_subdirectory(${AXIS_ROOT_PATH}/examples/SimpleSnake ${ENGINE_BINARY_PATH}/examples/SimpleSnake)
endif()

View File

@ -1,6 +1,6 @@
# The adxe CMake options
# The axis CMake options
## The options for adxe engine
## The options for axis engine
- AX_BUILD_TESTS: whether build test porojects: cpp-tests, lua-tests, fairygui-tests, default: `TRUE`
- AX_ENABLE_XXX for core feature:
- AX_ENABLE_MSEDGE_WEBVIEW2: whether enable msedge webview2, default: `TRUE`
@ -25,6 +25,6 @@
- AX_ENABLE_EXT_IMGUI: the imgui extension, only support PC platforms, default: `TRUE`
- AX_WITH_XXX: usually user don't need care it
## The options for adxe apps
## The options for axis apps
- AX_PREBUILT_DIR: specific the prebuilt dir (relative to `ADXE_ROOT`), it's very useful for fast linking apps with prebuilt engine libs
- AX_PREBUILT_DIR: specific the prebuilt dir (relative to `AXIS_ROOT`), it's very useful for fast linking apps with prebuilt engine libs

View File

@ -4,7 +4,7 @@
# Copyright (c) 2015-2017 Chukong Technologies Inc.
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io/
# https://axis-project.github.io/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -26,14 +26,14 @@
# ****************************************************************************/
# this CMakeLists is to generate Cocos2d-x Engine Library
# build adxe
# build adxelua if AX_ENABLE_EXT_LUA=ON
# build axis
# build axislua if AX_ENABLE_EXT_LUA=ON
# The version number
set(ADXE_VERSION 1.0)
set(AXIS_VERSION 1.0)
if(NOT DEFINED ADXE_CORE_LIB)
set(ADXE_CORE_LIB adxe CACHE INTERNAL "The adxe core lib name" )
if(NOT DEFINED AXIS_CORE_LIB)
set(AXIS_CORE_LIB axis CACHE INTERNAL "The axis core lib name" )
endif()
if (NOT DEFINED AX_USE_COMPAT_GL)
@ -48,7 +48,7 @@ if (NOT DEFINED AX_ENABLE_MFMEDIA)
set(AX_ENABLE_MFMEDIA TRUE CACHE INTERNAL "Enabling microsoft media foundation for windows video player" )
endif()
project(adxe_libs)
project(axis_libs)
if(XCODE)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH YES)
@ -56,7 +56,7 @@ if(XCODE)
set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" CACHE INTERNAL "")
endif()
set(ADXE_THIRDPARTY_NAME "thirdparty" CACHE INTERNAL "" )
set(AXIS_THIRDPARTY_NAME "thirdparty" CACHE INTERNAL "" )
if (WIN32)
option(WIN32_PATH_USE_ACP "" OFF)
@ -80,7 +80,7 @@ include(ui/CMakeLists.txt)
include(network/CMakeLists.txt)
include(audio/CMakeLists.txt)
set(COCOS_HEADER adxe.h
set(COCOS_HEADER axis.h
${COCOS_2D_HEADER}
${COCOS_3D_HEADER}
${COCOS_PLATFORM_HEADER}
@ -95,7 +95,7 @@ set(COCOS_HEADER adxe.h
${COCOS_NETWORK_HEADER}
)
set(COCOS_SRC adxe.cpp
set(COCOS_SRC axis.cpp
${COCOS_2D_SRC}
${COCOS_3D_SRC}
${COCOS_PLATFORM_SRC}
@ -112,56 +112,56 @@ set(COCOS_SRC adxe.cpp
list(APPEND COCOS_SRC ${COCOS_HEADER})
add_library(${ADXE_CORE_LIB} ${COCOS_SRC})
add_library(${AXIS_CORE_LIB} ${COCOS_SRC})
# use thirdparty libs
add_subdirectory(${ADXE_ROOT_PATH}/thirdparty ${ENGINE_BINARY_PATH}/thirdparty)
target_link_libraries(${ADXE_CORE_LIB} thirdparty)
add_subdirectory(${AXIS_ROOT_PATH}/thirdparty ${ENGINE_BINARY_PATH}/thirdparty)
target_link_libraries(${AXIS_CORE_LIB} thirdparty)
# add base macro define and compile options
use_cocos2dx_compile_define(${ADXE_CORE_LIB})
use_cocos2dx_compile_options(${ADXE_CORE_LIB})
use_cocos2dx_compile_define(${AXIS_CORE_LIB})
use_cocos2dx_compile_options(${AXIS_CORE_LIB})
# use all platform related system libs
use_cocos2dx_libs_depend(${ADXE_CORE_LIB})
use_cocos2dx_libs_depend(${AXIS_CORE_LIB})
target_include_directories(${ADXE_CORE_LIB}
PUBLIC ${ADXE_ROOT_PATH}
PUBLIC ${ADXE_ROOT_PATH}/thirdparty
PUBLIC ${ADXE_ROOT_PATH}/extensions
PUBLIC ${ADXE_ROOT_PATH}/core
PUBLIC ${ADXE_ROOT_PATH}/core/platform
target_include_directories(${AXIS_CORE_LIB}
PUBLIC ${AXIS_ROOT_PATH}
PUBLIC ${AXIS_ROOT_PATH}/thirdparty
PUBLIC ${AXIS_ROOT_PATH}/extensions
PUBLIC ${AXIS_ROOT_PATH}/core
PUBLIC ${AXIS_ROOT_PATH}/core/platform
INTERFACE ${ADXE_ROOT_PATH}/thirdparty
INTERFACE ${ADXE_ROOT_PATH}/extensions
INTERFACE ${ADXE_ROOT_PATH}/core/base
INTERFACE ${ADXE_ROOT_PATH}/core/audio
INTERFACE ${ADXE_ROOT_PATH}/core/platform/${PLATFORM_FOLDER}
INTERFACE ${AXIS_ROOT_PATH}/thirdparty
INTERFACE ${AXIS_ROOT_PATH}/extensions
INTERFACE ${AXIS_ROOT_PATH}/core/base
INTERFACE ${AXIS_ROOT_PATH}/core/audio
INTERFACE ${AXIS_ROOT_PATH}/core/platform/${PLATFORM_FOLDER}
)
set_target_properties(${ADXE_CORE_LIB}
set_target_properties(${AXIS_CORE_LIB}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
VERSION "${ADXE_VERSION}"
VERSION "${AXIS_VERSION}"
FOLDER "Internal"
)
## Lua bindings lib
# if(AX_ENABLE_EXT_LUA)
# add_subdirectory(${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings ${ENGINE_BINARY_PATH}/core/lua-bindings)
# add_subdirectory(${AXIS_ROOT_PATH}/extensions/scripting/lua-bindings ${ENGINE_BINARY_PATH}/core/lua-bindings)
# endif()
if(XCODE OR VS)
cocos_mark_code_files("${ADXE_CORE_LIB}")
cocos_mark_code_files("${AXIS_CORE_LIB}")
endif()
if(WINDOWS)
# precompiled header. Compilation time speedup ~4x, but don't know how Ninja to support PCH yet and needs help from someone.
if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
target_sources(${ADXE_CORE_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp")
set_target_properties(${ADXE_CORE_LIB} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h")
target_sources(${AXIS_CORE_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp")
set_target_properties(${AXIS_CORE_LIB} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h")
endif()
# compile c as c++. needed for precompiled header
@ -169,7 +169,7 @@ if(WINDOWS)
if(AX_ENABLE_MSEDGE_WEBVIEW2)
find_program(NUGET_EXE NAMES nuget
PATHS ${ADXE_ROOT_PATH}/tools/external/nuget)
PATHS ${AXIS_ROOT_PATH}/tools/external/nuget)
if(NOT NUGET_EXE)
message("NUGET.EXE not found.")
@ -180,22 +180,22 @@ if(WINDOWS)
ARGS install "Microsoft.Web.WebView2" -Version 1.0.992.28 -ExcludeVersion -OutputDirectory ${CMAKE_BINARY_DIR}/packages)
if(CMAKE_GENERATOR STREQUAL "Ninja")
target_link_libraries(${ADXE_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib)
target_include_directories(${ADXE_CORE_LIB} PUBLIC ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/include)
target_link_libraries(${AXIS_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib)
target_include_directories(${AXIS_CORE_LIB} PUBLIC ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/include)
else()
target_link_libraries(${ADXE_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
target_link_libraries(${AXIS_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
endif()
target_compile_definitions(${ADXE_CORE_LIB} PUBLIC ADXE_HAVE_WEBVIEW2)
target_compile_definitions(${AXIS_CORE_LIB} PUBLIC AXIS_HAVE_WEBVIEW2)
endif()
endif()
# engine extensions
add_subdirectory(${ADXE_ROOT_PATH}/extensions ${ENGINE_BINARY_PATH}/extensions)
add_subdirectory(${AXIS_ROOT_PATH}/extensions ${ENGINE_BINARY_PATH}/extensions)
if(MSVC)
target_sources(${ADXE_CORE_LIB} PRIVATE ../thirdparty/yasio/yasio.natvis)
target_sources(${ADXE_CORE_LIB} PRIVATE ../thirdparty/robin-map/tsl-robin-map.natvis)
target_compile_options(${ADXE_CORE_LIB} PUBLIC "/Zm2000")
target_sources(${AXIS_CORE_LIB} PRIVATE ../thirdparty/yasio/yasio.natvis)
target_sources(${AXIS_CORE_LIB} PRIVATE ../thirdparty/robin-map/tsl-robin-map.natvis)
target_compile_options(${AXIS_CORE_LIB} PUBLIC "/Zm2000")
endif()
# copy all thirdparty libraries to ${CMAKE_BINARY_DIR}/lib/$<CONFIG>
@ -206,5 +206,5 @@ endif()
#if(XCODE)
# # Later versions of Xcode clang want to compile C++17 with aligned allocation turned on and this is only supported on iOS 11.0+
# # TODO: Only turn this off if ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} < 11.0
# target_compile_options(${ADXE_CORE_LIB} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fno-aligned-allocation>)
# target_compile_options(${AXIS_CORE_LIB} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fno-aligned-allocation>)
#endif()

View File

@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2021-2022 Bytedance Inc.
https://adxeproject.github.io/
https://axis-project.github.io/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -31,14 +31,14 @@ THE SOFTWARE.
NS_CC_BEGIN
CC_DLL const char* adxeVersion()
CC_DLL const char* axisVersion()
{
return "adxe-1.0.0b8";
}
CC_DLL const char* cocos2dVersion()
{
return adxeVersion();
return axisVersion();
}
NS_CC_END

View File

@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2021 Bytedance Inc.
https://adxeproject.github.io/
https://axis-project.github.io/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -27,13 +27,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __ADXE_H__
#define __ADXE_H__
#ifndef __AXIS_H__
#define __AXIS_H__
// 0x00 HI ME LO
// 00 03 08 00
#define ADXE_VERSION 0x00010000
#define AXIS_VERSION 0x00010000
//
// all cocos2d include files
@ -272,8 +272,8 @@ THE SOFTWARE.
NS_CC_BEGIN
CC_DLL const char* adxeVersion();
CC_DLL const char* axisVersion();
NS_CC_END
#endif // __ADXE_H__
#endif // __AXIS_H__

View File

@ -1,7 +1,7 @@
#/****************************************************************************
# Copyright (c) 2015-2017 Chukong Technologies Inc.
#
# https://adxeproject.github.io/
# https://axis-project.github.io/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View File

@ -2,7 +2,7 @@
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io
# https://axisproject.github.io
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -40,26 +40,26 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/run.bat.in" "${CMAKE_CURRENT_SOURCE_DIR}/run.bat" @ONLY)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root")
message(FATAL_ERROR "Please run setup.py add system env var 'AXIS_ROOT' to specific the engine root")
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(_AX_USE_PREBUILT FALSE)
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR})
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
set(_AX_USE_PREBUILT TRUE)
endif()
if (NOT _AX_USE_PREBUILT)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
endif()
@ -145,18 +145,18 @@ if(NOT ANDROID)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
if (NOT _AX_USE_PREBUILT)
target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB})
target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB})
endif()
target_include_directories(${APP_NAME}
PRIVATE Classes
PRIVATE ${ADXE_ROOT_PATH}/core/audio
PRIVATE ${AXIS_ROOT_PATH}/core/audio
)
# mark app resources
@ -164,7 +164,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.hellocpp")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.hellocpp")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
@ -193,11 +193,11 @@ endif()
# The optional thirdparties(not dependent by engine)
if (AX_WITH_YAML_CPP)
target_include_directories(${APP_NAME} PRIVATE ${ADXE_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_include_directories(${APP_NAME} PRIVATE ${AXIS_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_link_libraries(${APP_NAME} yaml-cpp)
endif()
if (_AX_USE_PREBUILT) # support windows only
include(${ADXE_ROOT_PATH}/cmake/Modules/AdxeLinkHelpers.cmake)
adxe_link_cxx_prebuilt(${APP_NAME} ${ADXE_ROOT_PATH} ${AX_PREBUILT_DIR})
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
axis_link_cxx_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
endif()

View File

@ -34,12 +34,12 @@ function(setup_cocos_extension_config target_name)
"" ${ARGN} )
if(ANDROID)
target_link_libraries(${target_name} INTERFACE ${ADXE_CORE_LIB})
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:${ADXE_CORE_LIB},INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(${target_name} INTERFACE ${AXIS_CORE_LIB})
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:${AXIS_CORE_LIB},INTERFACE_INCLUDE_DIRECTORIES>)
# target_compile_definitions(${target_name} PRIVATE CP_USE_CGTYPES=0)
# target_compile_definitions(${target_name} PRIVATE CP_USE_DOUBLES=0)
else()
target_link_libraries(${target_name} ${ADXE_CORE_LIB})
target_link_libraries(${target_name} ${AXIS_CORE_LIB})
endif()
if(BUILD_SHARED_LIBS)
@ -127,4 +127,4 @@ if(AX_ENABLE_EXT_LUA)
add_subdirectory(scripting/lua-bindings)
endif()
message(STATUS "Enabled adxe extensions:${_AX_EXTENSION_LIBS}")
message(STATUS "Enabled axis extensions:${_AX_EXTENSION_LIBS}")

View File

@ -5,7 +5,7 @@ include_directories(imgui)
set(HEADER
ImGuiPresenter.h
# CCImGuiColorTextEdit.h
imgui_impl_adxe.h
imgui_impl_axis.h
imgui/imconfig.h
imgui/imgui.h
imgui/imgui_internal.h
@ -21,7 +21,7 @@ set(HEADER
set(SOURCE
ImGuiPresenter.cpp
# CCImGuiColorTextEdit.cpp
imgui_impl_adxe.cpp
imgui_impl_axis.cpp
imgui/imgui.cpp
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
@ -36,8 +36,8 @@ set(SOURCE
#~ if(AX_ENABLE_EXT_LUA)
#~ include_directories(
#~ lua-bindings
#~ ${ADXE_ROOT_PATH}/thirdparty/lua/luajit/include
#~ ${ADXE_ROOT_PATH}/thirdparty/lua/tolua
#~ ${AXIS_ROOT_PATH}/thirdparty/lua/luajit/include
#~ ${AXIS_ROOT_PATH}/thirdparty/lua/tolua
#~ )
#~ list(APPEND HEADER
#~ lua-bindings/imgui_lua.hpp

View File

@ -30,7 +30,7 @@ target_include_directories(${LIB_NAME}
if(NOT IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Core)
message(AUTHOR_WARNING "Downloading liblive2d-core-dev ...")
file(DOWNLOAD https://github.com/adxeproject/extensions/releases/download/v1.0.0/Live2D-4.4-Core.zip ${CMAKE_CURRENT_LIST_DIR}/Core.zip)
file(DOWNLOAD https://github.com/axis-project/extensions/releases/download/v1.0.0/Live2D-4.4-Core.zip ${CMAKE_CURRENT_LIST_DIR}/Core.zip)
file(ARCHIVE_EXTRACT INPUT ${CMAKE_CURRENT_LIST_DIR}/Core.zip DESTINATION ${CMAKE_CURRENT_LIST_DIR}/)
endif()

View File

@ -6,9 +6,9 @@ target_sources(${LIB_NAME}
if(NOT DEFINED FRAMEWORK_SOURCE)
message(WARNING
"[${LIB_NAME}] Set 'FRAMEWORK_SOURCE' variable to 'adxe' when using adxe rendering."
"[${LIB_NAME}] Set 'FRAMEWORK_SOURCE' variable to 'axis' when using axis rendering."
)
set(FRAMEWORK_SOURCE adxe)
set(FRAMEWORK_SOURCE axis)
endif()
# # Add specified rendering directory.

View File

@ -1,4 +1,4 @@
set(cocos_root ${ADXE_ROOT_PATH})
set(cocos_root ${AXIS_ROOT_PATH})
set(lua_bindings_manual_headers
manual/CCComponentLua.h
@ -180,20 +180,20 @@ set(lua_bindings_files
list(APPEND lua_bindings_files ${lua_bindings_headers})
set(ADXE_LUA_LIB adxelua CACHE INTERNAL "The ADXE lua bindings lib name" )
set(AXIS_LUA_LIB axislua CACHE INTERNAL "The AXIS lua bindings lib name" )
add_library(${ADXE_LUA_LIB} STATIC ${lua_bindings_files})
target_link_libraries(${ADXE_LUA_LIB} ${ADXE_CORE_LIB})
add_dependencies(${ADXE_LUA_LIB} ${ADXE_CORE_LIB})
add_library(${AXIS_LUA_LIB} STATIC ${lua_bindings_files})
target_link_libraries(${AXIS_LUA_LIB} ${AXIS_CORE_LIB})
add_dependencies(${AXIS_LUA_LIB} ${AXIS_CORE_LIB})
if(MSVC)
target_compile_options(${ADXE_LUA_LIB} PRIVATE /bigobj)
target_compile_options(${AXIS_LUA_LIB} PRIVATE /bigobj)
endif()
get_target_property(lua_ext_depend thirdparty CC_LUA_DEPEND)
target_link_libraries(${ADXE_LUA_LIB} ${lua_ext_depend})
target_link_libraries(${AXIS_LUA_LIB} ${lua_ext_depend})
target_include_directories(${ADXE_LUA_LIB}
target_include_directories(${AXIS_LUA_LIB}
PUBLIC ${cocos_root}/thirdparty/lua
PRIVATE manual/platform/android
PRIVATE manual/platform/android/jni
@ -204,16 +204,16 @@ target_include_directories(${ADXE_LUA_LIB}
)
if(WINDOWS)
target_compile_definitions(${ADXE_LUA_LIB} PUBLIC _USRLUASTATIC)
target_compile_definitions(${AXIS_LUA_LIB} PUBLIC _USRLUASTATIC)
endif()
if(AX_ENABLE_MSEDGE_WEBVIEW2)
endif()
adxe_config_pred(${ADXE_LUA_LIB} AX_ENABLE_MFMEDIA)
adxe_config_pred(${ADXE_LUA_LIB} AX_ENABLE_MSEDGE_WEBVIEW2)
axis_config_pred(${AXIS_LUA_LIB} AX_ENABLE_MFMEDIA)
axis_config_pred(${AXIS_LUA_LIB} AX_ENABLE_MSEDGE_WEBVIEW2)
set_target_properties(${ADXE_LUA_LIB}
set_target_properties(${AXIS_LUA_LIB}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
@ -221,6 +221,6 @@ set_target_properties(${ADXE_LUA_LIB}
)
if(XCODE OR VS)
cocos_mark_code_files("${ADXE_LUA_LIB}")
cocos_mark_code_files("${AXIS_LUA_LIB}")
endif()

View File

@ -2,7 +2,7 @@
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io
# https://axis-project.github.io
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -40,26 +40,26 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/run.bat.in" "${CMAKE_CURRENT_SOURCE_DIR}/run.bat" @ONLY)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root")
message(FATAL_ERROR "Please run setup.py add system env var 'AXIS_ROOT' to specific the engine root")
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(_AX_USE_PREBUILT FALSE)
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR})
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
set(_AX_USE_PREBUILT TRUE)
endif()
if (NOT _AX_USE_PREBUILT)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
endif()
@ -145,18 +145,18 @@ if(NOT ANDROID)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
if (NOT _AX_USE_PREBUILT)
target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB})
target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB})
endif()
target_include_directories(${APP_NAME}
PRIVATE Classes
PRIVATE ${ADXE_ROOT_PATH}/core/audio
PRIVATE ${AXIS_ROOT_PATH}/core/audio
)
# mark app resources
@ -164,7 +164,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.hellocpp")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.hellocpp")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
@ -193,14 +193,14 @@ endif()
# The optional thirdparties(not dependent by engine)
if (AX_WITH_YAML_CPP)
target_include_directories(${APP_NAME} PRIVATE ${ADXE_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_include_directories(${APP_NAME} PRIVATE ${AXIS_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_link_libraries(${APP_NAME} yaml-cpp)
endif()
if (_AX_USE_PREBUILT) # support windows only
include(${ADXE_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
include(${AXIS_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
use_cocos2dx_compile_define(${APP_NAME})
include(${ADXE_ROOT_PATH}/cmake/Modules/AdxeLinkHelpers.cmake)
adxe_link_cxx_prebuilt(${APP_NAME} ${ADXE_ROOT_PATH} ${AX_PREBUILT_DIR})
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
axis_link_cxx_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
endif()

View File

@ -2,7 +2,7 @@
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io
# https://axis-project.github.io
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -42,28 +42,28 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/run.bat.in" "${CMAKE_CURRENT_SOURCE_DIR}/run.bat" @ONLY)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root")
message(FATAL_ERROR "Please run setup.py add system env var 'AXIS_ROOT' to specific the engine root")
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(AX_ENABLE_EXT_LUA ON)
set(_AX_USE_PREBUILT FALSE)
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR})
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
set(_AX_USE_PREBUILT TRUE)
endif()
if (NOT _AX_USE_PREBUILT)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
endif()
@ -77,7 +77,7 @@ set(res_src_folders
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
set(res_script_folders
"${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/script"
"${AXIS_ROOT_PATH}/extensions/scripting/lua-bindings/script"
)
if(APPLE OR VS)
cocos_mark_multi_resources(res_res RES_TO "Resources/res" FOLDERS ${res_res_folders})
@ -151,16 +151,16 @@ else()
add_library(${APP_NAME} SHARED ${APP_SRC})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
add_subdirectory(${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)
add_subdirectory(${AXIS_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/frameworks/runtime-src/proj.android/app/src")
endif()
if (NOT _AX_USE_PREBUILT)
target_link_libraries(${APP_NAME} ${ADXE_LUA_LIB})
target_link_libraries(${APP_NAME} ${AXIS_LUA_LIB})
endif()
target_include_directories(${APP_NAME} PRIVATE ${RUNTIME_SRC_ROOT}/Classes)
@ -170,7 +170,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.hellolua")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.hellolua")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist"
@ -207,14 +207,14 @@ endif()
# The optional thirdparties(not dependent by engine)
if (AX_WITH_YAML_CPP)
target_include_directories(${APP_NAME} PRIVATE ${ADXE_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_include_directories(${APP_NAME} PRIVATE ${AXIS_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_link_libraries(${APP_NAME} yaml-cpp)
endif()
if (_AX_USE_PREBUILT) # support windows only
include(${ADXE_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
include(${AXIS_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
use_cocos2dx_compile_define(${APP_NAME})
include(${ADXE_ROOT_PATH}/cmake/Modules/AdxeLinkHelpers.cmake)
adxe_link_lua_prebuilt(${APP_NAME} ${ADXE_ROOT_PATH} ${AX_PREBUILT_DIR})
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
axis_link_lua_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
endif()

View File

@ -18,19 +18,19 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(AXIS_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
# record sources, headers, resources...
@ -540,13 +540,13 @@ else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB})
target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB})
target_include_directories(${APP_NAME}
PRIVATE Classes
@ -561,7 +561,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.cpp_tests")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.cpp_tests")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist")

View File

@ -1,7 +1,7 @@
#/****************************************************************************
# Copyright (c) 2015-2017 Chukong Technologies Inc.
# https://adxeproject.github.io/
# https://axis-project.github.io/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -32,18 +32,18 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(AXIS_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
# record sources, headers, resources...
@ -116,13 +116,13 @@ else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB})
target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB})
target_include_directories(${APP_NAME} PRIVATE Classes)
@ -130,7 +130,7 @@ setup_cocos_app_config(${APP_NAME})
if(XCODE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.fairygui_tests")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.fairygui_tests")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist")

View File

@ -2,7 +2,7 @@
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2021-2022 Bytedance Inc.
#
# https://adxeproject.github.io
# https://axis-project.github.io
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -34,19 +34,19 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
set(ADXE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(AXIS_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
# record sources, headers, resources...
@ -124,16 +124,16 @@ if(NOT ANDROID)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${ADXE_CORE_LIB})
target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB})
target_include_directories(${APP_NAME}
PRIVATE Classes
PRIVATE ${ADXE_ROOT_PATH}/core/audio
PRIVATE ${AXIS_ROOT_PATH}/core/audio
)
# mark app resources
@ -141,7 +141,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.live2d_tests")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.live2d_tests")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")

View File

@ -9,26 +9,26 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
set(ADXE_ROOT "$ENV{ADXE_ROOT}")
if(NOT (ADXE_ROOT STREQUAL ""))
set(ADXE_ROOT_PATH "${ADXE_ROOT}")
file(TO_CMAKE_PATH ${ADXE_ROOT_PATH} ADXE_ROOT_PATH) # string(REPLACE "\\" "/" ADXE_ROOT_PATH ${ADXE_ROOT_PATH})
message(STATUS "Using system env var ADXE_ROOT=${ADXE_ROOT}")
set(AXIS_ROOT "$ENV{AXIS_ROOT}")
if(NOT (AXIS_ROOT STREQUAL ""))
set(AXIS_ROOT_PATH "${AXIS_ROOT}")
file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH})
message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}")
else()
message(FATAL_ERROR "Please run setup.py add system env var 'ADXE_ROOT' to specific the engine root")
message(FATAL_ERROR "Please run setup.py add system env var 'AXIS_ROOT' to specific the engine root")
endif()
set(CMAKE_MODULE_PATH ${ADXE_ROOT_PATH}/cmake/Modules/)
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
set(AX_ENABLE_EXT_LUA ON)
set(_AX_USE_PREBUILT FALSE)
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR})
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
set(_AX_USE_PREBUILT TRUE)
endif()
if (NOT _AX_USE_PREBUILT)
add_subdirectory(${ADXE_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/adxe/core)
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
endif()
endif()
@ -46,13 +46,13 @@ set(GAME_SOURCE
set(res_res_folders
"${CMAKE_CURRENT_SOURCE_DIR}/../res"
"${ADXE_ROOT_PATH}/tests/cpp-tests/Resources"
"${AXIS_ROOT_PATH}/tests/cpp-tests/Resources"
)
set(res_src_folders
"${CMAKE_CURRENT_SOURCE_DIR}/../src"
)
set(res_script_folders
"${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/script"
"${AXIS_ROOT_PATH}/extensions/scripting/lua-bindings/script"
)
if(APPLE OR VS)
cocos_mark_multi_resources(res_res RES_TO "Resources/res" FOLDERS ${res_res_folders})
@ -116,10 +116,10 @@ else()
add_library(${APP_NAME} SHARED ${APP_SRC})
# whole-archive for jni
add_subdirectory(${ADXE_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/cpp-android)
add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/cpp-android)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
add_subdirectory(${ADXE_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)
add_subdirectory(${AXIS_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)
if(${CMAKE_ANDROID_ARCH_ABI} STREQUAL "x86")
#add `-Wl,--no-warn-shared-textrel` to fix warning "shared library text segment is not shareable clang"
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive -Wl,--no-warn-shared-textrel)
@ -131,7 +131,7 @@ else()
endif()
if (NOT _AX_USE_PREBUILT)
target_link_libraries(${APP_NAME} ${ADXE_LUA_LIB})
target_link_libraries(${APP_NAME} ${AXIS_LUA_LIB})
endif()
target_include_directories(${APP_NAME} PRIVATE Classes)
@ -145,7 +145,7 @@ setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.adxe.lua_tests")
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.lua_tests")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
@ -175,7 +175,7 @@ if((WINDOWS AND (CMAKE_GENERATOR STREQUAL "Ninja")) OR LINUX)
elseif(WINDOWS)
set(my_res_folder "${CMAKE_CURRENT_SOURCE_DIR}/..")
cocos_copy_lua_scripts(${APP_NAME} ${res_script_folders} "${my_res_folder}/src/cocos")
cocos_copy_target_res(${APP_NAME} LINK_TO "${my_res_folder}/res" FOLDERS "${ADXE_ROOT_PATH}/tests/cpp-tests/Resources")
cocos_copy_target_res(${APP_NAME} LINK_TO "${my_res_folder}/res" FOLDERS "${AXIS_ROOT_PATH}/tests/cpp-tests/Resources")
set_property(TARGET ${APP_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${my_res_folder}")
if(NOT DEFINED BUILD_ENGINE_DONE)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME})
@ -184,11 +184,11 @@ endif()
# The optional thirdparties(not dependent by engine)
if (AX_WITH_YAML_CPP)
target_include_directories(${APP_NAME} PRIVATE ${ADXE_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_include_directories(${APP_NAME} PRIVATE ${AXIS_ROOT_PATH}/thirdparty/yaml-cpp/include)
target_link_libraries(${APP_NAME} yaml-cpp)
endif()
if (_AX_USE_PREBUILT) # support windows only
include(${ADXE_ROOT_PATH}/cmake/Modules/AdxeLinkHelpers.cmake)
adxe_link_lua_prebuilt(${APP_NAME} ${ADXE_ROOT_PATH} ${AX_PREBUILT_DIR})
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
axis_link_lua_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
endif()