axmol/extensions/scripting/lua-bindings/CMakeLists.txt

227 lines
7.0 KiB
CMake
Raw Normal View History

2022-08-11 15:41:10 +08:00
set(ax_root ${AXYS_ROOT_PATH})
2019-11-23 20:27:39 +08:00
set(lua_bindings_manual_headers
manual/CCComponentLua.h
2022-08-08 18:02:17 +08:00
manual/3d/axlua_3d_manual.h
2019-11-23 20:27:39 +08:00
manual/CCLuaStack.h
manual/CCLuaEngine.h
manual/lua_module_register.h
manual/CCLuaBridge.h
2022-08-08 18:02:17 +08:00
manual/extension/axlua_extension_manual.h
2019-11-23 20:27:39 +08:00
manual/LuaBasicConversions.h
manual/spine/LuaSkeletonAnimation.h
manual/platform/ios/CCLuaObjcBridge.h
2022-08-08 18:02:17 +08:00
manual/network/axlua_network_manual.h
2019-11-23 20:27:39 +08:00
manual/network/lua_xml_http_request.h
manual/network/lua_downloader.h
2022-08-08 18:02:17 +08:00
manual/audioengine/axlua_audioengine_manual.h
2019-11-23 20:27:39 +08:00
manual/Lua-BindingsExport.h
manual/tolua_fix.h
2022-08-08 18:02:17 +08:00
manual/navmesh/axlua_navmesh_manual.h
manual/navmesh/axlua_navmesh_conversions.h
2022-07-12 21:31:54 +08:00
manual/base/LuaScriptHandlerMgr.h
2022-08-08 18:02:17 +08:00
manual/base/axlua_base_manual.hpp
manual/AxluaLoader.h
2019-11-23 20:27:39 +08:00
manual/CCLuaValue.h
2022-08-08 18:02:17 +08:00
manual/physics3d/axlua_physics3d_manual.h
2022-07-12 21:31:54 +08:00
manual/cocostudio/lua-cocostudio-conversions.h
2019-11-23 20:27:39 +08:00
manual/cocostudio/CustomGUIReader.h
2022-08-08 18:02:17 +08:00
manual/ui/axlua_ui_manual.hpp
manual/controller/axlua_controller_manual.hpp
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_manual_files
manual/CCLuaBridge.cpp
manual/CCLuaEngine.cpp
manual/CCLuaStack.cpp
manual/CCLuaValue.cpp
2022-08-08 18:02:17 +08:00
manual/AxluaLoader.cpp
2019-11-23 20:27:39 +08:00
manual/LuaBasicConversions.cpp
manual/lua_module_register.cpp
manual/tolua_fix.cpp
manual/CCComponentLua.cpp
2022-07-12 21:31:54 +08:00
manual/base/LuaScriptHandlerMgr.cpp
2022-08-08 18:02:17 +08:00
manual/base/axlua_base_manual.cpp
manual/physics/axlua_physics_manual.cpp
manual/3d/axlua_3d_manual.cpp
2019-11-23 20:27:39 +08:00
manual/cocostudio/CustomGUIReader.cpp
2022-08-08 18:02:17 +08:00
manual/cocostudio/axlua_cocostudio_manual.cpp
2022-07-12 21:31:54 +08:00
manual/cocostudio/lua-cocostudio-conversions.cpp
2022-08-08 18:02:17 +08:00
manual/cocostudio/axlua_csloader_manual.cpp
manual/controller/axlua_controller_manual.cpp
manual/extension/axlua_extension_manual.cpp
manual/network/axlua_network_manual.cpp
2019-11-23 20:27:39 +08:00
manual/network/lua_xml_http_request.cpp
manual/network/lua_downloader.cpp
2022-08-08 18:02:17 +08:00
manual/spine/axlua_spine_manual.cpp
2019-11-23 20:27:39 +08:00
manual/spine/LuaSkeletonAnimation.cpp
2022-08-08 18:02:17 +08:00
manual/ui/axlua_ui_manual.cpp
manual/audioengine/axlua_audioengine_manual.cpp
manual/physics3d/axlua_physics3d_manual.cpp
manual/navmesh/axlua_navmesh_conversions.cpp
manual/navmesh/axlua_navmesh_manual.cpp
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_auto_headers
2022-08-08 18:02:17 +08:00
auto/axlua_audioengine_auto.hpp
auto/axlua_3d_auto.hpp
auto/axlua_controller_auto.hpp
auto/axlua_spine_auto.hpp
auto/axlua_studio_auto.hpp
auto/axlua_base_auto.hpp
auto/axlua_navmesh_auto.hpp
auto/axlua_csloader_auto.hpp
auto/axlua_physics3d_auto.hpp
auto/axlua_ui_auto.hpp
auto/axlua_physics_auto.hpp
auto/axlua_extension_auto.hpp
auto/axlua_backend_auto.hpp
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_auto_files
2022-08-08 18:02:17 +08:00
auto/axlua_3d_auto.cpp
auto/axlua_base_auto.cpp
auto/axlua_controller_auto.cpp
auto/axlua_extension_auto.cpp
auto/axlua_physics_auto.cpp
auto/axlua_spine_auto.cpp
auto/axlua_studio_auto.cpp
auto/axlua_csloader_auto.cpp
auto/axlua_ui_auto.cpp
auto/axlua_audioengine_auto.cpp
auto/axlua_physics3d_auto.cpp
auto/axlua_navmesh_auto.cpp
auto/axlua_backend_auto.cpp
2019-11-23 20:27:39 +08:00
)
if(APPLE)
# CCLuaObjcBridge.mm needed by ios and mac
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
manual/platform/ios/CCLuaObjcBridge.h
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
manual/platform/ios/CCLuaObjcBridge.mm
)
if(IOS)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.hpp
auto/axlua_webview_auto.hpp
auto/axlua_video_auto.hpp
manual/ui/axlua_video_manual.hpp
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.cpp
auto/axlua_webview_auto.cpp
manual/ui/axlua_video_manual.cpp
auto/axlua_video_auto.cpp
2019-11-23 20:27:39 +08:00
)
endif()
elseif(ANDROID)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.hpp
auto/axlua_webview_auto.hpp
auto/axlua_video_auto.hpp
manual/ui/axlua_video_manual.hpp
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.cpp
auto/axlua_webview_auto.cpp
manual/ui/axlua_video_manual.cpp
auto/axlua_video_auto.cpp
2019-11-23 20:27:39 +08:00
)
elseif(WINDOWS)
if(AX_ENABLE_MFMEDIA)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
2022-08-08 18:02:17 +08:00
auto/axlua_video_auto.hpp
manual/ui/axlua_video_manual.hpp
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_video_manual.cpp
auto/axlua_video_auto.cpp
)
endif()
if(AX_ENABLE_MSEDGE_WEBVIEW2)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.hpp
auto/axlua_webview_auto.hpp
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
2022-08-08 18:02:17 +08:00
manual/ui/axlua_webview_manual.cpp
auto/axlua_webview_auto.cpp
)
endif()
2019-11-23 20:27:39 +08:00
endif()
set(lua_bindings_files
${lua_bindings_manual_files}
${lua_bindings_auto_files}
2022-08-11 15:41:10 +08:00
${_AX_DEPRECATED_SRC}
2019-11-23 20:27:39 +08:00
)
set(lua_bindings_headers
${lua_bindings_manual_headers}
${lua_bindings_auto_headers}
2022-08-11 15:41:10 +08:00
${_AX_DEPRECATED_HEADER}
2019-11-23 20:27:39 +08:00
)
2020-11-11 15:51:46 +08:00
set(lua_bindings_files
${lua_bindings_files}
2022-08-11 15:41:10 +08:00
"${ax_root}/thirdparty/yasio/bindings/lyasio.cpp"
"${ax_root}/thirdparty/yasio/bindings/yasio_cclua.cpp")
2020-10-19 23:21:40 +08:00
2019-11-23 20:27:39 +08:00
list(APPEND lua_bindings_files ${lua_bindings_headers})
2022-08-08 18:02:17 +08:00
set(_AX_LUA_LIB axlua CACHE INTERNAL "The AXYS lua bindings lib name" )
2020-10-17 16:32:16 +08:00
2022-08-08 18:02:17 +08:00
add_library(${_AX_LUA_LIB} STATIC ${lua_bindings_files})
target_link_libraries(${_AX_LUA_LIB} ${_AX_CORE_LIB})
add_dependencies(${_AX_LUA_LIB} ${_AX_CORE_LIB})
2019-11-23 20:27:39 +08:00
if(MSVC)
2022-08-08 18:02:17 +08:00
target_compile_options(${_AX_LUA_LIB} PRIVATE /bigobj)
endif()
2022-07-08 07:17:41 +08:00
get_target_property(lua_ext_depend thirdparty AX_LUA_DEPEND)
2022-08-08 18:02:17 +08:00
target_link_libraries(${_AX_LUA_LIB} ${lua_ext_depend})
2019-11-23 20:27:39 +08:00
2022-08-08 18:02:17 +08:00
target_include_directories(${_AX_LUA_LIB}
2022-08-11 15:41:10 +08:00
PUBLIC ${ax_root}/thirdparty/lua
2019-11-23 20:27:39 +08:00
PRIVATE manual/platform/android
PRIVATE manual/platform/android/jni
2022-08-11 15:41:10 +08:00
PRIVATE ${ax_root}/extensions/spine/runtime/include
PRIVATE ${ax_root}/extensions/cocostudio
INTERFACE ${ax_root}/extensions/scripting/lua-bindings/manual
PRIVATE ${ax_root}/extensions/spine/runtime/include
2019-11-23 20:27:39 +08:00
)
if(WINDOWS)
2022-08-08 18:02:17 +08:00
target_compile_definitions(${_AX_LUA_LIB} PUBLIC _USRLUASTATIC)
2019-11-23 20:27:39 +08:00
endif()
if(AX_ENABLE_MSEDGE_WEBVIEW2)
endif()
2022-08-11 15:41:10 +08:00
ax_config_pred(${_AX_LUA_LIB} AX_ENABLE_MFMEDIA)
ax_config_pred(${_AX_LUA_LIB} AX_ENABLE_MSEDGE_WEBVIEW2)
2022-08-08 18:02:17 +08:00
set_target_properties(${_AX_LUA_LIB}
2019-11-23 20:27:39 +08:00
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
2020-10-17 16:32:16 +08:00
FOLDER "Extensions"
2019-11-23 20:27:39 +08:00
)
if(XCODE OR VS)
2022-08-11 15:41:10 +08:00
ax_mark_code_files("${_AX_LUA_LIB}")
2019-11-23 20:27:39 +08:00
endif()