From 0db926f293bfbc5dc123a260259ae6ef9db61947 Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 4 Feb 2024 23:35:06 +1100 Subject: [PATCH 1/5] Update paths to lua bindings --- .../lua-bindings/manual/platform/android/LuaJavaBridge.cpp | 4 ++-- .../lua-bindings/manual/platform/android/jni/LuaBridge.cpp | 4 ++-- .../lua-bindings/manual/platform/ios/LuaObjcBridge.mm | 2 +- templates/lua-template-default/Source/AppDelegate.cpp | 4 ++-- tests/lua-tests/proj.ios_mac/ios/LuaObjectCBridgeTest.mm | 4 ++-- tests/lua-tests/proj.ios_mac/mac/LuaObjectCBridgeTest.mm | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extensions/scripting/lua-bindings/manual/platform/android/LuaJavaBridge.cpp b/extensions/scripting/lua-bindings/manual/platform/android/LuaJavaBridge.cpp index 2a3d8cd36fc5..ee2cbe653952 100644 --- a/extensions/scripting/lua-bindings/manual/platform/android/LuaJavaBridge.cpp +++ b/extensions/scripting/lua-bindings/manual/platform/android/LuaJavaBridge.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "scripting/lua-bindings/manual/platform/android/LuaJavaBridge.h" +#include "LuaJavaBridge.h" #if defined(__ANDROID__) # include "platform/android/jni/JniHelper.h" # include @@ -32,7 +32,7 @@ # define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) extern "C" { -# include "scripting/lua-bindings/manual/tolua_fix.h" +# include "lua-bindings/manual/tolua_fix.h" } LuaJavaBridge::CallInfo::~CallInfo() diff --git a/extensions/scripting/lua-bindings/manual/platform/android/jni/LuaBridge.cpp b/extensions/scripting/lua-bindings/manual/platform/android/jni/LuaBridge.cpp index de756c67bc43..beb45b807f00 100644 --- a/extensions/scripting/lua-bindings/manual/platform/android/jni/LuaBridge.cpp +++ b/extensions/scripting/lua-bindings/manual/platform/android/jni/LuaBridge.cpp @@ -22,12 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "scripting/lua-bindings/manual/platform/android/jni/LuaBridge.h" +#include "LuaBridge.h" #if defined(__ANDROID__) # include -# include "scripting/lua-bindings/manual/platform/android/LuaJavaBridge.h" +# include "lua-bindings/manual/platform/android/LuaJavaBridge.h" # include "base/UTF8.h" diff --git a/extensions/scripting/lua-bindings/manual/platform/ios/LuaObjcBridge.mm b/extensions/scripting/lua-bindings/manual/platform/ios/LuaObjcBridge.mm index 1c12245b6bae..9d69503af09c 100644 --- a/extensions/scripting/lua-bindings/manual/platform/ios/LuaObjcBridge.mm +++ b/extensions/scripting/lua-bindings/manual/platform/ios/LuaObjcBridge.mm @@ -23,7 +23,7 @@ of this software and associated documentation files (the "Software"), to deal THE SOFTWARE. ****************************************************************************/ -#include "scripting/lua-bindings/manual/platform/ios/LuaObjcBridge.h" +#include "lua-bindings/manual/platform/ios/LuaObjcBridge.h" #include NS_AX_BEGIN diff --git a/templates/lua-template-default/Source/AppDelegate.cpp b/templates/lua-template-default/Source/AppDelegate.cpp index 93264d226fd1..bdf0bcc53f2c 100644 --- a/templates/lua-template-default/Source/AppDelegate.cpp +++ b/templates/lua-template-default/Source/AppDelegate.cpp @@ -24,9 +24,9 @@ ****************************************************************************/ #include "AppDelegate.h" -#include "scripting/lua-bindings/manual/LuaEngine.h" +#include "lua-bindings/manual/LuaEngine.h" #include "cocos2d.h" -#include "scripting/lua-bindings/manual/lua_module_register.h" +#include "lua-bindings/manual/lua_module_register.h" #define USE_AUDIO_ENGINE 1 diff --git a/tests/lua-tests/proj.ios_mac/ios/LuaObjectCBridgeTest.mm b/tests/lua-tests/proj.ios_mac/ios/LuaObjectCBridgeTest.mm index 983faac0c01d..e8be56db2078 100644 --- a/tests/lua-tests/proj.ios_mac/ios/LuaObjectCBridgeTest.mm +++ b/tests/lua-tests/proj.ios_mac/ios/LuaObjectCBridgeTest.mm @@ -25,8 +25,8 @@ of this software and associated documentation files (the "Software"), to deal #import "LuaObjectCBridgeTest.h" #include "cocos2d.h" -#include "scripting/lua-bindings/manual/LuaEngine.h" -#include "scripting/lua-bindings/manual/LuaBridge.h" +#include "lua-bindings/manual/LuaEngine.h" +#include "lua-bindings/manual/LuaBridge.h" USING_NS_AX; diff --git a/tests/lua-tests/proj.ios_mac/mac/LuaObjectCBridgeTest.mm b/tests/lua-tests/proj.ios_mac/mac/LuaObjectCBridgeTest.mm index 983faac0c01d..e8be56db2078 100644 --- a/tests/lua-tests/proj.ios_mac/mac/LuaObjectCBridgeTest.mm +++ b/tests/lua-tests/proj.ios_mac/mac/LuaObjectCBridgeTest.mm @@ -25,8 +25,8 @@ of this software and associated documentation files (the "Software"), to deal #import "LuaObjectCBridgeTest.h" #include "cocos2d.h" -#include "scripting/lua-bindings/manual/LuaEngine.h" -#include "scripting/lua-bindings/manual/LuaBridge.h" +#include "lua-bindings/manual/LuaEngine.h" +#include "lua-bindings/manual/LuaBridge.h" USING_NS_AX; From c3bcb7d5763319e5adf7379fdac1aafd85359658 Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 4 Feb 2024 23:36:09 +1100 Subject: [PATCH 2/5] Update target include directories due to new extension dir structure --- extensions/scripting/lua-bindings/proj.android/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/scripting/lua-bindings/proj.android/CMakeLists.txt b/extensions/scripting/lua-bindings/proj.android/CMakeLists.txt index 977fbda6b7dd..10e3c12678fe 100644 --- a/extensions/scripting/lua-bindings/proj.android/CMakeLists.txt +++ b/extensions/scripting/lua-bindings/proj.android/CMakeLists.txt @@ -16,7 +16,7 @@ add_library(${target_name} STATIC get_target_property(lua_header ${AX_LUA_ENGINE} INTERFACE_INCLUDE_DIRECTORIES) get_target_property(tolua_header tolua INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(${target_name} - PRIVATE ../../.. + PRIVATE ../.. PRIVATE ../manual PRIVATE ../manual/platform/android PRIVATE ${lua_header} From b9fb3b9960874838a16979025ced30f2d529a05a Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 4 Feb 2024 23:36:50 +1100 Subject: [PATCH 3/5] Add missing libraries and paths for prebuilt option --- cmake/Modules/AXLinkHelpers.cmake | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/AXLinkHelpers.cmake b/cmake/Modules/AXLinkHelpers.cmake index 0b59164e74b7..89023ce3628c 100644 --- a/cmake/Modules/AXLinkHelpers.cmake +++ b/cmake/Modules/AXLinkHelpers.cmake @@ -60,6 +60,7 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) target_include_directories(${APP_NAME} PRIVATE ${AX_ROOT_DIR}/thirdparty/lua + PRIVATE ${AX_ROOT_DIR}/extensions/scripting PRIVATE ${AX_ROOT_DIR}/extensions/scripting/lua-bindings/manual PRIVATE ${AX_ROOT_DIR} PRIVATE ${AX_ROOT_DIR}/thirdparty @@ -140,6 +141,7 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) simdjson physics-nodes yasio + websocket-parser ) if (AX_ENABLE_EXT_DRAGONBONES) @@ -213,7 +215,35 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) PRIVATE ${AX_ROOT_DIR}/extensions/GUI/src ) endif() - + + if (AX_ENABLE_EXT_FAIRYGUI) + list(APPEND LIBS "fairygui") + target_include_directories(${APP_NAME} + PRIVATE ${AX_ROOT_DIR}/extensions/fairygui/src + ) + endif() + + if (AX_ENABLE_EXT_LIVE2D) + list(APPEND LIBS "Live2D") + target_include_directories(${APP_NAME} + PRIVATE ${AX_ROOT_DIR}/extensions/Live2D/Framework/src + ) + endif() + + if (AX_ENABLE_EXT_EFFEKSEER) + list(APPEND LIBS "EffekseerForCocos2d-x") + target_include_directories(${APP_NAME} + PRIVATE ${AX_ROOT_DIR}/extensions/Effekseer + ) + endif() + + if (AX_ENABLE_EXT_PHYSICS_NODE) + list(APPEND LIBS "physics-nodes") + target_include_directories(${APP_NAME} + PRIVATE ${AX_ROOT_DIR}/extensions/physics-nodes/src + ) + endif() + if (WINDOWS) target_link_libraries(${APP_NAME} ${LIBS} From 8bdaba6cbb4207a48fe9cfe8543226d13fe6cd50 Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 4 Feb 2024 23:38:13 +1100 Subject: [PATCH 4/5] Current FairyGUI requires paths to parent and source directory --- extensions/fairygui/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/fairygui/CMakeLists.txt b/extensions/fairygui/CMakeLists.txt index 85a0f1450b41..049f24e1e0ae 100644 --- a/extensions/fairygui/CMakeLists.txt +++ b/extensions/fairygui/CMakeLists.txt @@ -6,6 +6,12 @@ FILE(GLOB_RECURSE FAIRYGUI_SOURCES *.h;*.cpp) add_library(${target_name} STATIC ${FAIRYGUI_SOURCES}) target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/fairygui) +target_include_directories(${target_name} + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/fairygui + + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/fairygui + ) setup_ax_extension_config(${target_name}) From 7aa54a9e52d8b266f39ce087a337c21e33e7dba6 Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 4 Feb 2024 23:39:18 +1100 Subject: [PATCH 5/5] Add required thirdparty search path to LUA library --- extensions/scripting/lua-bindings/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/scripting/lua-bindings/CMakeLists.txt b/extensions/scripting/lua-bindings/CMakeLists.txt index d39e64715894..c3e8d4acbba9 100644 --- a/extensions/scripting/lua-bindings/CMakeLists.txt +++ b/extensions/scripting/lua-bindings/CMakeLists.txt @@ -202,6 +202,7 @@ target_link_libraries(${_AX_LUA_LIB} ${lua_ext_depend}) target_include_directories(${_AX_LUA_LIB} PUBLIC ${ax_root}/thirdparty/lua + PRIVATE ${ax_root}/thirdparty PRIVATE manual/platform/android PRIVATE manual/platform/android/jni PRIVATE ${ax_root}/extensions/spine/runtime/include