diff --git a/CMakeLists.txt b/CMakeLists.txt index 924cb03..470bd18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index d71e9ba..83608b1 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -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}) diff --git a/core/Material.cpp b/core/Material.cpp index b90fdb1..ddef99a 100644 --- a/core/Material.cpp +++ b/core/Material.cpp @@ -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 diff --git a/core/couch.cpp b/core/couch.cpp index a13b478..cd58989 100644 --- a/core/couch.cpp +++ b/core/couch.cpp @@ -29,10 +29,6 @@ #include "Scripting/Lua.h" -// Thirdparty Includes -#define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" - Window *window; const int width = 800;