From 225cda4a145b0dcb93d7efe434625de256862b23 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 30 Jul 2023 17:15:02 +0300 Subject: [PATCH 1/4] removed CMake-less Lua submodule --- .gitmodules | 3 --- external/lua | 1 - 2 files changed, 4 deletions(-) delete mode 160000 external/lua diff --git a/.gitmodules b/.gitmodules index 1c4ef8f..6a3c5b3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "external/glfw"] path = external/glfw url = https://github.com/glfw/glfw -[submodule "external/lua"] - path = external/lua - url = https://github.com/lua/lua diff --git a/external/lua b/external/lua deleted file mode 160000 index 8426d9b..0000000 --- a/external/lua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 From 84d70b281b863e57cfacecbb9623faddc2ec05ce Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 30 Jul 2023 17:25:31 +0300 Subject: [PATCH 2/4] using Lua dep as a CMake project --- .gitmodules | 3 +++ CMakeLists.txt | 13 +++++-------- external/lua-cmake | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) create mode 160000 external/lua-cmake diff --git a/.gitmodules b/.gitmodules index 6a3c5b3..f71aab3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "external/glfw"] path = external/glfw url = https://github.com/glfw/glfw +[submodule "external/lua-cmake"] + path = external/lua-cmake + url = https://github.com/lubgr/lua-cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f8509..924d6c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,22 +10,19 @@ set(core inputManager.cpp mapping.h stateManager.cpp luaManager.cpp) set(util util.cpp) set(GLFW_DIR vb01/external/glfw) -set(LUA_DIR external/lua) +set(LUA_DIR external/lua-cmake) include_directories(../${GLFW_DIR}/include/GLFW) set(LUA_LIB_DIR ${LUA_DIR}) -include_directories(${LUA_DIR}) -link_directories(${LUA_DIR}) +add_subdirectory(${LUA_DIR}) -add_library(gameBase STATIC ${states} ${core} ${util}) -set(GLFW_DIR ../vb01/external/glfw) set(LIB_NAME gameBase) +add_library(${LIB_NAME} STATIC ${states} ${core} ${util}) +set(GLFW_DIR ../vb01/external/glfw) set(GLFW_LIB_DIR ../vb01/build/external/glfw/src) target_include_directories(${LIB_NAME} PUBLIC ${GLFW_DIR}/include/GLFW) target_link_directories(${LIB_NAME} PUBLIC ${GLFW_LIB_DIR}) -target_link_libraries(${LIB_NAME} lua) -target_link_libraries(gameBase glfw) - +target_link_libraries(${LIB_NAME} glfw lua::lib) diff --git a/external/lua-cmake b/external/lua-cmake new file mode 160000 index 0000000..ca210c5 --- /dev/null +++ b/external/lua-cmake @@ -0,0 +1 @@ +Subproject commit ca210c56ae41ff13b20490cca8be5ead47b24196 From b311ea23af0595d983ba5685be5ea54fc568f5fa Mon Sep 17 00:00:00 2001 From: devZoGok Date: Mon, 31 Jul 2023 20:01:37 +0300 Subject: [PATCH 3/4] replaced lua.hpp include with externed *.h includes --- CMakeLists.txt | 13 ++++--------- luaManager.h | 8 +++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 924d6c3..dcd234a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,20 +9,15 @@ set(states abstractAppState.cpp) set(core inputManager.cpp mapping.h stateManager.cpp luaManager.cpp) set(util util.cpp) -set(GLFW_DIR vb01/external/glfw) -set(LUA_DIR external/lua-cmake) - -include_directories(../${GLFW_DIR}/include/GLFW) - -set(LUA_LIB_DIR ${LUA_DIR}) -add_subdirectory(${LUA_DIR}) - set(LIB_NAME gameBase) add_library(${LIB_NAME} STATIC ${states} ${core} ${util}) -set(GLFW_DIR ../vb01/external/glfw) +set(GLFW_DIR external/glfw) set(GLFW_LIB_DIR ../vb01/build/external/glfw/src) target_include_directories(${LIB_NAME} PUBLIC ${GLFW_DIR}/include/GLFW) target_link_directories(${LIB_NAME} PUBLIC ${GLFW_LIB_DIR}) +set(LUA_DIR external/lua-cmake) +add_subdirectory(${LUA_DIR}) +target_include_directories(${LIB_NAME} PUBLIC ${LUA_DIR}/external/upstream) target_link_libraries(${LIB_NAME} glfw lua::lib) diff --git a/luaManager.h b/luaManager.h index fcd0826..f65fdd5 100644 --- a/luaManager.h +++ b/luaManager.h @@ -1,9 +1,11 @@ #ifndef LUA_MANAGER_H #define LUA_MANAGER_H -#include -#include -#include +extern "C"{ + #include + #include + #include +} #include #include From 3760eca97453665199c6faf21880f5b4e49ea3dc Mon Sep 17 00:00:00 2001 From: devZoGok Date: Tue, 15 Aug 2023 15:00:19 +0300 Subject: [PATCH 4/4] updated GLFW link dir --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dcd234a..664b70a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(LIB_NAME gameBase) add_library(${LIB_NAME} STATIC ${states} ${core} ${util}) set(GLFW_DIR external/glfw) -set(GLFW_LIB_DIR ../vb01/build/external/glfw/src) +set(GLFW_LIB_DIR build/external/glfw/src) target_include_directories(${LIB_NAME} PUBLIC ${GLFW_DIR}/include/GLFW) target_link_directories(${LIB_NAME} PUBLIC ${GLFW_LIB_DIR})