From 5a281226060cad11ddd780c4d1fc3f0062578949 Mon Sep 17 00:00:00 2001 From: NaifBanana <30419422+NaifBanana@users.noreply.github.com> Date: Sun, 7 Apr 2024 04:24:02 -0500 Subject: [PATCH] Separate source files into libraries --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d28dda..6907ba7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,12 @@ include(CPACK) include_directories(./dep ./includes) link_directories(../libs/glfw-3.3.9/build/src) -add_executable(main source/main.cpp source/Window.cpp source/Events.cpp source/funcs.cpp source/shader.cpp ../libs/glad/src/glad.c) -target_link_libraries(main glfw3) +add_library(NBEvents source/Events.cpp) + +add_library(NBWindows source/Window.cpp) + +add_executable(main source/main.cpp source/funcs.cpp source/shader.cpp ../libs/glad/src/glad.c) +target_link_libraries(main NBWindows NBEvents glfw3) set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)