Remove dependency cycle (build for windows is working?)

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

View File

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

View File

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

View File

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