Remove dependency cycle (build for windows is working?)

This commit is contained in:
Dane Johnson 2021-03-02 15:03:55 -06:00
parent a792d05ba1
commit c568da15be
4 changed files with 15 additions and 10 deletions

View File

@ -10,6 +10,7 @@ add_executable(couch core/couch.cpp)
add_subdirectory(core) add_subdirectory(core)
target_link_libraries(couch couchlib) target_link_libraries(couch couchlib)
target_link_libraries(couch couchlib_luascripting)
add_subdirectory(scripting) add_subdirectory(scripting)
if (LUA_ENABLED) if (LUA_ENABLED)

View File

@ -53,8 +53,6 @@ target_sources(couchlib PUBLIC
Vertex.cpp Vertex.cpp
World.h World.h
World.cpp World.cpp
Scripting/Lua.h
Scripting/Lua.cpp
Scripting/ScriptingLanguage.h Scripting/ScriptingLanguage.h
Scripting/ScriptingLanguage.cpp Scripting/ScriptingLanguage.cpp
Shaders/FlatShader.h Shaders/FlatShader.h
@ -66,6 +64,14 @@ target_sources(couchlib PUBLIC
Shaders/SkyboxShader.h Shaders/SkyboxShader.h
Shaders/SkyboxShader.cpp) Shaders/SkyboxShader.cpp)
add_library(couchlib_luascripting SHARED)
target_sources(couchlib_luascripting PUBLIC
Scripting/Lua.h
Scripting/Lua.cpp)
target_link_libraries(couchlib_luascripting couchlua)
target_include_directories(couchlib target_include_directories(couchlib
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}) ${CMAKE_CURRENT_SOURCE_DIR})
@ -78,13 +84,11 @@ target_include_directories(couchlib
PUBLIC PUBLIC
${ASSIMP_INCLUDE_DIR}) ${ASSIMP_INCLUDE_DIR})
if(NOT WIN32) target_link_libraries(couchlib glfw)
target_link_libraries(couchlib glfw)
endif()
target_link_libraries(couchlib OpenGL::GL) target_link_libraries(couchlib OpenGL::GL)
target_link_libraries(couchlib GLEW::GLEW) target_link_libraries(couchlib GLEW::GLEW)
if (LUA_ENABLED) if (LUA_ENABLED)
target_link_libraries(couchlib ${LUA_LIBRARIES}) target_link_libraries(couchlib_luascripting ${LUA_LIBRARIES})
endif () endif ()
target_link_libraries(couchlib ${BULLET_LIBRARIES}) target_link_libraries(couchlib ${BULLET_LIBRARIES})
target_link_libraries(couchlib ${ASSIMP_LIBRARY}) target_link_libraries(couchlib ${ASSIMP_LIBRARY})

View File

@ -1,3 +1,7 @@
// NOTE: Do this here and only here, stbi will be defined where
// this macro is included
#define STB_IMAGE_IMPLEMENTATION
#include "Material.h" #include "Material.h"
#include <string> #include <string>

View File

@ -29,10 +29,6 @@
#include "Scripting/Lua.h" #include "Scripting/Lua.h"
// Thirdparty Includes
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
Window *window; Window *window;
const int width = 800; const int width = 800;