mirror of https://github.com/axmolengine/axmol.git
Fix setup cmake files and some relative sources
This commit is contained in:
parent
955c42c7a2
commit
906c60e40e
|
@ -42,8 +42,8 @@ set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
|||
# prevent in-source-build
|
||||
include(PreventInSourceBuilds)
|
||||
|
||||
# works before build libcocos2d
|
||||
include(CocosBuildSet)
|
||||
# works before build libaxis
|
||||
include(AxisBuildSet)
|
||||
|
||||
option(AX_BUILD_TESTS "Build cpp & lua tests" ON)
|
||||
option(AX_BUILD_EXAMPLES "Build examples" ON)
|
||||
|
|
|
@ -17,7 +17,7 @@ function(cocos_copy_target_res cocos_target)
|
|||
get_filename_component(link_folder_abs ${opt_LINK_TO} ABSOLUTE)
|
||||
add_custom_command(TARGET SYNC_RESOURCE-${cocos_target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " copying to ${link_folder_abs}"
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${ADXE_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${AXIS_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
-s ${cc_folder} -d ${link_folder_abs}
|
||||
)
|
||||
endforeach()
|
||||
|
@ -49,18 +49,18 @@ function(cocos_copy_lua_scripts cocos_target src_dir dst_dir)
|
|||
endif()
|
||||
if(MSVC)
|
||||
add_custom_command(TARGET ${luacompile_target} POST_BUILD
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${ADXE_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${AXIS_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
-s ${src_dir} -d ${dst_dir} -m $<CONFIG>
|
||||
)
|
||||
else()
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
add_custom_command(TARGET ${luacompile_target} POST_BUILD
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${ADXE_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${AXIS_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
-s ${src_dir} -d ${dst_dir}
|
||||
)
|
||||
else()
|
||||
add_custom_command(TARGET ${luacompile_target} POST_BUILD
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${ADXE_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
COMMAND ${PYTHON_COMMAND} ARGS ${AXIS_ROOT_PATH}/cmake/scripts/sync_folder.py
|
||||
-s ${src_dir} -d ${dst_dir} -m ${CMAKE_BUILD_TYPE}
|
||||
)
|
||||
endif()
|
||||
|
@ -154,10 +154,10 @@ endfunction()
|
|||
|
||||
function(copy_thirdparty_dlls cocos_target destDir)
|
||||
# init dependency list with direct dependencies
|
||||
get_property(DEPENDENCIES TARGET ${ADXE_THIRDPARTY_NAME} PROPERTY LINK_LIBRARIES)
|
||||
get_property(DEPENDENCIES TARGET ${AXIS_THIRDPARTY_NAME} PROPERTY LINK_LIBRARIES)
|
||||
# We're not intersted in interface link libraries of the top-most target
|
||||
# if (INCLUDE_INTERFACE_LINK_LIBRARIES)
|
||||
# get_property(INTERFACE_LINK_LIBRARIES TARGET ${ADXE_THIRDPARTY_NAME} PROPERTY
|
||||
# get_property(INTERFACE_LINK_LIBRARIES TARGET ${AXIS_THIRDPARTY_NAME} PROPERTY
|
||||
# INTERFACE_LINK_LIBRARIES)
|
||||
# list(APPEND DEPENDENCIES ${INTERFACE_LINK_LIBRARIES})
|
||||
# endif()
|
||||
|
@ -175,7 +175,7 @@ function(copy_thirdparty_dlls cocos_target destDir)
|
|||
SET(EXT_LIB_FILES "")
|
||||
|
||||
foreach(DEPENDENCY ${DEPENDENCIES})
|
||||
# message(STATUS ${DEPENDENCY} " depends by ${ADXE_THIRDPARTY_NAME}")
|
||||
# message(STATUS ${DEPENDENCY} " depends by ${AXIS_THIRDPARTY_NAME}")
|
||||
get_property(IMPORTLIB TARGET ${DEPENDENCY} PROPERTY IMPORTED_IMPLIB)
|
||||
get_property(IMPORTDLL TARGET ${DEPENDENCY} PROPERTY IMPORTED_LOCATION)
|
||||
if(IMPORTLIB)
|
||||
|
@ -223,9 +223,9 @@ function(cocos_copy_target_dll cocos_target)
|
|||
# Copy windows angle binaries
|
||||
add_custom_command(TARGET ${cocos_target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${ADXE_ROOT_PATH}/${ADXE_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/libGLESv2.dll
|
||||
${ADXE_ROOT_PATH}/${ADXE_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/libEGL.dll
|
||||
${ADXE_ROOT_PATH}/${ADXE_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/d3dcompiler_47.dll
|
||||
${AXIS_ROOT_PATH}/${AXIS_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/libGLESv2.dll
|
||||
${AXIS_ROOT_PATH}/${AXIS_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/libEGL.dll
|
||||
${AXIS_ROOT_PATH}/${AXIS_THIRDPARTY_NAME}/angle/prebuilt/${ARCH_ALIAS}/d3dcompiler_47.dll
|
||||
$<TARGET_FILE_DIR:${cocos_target}>
|
||||
)
|
||||
|
||||
|
@ -487,8 +487,8 @@ function(cocos_use_pkg target pkg)
|
|||
|
||||
endfunction()
|
||||
|
||||
# The adxe preprocessors config helper macro
|
||||
macro(adxe_config_pred target_name pred)
|
||||
# The axis preprocessors config helper macro
|
||||
macro(axis_config_pred target_name pred)
|
||||
if(${pred})
|
||||
target_compile_definitions(${target_name} PUBLIC ${pred}=1)
|
||||
endif()
|
|
@ -15,12 +15,12 @@ if(CMAKE_TOOLCHAIN_FILE)
|
|||
endif()
|
||||
|
||||
find_program(PYTHON_COMMAND NAMES python3 python2 python)
|
||||
find_program(COCOS_COMMAND NAME adxe
|
||||
PATHS ${ADXE_ROOT_PATH}/tools/cocos2d-console/bin $ENV{ADXE_CONSOLE_ROOT})
|
||||
find_program(COCOS_COMMAND NAME axis
|
||||
PATHS ${AXIS_ROOT_PATH}/tools/axis-console/bin $ENV{AXIS_CONSOLE_ROOT})
|
||||
|
||||
message(STATUS "PROJECT_NAME:" ${PROJECT_NAME})
|
||||
message(STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR})
|
||||
message(STATUS "ADXE_ROOT_PATH:" ${ADXE_ROOT_PATH})
|
||||
message(STATUS "AXIS_ROOT_PATH:" ${AXIS_ROOT_PATH})
|
||||
message(STATUS "CMAKE_MODULE_PATH:" ${CMAKE_MODULE_PATH})
|
||||
# delete binary dir if you hope a full clean re-build
|
||||
message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR})
|
||||
|
@ -35,26 +35,26 @@ option(AX_ENABLE_EXT_LUA "Build lua libraries" OFF)
|
|||
set(_AX_EXTENSION_LIBS "" CACHE INTERNAL "extensions for auto link to target application")
|
||||
|
||||
# include helper functions
|
||||
include(CocosBuildHelpers)
|
||||
include(AxisBuildHelpers)
|
||||
|
||||
# set common compiler options
|
||||
# add target compile define function
|
||||
# add target compile options function
|
||||
include(CocosConfigDefine)
|
||||
include(AxisConfigDefine)
|
||||
|
||||
# config libraries dependence
|
||||
include(CocosConfigDepend)
|
||||
include(AxisConfigDepend)
|
||||
|
||||
if(COCOS_COMMAND)
|
||||
get_filename_component(cocos2dx_console_dir ${COCOS_COMMAND} DIRECTORY)
|
||||
set(COCOS2DX_LUAJIT_ROOT ${cocos2dx_console_dir}/../plugins/plugin_luacompile/bin)
|
||||
message(STATUS "COCOS2DX_LUAJIT_ROOT:" ${COCOS2DX_LUAJIT_ROOT})
|
||||
get_filename_component(axis_console_dir ${COCOS_COMMAND} DIRECTORY)
|
||||
set(AXIS_LUAJIT_ROOT ${axis_console_dir}/../plugins/plugin_luacompile/bin)
|
||||
message(STATUS "AXIS_LUAJIT_ROOT:" ${AXIS_LUAJIT_ROOT})
|
||||
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
find_program(LUAJIT32_COMMAND NAMES luajit-win32 PATHS ${COCOS2DX_LUAJIT_ROOT}/32bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT64_COMMAND NAMES luajit-win32 PATHS ${COCOS2DX_LUAJIT_ROOT}/64bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT32_COMMAND NAMES luajit-win32 PATHS ${AXIS_LUAJIT_ROOT}/32bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT64_COMMAND NAMES luajit-win32 PATHS ${AXIS_LUAJIT_ROOT}/64bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
find_program(LUAJIT32_COMMAND NAMES luajit-linux PATHS ${COCOS2DX_LUAJIT_ROOT}/32bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT64_COMMAND NAMES luajit-linux PATHS ${COCOS2DX_LUAJIT_ROOT}/64bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT32_COMMAND NAMES luajit-linux PATHS ${AXIS_LUAJIT_ROOT}/32bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
find_program(LUAJIT64_COMMAND NAMES luajit-linux PATHS ${AXIS_LUAJIT_ROOT}/64bit NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
|
@ -54,15 +54,10 @@ endif()
|
|||
message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
|
||||
|
||||
# custom target property for lua/js link
|
||||
define_property(TARGET
|
||||
PROPERTY CC_JS_DEPEND
|
||||
BRIEF_DOCS "cocos2d js depend libs"
|
||||
FULL_DOCS "use to save depend libs of cocos2d js project"
|
||||
)
|
||||
define_property(TARGET
|
||||
PROPERTY CC_LUA_DEPEND
|
||||
BRIEF_DOCS "cocos2d lua depend libs"
|
||||
FULL_DOCS "use to save depend libs of cocos2d lua project"
|
||||
BRIEF_DOCS "axis lua depend libs"
|
||||
FULL_DOCS "use to save depend libs of axis lua project"
|
||||
)
|
||||
|
||||
# config c standard
|
||||
|
@ -91,7 +86,7 @@ endif()
|
|||
set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library postfix for debug builds. Normally left blank." FORCE)
|
||||
|
||||
# set hash style to both for android old device compatible
|
||||
# see also: https://github.com/adxeproject/adxe/discussions/614
|
||||
# see also: https://github.com/axis-project/axis/discussions/614
|
||||
if (ANDROID)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--hash-style=both")
|
||||
endif()
|
||||
|
@ -103,20 +98,20 @@ if(WINDOWS)
|
|||
# Visual Studio 2015, MSVC_VERSION 1900 (v140 toolset)
|
||||
# Visual Studio 2017, MSVC_VERSION 1910-1919 (v141 toolset)
|
||||
if(${MSVC_VERSION} EQUAL 1900 OR ${MSVC_VERSION} GREATER 1900)
|
||||
message(STATUS "using Windows MSVC generate adxe project, MSVC_VERSION:${MSVC_VERSION}")
|
||||
message(STATUS "using Windows MSVC generate axis project, MSVC_VERSION:${MSVC_VERSION}")
|
||||
else()
|
||||
message(FATAL_ERROR "using Windows MSVC generate adxe project, MSVC_VERSION:${MSVC_VERSION} lower than needed")
|
||||
message(FATAL_ERROR "using Windows MSVC generate axis project, MSVC_VERSION:${MSVC_VERSION} lower than needed")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "please using Windows MSVC compile adxe project, support other compile tools not yet")
|
||||
message(FATAL_ERROR "please using Windows MSVC compile axis project, support other compile tools not yet")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set macro definitions for special platforms
|
||||
function(use_cocos2dx_compile_define target)
|
||||
function(use_axis_compile_define target)
|
||||
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:COCOS2D_DEBUG=1>)
|
||||
|
||||
# !important adxe not use double precision
|
||||
# !important axis not use double precision
|
||||
# target_compile_definitions(${target} PUBLIC CP_USE_CGTYPES=0)
|
||||
# target_compile_definitions(${target} PUBLIC CP_USE_DOUBLES=0)
|
||||
|
||||
|
@ -162,7 +157,7 @@ function(use_cocos2dx_compile_define target)
|
|||
endfunction()
|
||||
|
||||
# Set compiler options
|
||||
function(use_cocos2dx_compile_options target)
|
||||
function(use_axis_compile_options target)
|
||||
if(MSVC)
|
||||
target_compile_options(${target}
|
||||
PUBLIC /MP
|
|
@ -1,4 +1,4 @@
|
|||
macro(cocos2dx_depend)
|
||||
macro(axis_depend)
|
||||
# confim the libs, prepare to link
|
||||
set(PLATFORM_SPECIFIC_LIBS)
|
||||
|
||||
|
@ -104,8 +104,8 @@ macro(cocos2dx_depend)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(use_cocos2dx_libs_depend target)
|
||||
cocos2dx_depend()
|
||||
macro(use_axis_libs_depend target)
|
||||
axis_depend()
|
||||
foreach(platform_lib ${PLATFORM_SPECIFIC_LIBS})
|
||||
target_link_libraries(${target} ${platform_lib})
|
||||
endforeach()
|
|
@ -14,7 +14,7 @@ endif()
|
|||
|
||||
message(STATUS "AX_ENABLE_MSEDGE_WEBVIEW2=${AX_ENABLE_MSEDGE_WEBVIEW2}")
|
||||
|
||||
function(adxe_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
||||
function(axis_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
||||
if (NOT AX_USE_SHARED_PREBUILT)
|
||||
target_compile_definitions(${APP_NAME}
|
||||
PRIVATE CC_STATIC=1
|
||||
|
@ -87,7 +87,7 @@ function(adxe_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
|||
assets-manager.lib
|
||||
cocostudio.lib
|
||||
DragonBones.lib
|
||||
adxe.lib
|
||||
axis.lib
|
||||
box2d.lib
|
||||
chipmunk.lib
|
||||
freetype.lib
|
||||
|
@ -156,19 +156,19 @@ function(adxe_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
|||
target_link_libraries(${APP_NAME} ${AX_ROOT_DIR}/build/packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
|
||||
endif()
|
||||
endif()
|
||||
endfunction(adxe_link_cxx_prebuilt)
|
||||
endfunction(axis_link_cxx_prebuilt)
|
||||
|
||||
function(adxe_link_lua_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
||||
adxe_link_cxx_prebuilt(${APP_NAME} ${AX_ROOT_DIR} ${AX_PREBUILT_DIR})
|
||||
function(axis_link_lua_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
|
||||
axis_link_cxx_prebuilt(${APP_NAME} ${AX_ROOT_DIR} ${AX_PREBUILT_DIR})
|
||||
|
||||
if (NOT AX_USE_SHARED_PREBUILT)
|
||||
target_compile_definitions(${APP_NAME}
|
||||
PRIVATE _USRLUASTATIC=1
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(${APP_NAME} adxelua lua-cjson tolua plainlua)
|
||||
target_link_libraries(${APP_NAME} axislua lua-cjson tolua plainlua)
|
||||
add_custom_command(TARGET ${APP_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${AX_ROOT_DIR}/${AX_PREBUILT_DIR}/bin/${THIRD_PARTY_ARCH}plainlua.dll"
|
||||
$<TARGET_FILE_DIR:${APP_NAME}>)
|
||||
endfunction(adxe_link_lua_prebuilt)
|
||||
endfunction(axis_link_lua_prebuilt)
|
|
@ -9,23 +9,23 @@ function(AssureOutOfSourceBuilds)
|
|||
# disallow in-source builds
|
||||
if("${srcdir}" STREQUAL "${bindir}")
|
||||
message("######################################################")
|
||||
message("# adxe should not be configured & built in the adxe source directory")
|
||||
message("# axis should not be configured & built in the axis source directory")
|
||||
message("# You must run cmake in a build directory.")
|
||||
message("# For example:")
|
||||
message("# mkdir Cocos ; cd Cocos")
|
||||
message("# download & unpack the adxe tarball")
|
||||
message("# mkdir adxe-Build")
|
||||
message("# mkdir axis ; cd axis")
|
||||
message("# download & unpack the axis tarball")
|
||||
message("# mkdir build")
|
||||
message("# this will create the following directory structure")
|
||||
message("#")
|
||||
message("# Cocos")
|
||||
message("# +--adxe")
|
||||
message("# +--adxe-Build")
|
||||
message("# axis")
|
||||
message("# +--axis")
|
||||
message("# +--build")
|
||||
message("#")
|
||||
message("# Then you can proceed to configure and build")
|
||||
message("# by using the following commands")
|
||||
message("#")
|
||||
message("# cd adxe-Build")
|
||||
message("# cmake ../adxe # or ccmake, or cmake-gui ")
|
||||
message("# cd build")
|
||||
message("# cmake ../axis # or ccmake, or cmake-gui ")
|
||||
message("# make")
|
||||
message("#")
|
||||
message("# NOTE: Given that you already tried to make an in-source build")
|
||||
|
@ -33,7 +33,7 @@ function(AssureOutOfSourceBuilds)
|
|||
message("# in your source tree. run 'git status' to find them and")
|
||||
message("# remove them by doing:")
|
||||
message("#")
|
||||
message("# cd Cocos/adxe")
|
||||
message("# cd axis")
|
||||
message("# git clean -n -d")
|
||||
message("# git clean -f -d")
|
||||
message("# git checkout --")
|
||||
|
|
|
@ -10,14 +10,14 @@ CMake is an open-source, cross-platform family of tools designed to build, test
|
|||
```
|
||||
if the CMake version is lower than 3.14, please upgrade.
|
||||
|
||||
2. You should use **out-of-source** builds, this means you need to create a different directory than **adxe** to execute the `cmake` command.
|
||||
2. You should use **out-of-source** builds, this means you need to create a different directory than **axis** to execute the `cmake` command.
|
||||
|
||||
## Step by Step
|
||||
|
||||
### Linux
|
||||
|
||||
```sh
|
||||
cd adxe
|
||||
cd axis
|
||||
mkdir linux-build && cd linux-build
|
||||
cmake ..
|
||||
make
|
||||
|
@ -28,35 +28,35 @@ Execute `make help` to see all build targets, `make <target>` build specified ta
|
|||
### Generate Visual Studio projects
|
||||
|
||||
```sh
|
||||
cd adxe
|
||||
cd axis
|
||||
mkdir win32-build
|
||||
cmake -B win32-build -G"Visual Studio 16 2019"
|
||||
# build
|
||||
cmake --build win32-build --config Debug
|
||||
```
|
||||
or open **adxe.sln** in Explorer to use the generated project.
|
||||
or open **axis.sln** in Explorer to use the generated project.
|
||||
|
||||
### Generate macOS Project
|
||||
|
||||
```sh
|
||||
cd adxe
|
||||
cd axis
|
||||
mkdir mac-build
|
||||
cmake -B mac-build -GXcode
|
||||
open mac-build/adxe.xcodeproj
|
||||
open mac-build/axis.xcodeproj
|
||||
```
|
||||
|
||||
### Generate iOS Project
|
||||
|
||||
```sh
|
||||
cd adxe
|
||||
cd axis
|
||||
mkdir ios-build
|
||||
cmake -B ios-build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake
|
||||
open ios-build/adxe.xcodeproj
|
||||
open ios-build/axis.xcodeproj
|
||||
```
|
||||
|
||||
#### How do I customize the generated Xcode project?
|
||||
|
||||
Xcode project settings that you want to affect both the app project and the adxe library project should be passed on the command
|
||||
Xcode project settings that you want to affect both the app project and the axis library project should be passed on the command
|
||||
line when invoking `cmake`.
|
||||
|
||||
Xcode project settings that you want to affect the app project only shoudl be put into the its `CMakeLists.txt` file.
|
||||
|
@ -75,7 +75,7 @@ set_xcode_property(${APP_NAME} XXX "Value")
|
|||
|
||||
##### Deployment Target
|
||||
|
||||
As explained above, pass this on the command line so both the app the adxe are built using the same version:
|
||||
As explained above, pass this on the command line so both the app the axis are built using the same version:
|
||||
|
||||
For iOS pass `-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=version`, where `version` is `9.0`, `10.0`, etc.
|
||||
|
||||
|
@ -103,7 +103,7 @@ from `cmake`:
|
|||
|
||||
### Android Studio
|
||||
|
||||
We use the Gradle for Android applications, and Gradle use cmake to build the native code, see [gradle.properties](https://github.com/c4games/adxe/blob/84be684e3858393a6f3efc50e3f95d4e0ac92a20/tests/cpp-empty-test/proj.android/gradle.properties#L38): `PROP_NDK_MODE`, it controls how native builds work.
|
||||
We use the Gradle for Android applications, and Gradle use cmake to build the native code, see [gradle.properties](https://github.com/c4games/axis/blob/84be684e3858393a6f3efc50e3f95d4e0ac92a20/tests/cpp-empty-test/proj.android/gradle.properties#L38): `PROP_NDK_MODE`, it controls how native builds work.
|
||||
|
||||
```sh
|
||||
# android native code build type
|
||||
|
@ -113,7 +113,7 @@ We use the Gradle for Android applications, and Gradle use cmake to build the na
|
|||
PROP_BUILD_TYPE=cmake
|
||||
```
|
||||
|
||||
If you want to add cmake build arguments, please add it at [external Native Build](https://github.com/c4games/adxe/blob/84be684e3858393a6f3efc50e3f95d4e0ac92a20/tests/cpp-empty-test/proj.android/app/build.gradle#L25) block of __app/build.gradle__ file.
|
||||
If you want to add cmake build arguments, please add it at [external Native Build](https://github.com/c4games/axis/blob/84be684e3858393a6f3efc50e3f95d4e0ac92a20/tests/cpp-empty-test/proj.android/app/build.gradle#L25) block of __app/build.gradle__ file.
|
||||
|
||||
|
||||
## Build Options
|
||||
|
@ -131,7 +131,7 @@ If you want to add cmake build arguments, please add it at [external Native Buil
|
|||
|
||||
1. __`-H -B`__, `-H` specify the CMake project Home directory, `-B` specify CMake-generated project binary directory. for example
|
||||
|
||||
* `-H..\adxe -Bmsvc_build` the generated native project's location will be `msvc_build` directory.
|
||||
* `-H..\axis -Bmsvc_build` the generated native project's location will be `msvc_build` directory.
|
||||
|
||||
1. __`--build <dir>`__, build a CMake-generated project binary tree, for example
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# THE SOFTWARE.
|
||||
# ****************************************************************************/
|
||||
|
||||
# this CMakeLists is to generate Cocos2d-x Engine Library
|
||||
# this CMakeLists is to generate Axis Engine Library
|
||||
# build axis
|
||||
# build axislua if AX_ENABLE_EXT_LUA=ON
|
||||
|
||||
|
@ -119,11 +119,11 @@ 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(${AXIS_CORE_LIB})
|
||||
use_cocos2dx_compile_options(${AXIS_CORE_LIB})
|
||||
use_axis_compile_define(${AXIS_CORE_LIB})
|
||||
use_axis_compile_options(${AXIS_CORE_LIB})
|
||||
|
||||
# use all platform related system libs
|
||||
use_cocos2dx_libs_depend(${AXIS_CORE_LIB})
|
||||
use_axis_libs_depend(${AXIS_CORE_LIB})
|
||||
|
||||
target_include_directories(${AXIS_CORE_LIB}
|
||||
PUBLIC ${AXIS_ROOT_PATH}
|
||||
|
|
|
@ -33,7 +33,7 @@ NS_CC_BEGIN
|
|||
|
||||
CC_DLL const char* axisVersion()
|
||||
{
|
||||
return "adxe-1.0.0b8";
|
||||
return "adxe-1.0.0b9";
|
||||
}
|
||||
|
||||
CC_DLL const char* cocos2dVersion()
|
||||
|
|
|
@ -35,7 +35,7 @@ THE SOFTWARE.
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
extern const char* adxeVersion();
|
||||
extern const char* axisVersion();
|
||||
|
||||
Configuration* Configuration::s_sharedConfiguration = nullptr;
|
||||
|
||||
|
@ -66,7 +66,7 @@ Configuration::Configuration()
|
|||
|
||||
bool Configuration::init()
|
||||
{
|
||||
_valueDict["adxe.version"] = Value(adxeVersion());
|
||||
_valueDict["adxe.version"] = Value(axisVersion());
|
||||
|
||||
#if CC_ENABLE_PROFILERS
|
||||
_valueDict["adxe.compiled_with_profiler"] = Value(true);
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
extern const char* adxeVersion(void);
|
||||
extern const char* axisVersion(void);
|
||||
|
||||
#define PROMPT "> "
|
||||
#define DEFAULT_COMMAND_SEPARATOR '|'
|
||||
|
@ -1562,7 +1562,7 @@ void Console::commandUpload(socket_native_type fd)
|
|||
|
||||
void Console::commandVersion(socket_native_type fd, std::string_view /*args*/)
|
||||
{
|
||||
Console::Utility::mydprintf(fd, "%s\n", adxeVersion());
|
||||
Console::Utility::mydprintf(fd, "%s\n", axisVersion());
|
||||
}
|
||||
|
||||
// helper free functions
|
||||
|
|
|
@ -33,7 +33,6 @@ THE SOFTWARE.
|
|||
#include "axis.h"
|
||||
|
||||
#define COCOS2D_VERSION 0x00040000
|
||||
#define ENGINEX_VERSION ADXE_VERSION
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(ADXE_HAVE_WEBVIEW2)
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2)
|
||||
|
||||
# include "UIWebViewImpl-win32.h"
|
||||
# include "UIWebView.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "platform/CCPlatformConfig.h"
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(ADXE_HAVE_WEBVIEW2)
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2)
|
||||
|
||||
# include <string>
|
||||
# include "CCStdC.h"
|
||||
|
|
|
@ -52,7 +52,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
|
|||
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
set(_AX_USE_PREBUILT FALSE)
|
||||
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
|
||||
set(_AX_USE_PREBUILT TRUE)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
# default value for cocos2dx extensions modules to Build
|
||||
# default value for axis extensions modules to Build
|
||||
# currently 7 extensions
|
||||
# extensions dependicies: COCOSTUDIO may depend on spine & dragonBones if they are present in buildset
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ImGuiPresenter.h"
|
||||
#include <assert.h>
|
||||
#include "imgui_impl_adxe.h"
|
||||
#include "imgui_impl_axis.h"
|
||||
#include "imgui_internal.h"
|
||||
|
||||
// TODO: mac metal
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
// 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).
|
||||
// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
|
||||
|
||||
#include "imgui_impl_adxe.h"
|
||||
#include "imgui_impl_axis.h"
|
||||
#include "cocos2d.h"
|
||||
#include "renderer/backend/Backend.h"
|
||||
#include <functional>
|
|
@ -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/axis-project/extensions/releases/download/v1.0.0/Live2D-4.4-Core.zip ${CMAKE_CURRENT_LIST_DIR}/Core.zip)
|
||||
file(DOWNLOAD https://github.com/axis-project/archive/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()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "TranslationHelper.h"
|
||||
#include "PackageItem.h"
|
||||
#include "UIPackage.h"
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
#include "pugixml/pugixml.hpp"
|
||||
#else
|
||||
#include "tinyxml2/tinyxml2.h"
|
||||
|
@ -21,7 +21,7 @@ void TranslationHelper::loadFromXML(const char* xmlString, size_t nBytes)
|
|||
{
|
||||
TranslationHelper::strings.clear();
|
||||
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
pugi::xml_document doc;
|
||||
if (doc.load_buffer(xmlString, nBytes)) {
|
||||
auto root = doc.document_element();
|
||||
|
|
|
@ -643,7 +643,7 @@ void UIPackage::loadAtlas(PackageItem* item)
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
if(image->getFileType() == Image::Format::ETC1)
|
||||
tex->updateWithImage(image, Texture2D::getDefaultAlphaPixelFormat(), 1);
|
||||
#else
|
||||
|
@ -769,7 +769,7 @@ void UIPackage::loadFont(PackageItem* item)
|
|||
{
|
||||
item->bitmapFont = BitmapFont::create();
|
||||
auto bitmapFont = item->bitmapFont;
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
auto fontAtlas = bitmapFont->resetFontAtlas(bitmapFont->newFontAtlas());
|
||||
#else
|
||||
auto fontAtlas = bitmapFont->resetFontAtlas(bitmapFont->createFontAtlas());
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
static BitmapFont* create();
|
||||
|
||||
virtual int* getHorizontalKerningForTextUTF32(const std::u32string& text, int &outNumLetters) const override;
|
||||
# if defined(ADXE_VERSION)
|
||||
# if defined(AXIS_VERSION)
|
||||
virtual cocos2d::FontAtlas* newFontAtlas() override { return new cocos2d::FontAtlas(this); }
|
||||
#else
|
||||
virtual cocos2d::FontAtlas* createFontAtlas() override { return new cocos2d::FontAtlas(*this); }
|
||||
|
|
|
@ -100,7 +100,7 @@ void FUISprite::setScaleByTile(bool value)
|
|||
|
||||
void FUISprite::setGrayed(bool value)
|
||||
{
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
Sprite::setProgramState(value ? backend::ProgramType::GRAY_SCALE : backend::ProgramType::POSITION_TEXTURE_COLOR);
|
||||
#elif COCOS2D_VERSION >= 0x00040000
|
||||
auto isETC1 = getTexture() && getTexture()->getAlphaTextureName();
|
||||
|
|
|
@ -87,7 +87,7 @@ SkeletonBatch::~SkeletonBatch () {
|
|||
backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* command, backend::ProgramState* programState)
|
||||
{
|
||||
auto& currentState = command->getPipelineDescriptor().programState;
|
||||
#if defined(ADXE_VERSION)
|
||||
#if defined(AXIS_VERSION)
|
||||
if(currentState == nullptr || currentState->getProgram() != programState->getProgram() || currentState->getUniformID() != programState->getUniformID()) {
|
||||
#else
|
||||
if(currentState == nullptr || currentState->getProgram() != programState->getProgram()) {
|
||||
|
|
|
@ -52,7 +52,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
|
|||
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
set(_AX_USE_PREBUILT FALSE)
|
||||
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR})
|
||||
set(_AX_USE_PREBUILT TRUE)
|
||||
|
@ -198,8 +198,8 @@ if (AX_WITH_YAML_CPP)
|
|||
endif()
|
||||
|
||||
if (_AX_USE_PREBUILT) # support windows only
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
|
||||
use_cocos2dx_compile_define(${APP_NAME})
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisConfigDefine.cmake)
|
||||
use_axis_compile_define(${APP_NAME})
|
||||
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
|
||||
axis_link_cxx_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
|
||||
|
|
|
@ -54,7 +54,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project
|
|||
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
set(AX_ENABLE_EXT_LUA ON)
|
||||
|
||||
set(_AX_USE_PREBUILT FALSE)
|
||||
|
@ -212,8 +212,8 @@ if (AX_WITH_YAML_CPP)
|
|||
endif()
|
||||
|
||||
if (_AX_USE_PREBUILT) # support windows only
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/CocosConfigDefine.cmake)
|
||||
use_cocos2dx_compile_define(${APP_NAME})
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisConfigDefine.cmake)
|
||||
use_axis_compile_define(${APP_NAME})
|
||||
|
||||
include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake)
|
||||
axis_link_lua_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR})
|
||||
|
|
|
@ -29,7 +29,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
|
|||
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
|
|||
endif()
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
|
|||
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
|
|||
endif()
|
||||
set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
include(AxisBuildSet)
|
||||
set(AX_ENABLE_EXT_LUA ON)
|
||||
|
||||
set(_AX_USE_PREBUILT FALSE)
|
||||
|
|
Loading…
Reference in New Issue