diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c1538c7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,77 @@ +sudo: required +dist: xenial # (16.04) +# bionic (18.04) is not yet available in travis + +language: cpp + +cache: ccache + +addons: + apt: + update: true + +services: + - mysql + +git: + depth: 10 + +stages: + - prepare_cache + - run + +jobs: + include: + - stage: prepare_cache + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + - source ./apps/ci/ci-import-db.sh + script: + - source ./apps/ci/ci-compile.sh + - source ./apps/ci/ci-worldserver-dry-run.sh + + - stage: prepare_cache + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + script: + - source ./apps/ci/ci-compile.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 1acb733..54641af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,2 @@ CU_SET_PATH("CMAKE_MOD_ELUNA_ENGINE_DIR" "${CMAKE_CURRENT_LIST_DIR}") -CU_ADD_HOOK(AFTER_LOAD_CONF "${CMAKE_CURRENT_LIST_DIR}/cmake/after_load_conf.cmake") - - - - - +CU_ADD_HOOK(AFTER_LOAD_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake/after_load_cmake_modules.cmake") diff --git a/LuaEngine b/LuaEngine index adf722a..c027d0b 160000 --- a/LuaEngine +++ b/LuaEngine @@ -1 +1 @@ -Subproject commit adf722a18111c316783ed65392d7b57934f39b07 +Subproject commit c027d0bcb5868e87413214e9b68e99b33db41039 diff --git a/README.md b/README.md index cfe8345..9fcccb2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # mod-LuaEngine - english | [中文说明](README_CN.md) +[english](README.md) | [中文说明](README_CN.md) | [Español](README_ES.md) a Eluna module for AzerothCore. diff --git a/README_CN.md b/README_CN.md index 87d0f5c..56776fd 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,5 +1,5 @@ # mod-LuaEngine -[english](README.md) | 中文 +[english](README.md) | [中文说明](README_CN.md) | [Español](README_ES.md) 一个用于AzerothCore的ELUNA模块. diff --git a/README_ES.md b/README_ES.md new file mode 100644 index 0000000..b33b262 --- /dev/null +++ b/README_ES.md @@ -0,0 +1,19 @@ +# mod-LuaEngine + [English](README.md) | [中文说明](README_CN.md) | [Español](README_ES.md) + +Un módulo de Eluna para AzerothCore. + +Cómo instalar: + +1. Descargar o clonar este módulo: +> [Descargar archivo zip](https://github.com/azerothcore/mod-eluna-lua-engine/archive/master.zip) +> o clonar `git clone https://github.com/azerothcore/mod-eluna-lua-engine.git` +2. Póngalo en la carpeta de módulos del Azerothcore. +> $HOME/azerothcore/modules/ +3. Descargar o clonar el archivo central de ELUNA: +> [Descargar archivo zip](https://github.com/ElunaLuaEngine/Eluna/archive/master.zip) +> o clonar `git clone https://github.com/ElunaLuaEngine/Eluna.git .` +4. Dentro de la carpeta del módulo de Eluna de Azeroth, se encuentra una carpeta / directorio llamado: `LuaEngine` (mod-eluna-lua-engine/LuaEngine). Debe depositar los ficheros de lua, directamente dentro de esa carpeta. Los archivos directamente, no un directorio y luego los ficheros dentro. Por eso te utiliza el “.” cuando se está clonando, para que no genere un directorio nuevo. +5. Una vez copiado los ficheros y descargado el modulo, debes volver a compilar. Si seguiste la guía de instalación, debiste haber generado un directorio build, dentro de azerothcore. Dirígete a él y realiza la compilación como lo menciona en la guía. + +Eluna API : [http://www.elunaengine.com/](http://www.elunaengine.com/) diff --git a/cmake/after_gs_install.cmake b/cmake/after_gs_install.cmake index 19722a5..9808df3 100644 --- a/cmake/after_gs_install.cmake +++ b/cmake/after_gs_install.cmake @@ -1,28 +1,31 @@ +CollectIncludeDirectories( + ${CMAKE_MOD_ELUNA_ENGINE_DIR} + PUBLIC_INCLUDES) -include_directories( - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/lualib - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/src -) - +target_include_directories(game-interface + INTERFACE + ${PUBLIC_INCLUDES}) add_dependencies(game lualib) -target_link_libraries(game lualib) + +target_link_libraries(game + PUBLIC + lualib) if( WIN32 ) - if ( MSVC ) - add_custom_command(TARGET game - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/" - ) - elseif ( MINGW ) - add_custom_command(TARGET game - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/" - ) - endif() + if ( MSVC ) + add_custom_command(TARGET game + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/" + ) + elseif ( MINGW ) + add_custom_command(TARGET game + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/" + ) + endif() endif() install(DIRECTORY "${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/") diff --git a/cmake/after_load_conf.cmake b/cmake/after_load_cmake_modules.cmake similarity index 69% rename from cmake/after_load_conf.cmake rename to cmake/after_load_cmake_modules.cmake index 2c10f00..eb7b43b 100644 --- a/cmake/after_load_conf.cmake +++ b/cmake/after_load_cmake_modules.cmake @@ -1,13 +1,12 @@ add_subdirectory(${CMAKE_MOD_ELUNA_ENGINE_DIR}/lualib) + add_definitions(-DELUNA) add_definitions(-DAZEROTHCORE) add_definitions(-DWOTLK) + CU_ADD_HOOK(BEFORE_GAME_LIBRARY "${CMAKE_MOD_ELUNA_ENGINE_DIR}/cmake/before_gs_install.cmake") CU_ADD_HOOK(AFTER_GAME_LIBRARY "${CMAKE_MOD_ELUNA_ENGINE_DIR}/cmake/after_gs_install.cmake") -CU_ADD_HOOK(BEFORE_SCRIPTS_LIBRARY "${CMAKE_MOD_ELUNA_ENGINE_DIR}/cmake/before_script_install.cmake") -CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_MOD_ELUNA_ENGINE_DIR}/cmake/after_ws_install.cmake") AC_ADD_CONFIG_FILE("${CMAKE_MOD_ELUNA_ENGINE_DIR}/conf/mod_LuaEngine.conf.dist") message("** [Eluna Module] LuaEngine is enable!") - diff --git a/cmake/after_ws_install.cmake b/cmake/after_ws_install.cmake deleted file mode 100644 index 3fbebd1..0000000 --- a/cmake/after_ws_install.cmake +++ /dev/null @@ -1,6 +0,0 @@ - -include_directories( - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/lualib - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/src -) diff --git a/cmake/before_gs_install.cmake b/cmake/before_gs_install.cmake index d893169..95b99b0 100644 --- a/cmake/before_gs_install.cmake +++ b/cmake/before_gs_install.cmake @@ -2,15 +2,12 @@ file(GLOB_RECURSE method_headers ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/*Method file(GLOB_RECURSE sources_ElunaFile_CPP ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/*.cpp ) file(GLOB_RECURSE sources_ElunaFile_H ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine/*.h) -set(game_STAT_SRCS - ${game_STAT_SRCS} - ${sources_ElunaFile_H} - ${sources_ElunaFile_CPP} +set(ElunaLuaEngineFiles + ${ElunaLuaEngineFiles} + ${sources_ElunaFile_H} + ${sources_ElunaFile_CPP} ) source_group("LuaEngine\\Methods" FILES ${method_headers}) - source_group("LuaEngine\\Header Files" FILES ${sources_ElunaFile_H}) - source_group("LuaEngine\\Source Files" FILES ${sources_ElunaFile_CPP}) - diff --git a/cmake/before_script_install.cmake b/cmake/before_script_install.cmake deleted file mode 100644 index 7487800..0000000 --- a/cmake/before_script_install.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include_directories( - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/LuaEngine - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/lualib - ${CMAKE_MOD_ELUNA_ENGINE_DIR}/src -) \ No newline at end of file diff --git a/lualib/CMakeLists.txt b/lualib/CMakeLists.txt index c201500..b1bf6e4 100644 --- a/lualib/CMakeLists.txt +++ b/lualib/CMakeLists.txt @@ -4,16 +4,25 @@ # Please see the included DOCS/LICENSE.md for more information # -file(GLOB sources *.c) -list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/lua.c) -list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/luac.c) - -set(lua_STAT_SRCS - ${sources} -) - -include_directories( +CollectSourceFiles( ${CMAKE_CURRENT_SOURCE_DIR} -) + PRIVATE_SOURCES + # Exclude + ${CMAKE_CURRENT_SOURCE_DIR}/Debugging + ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) -add_library(lualib STATIC ${lua_STAT_SRCS}) +list(REMOVE_ITEM PRIVATE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/lua.c) +list(REMOVE_ITEM PRIVATE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/luac.c) + +add_library(lualib STATIC + ${PRIVATE_SOURCES}) + +CollectIncludeDirectories( + ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC_INCLUDES) + +target_include_directories(lualib + PUBLIC + ${PUBLIC_INCLUDES} + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR})