Skip to content

Commit

Permalink
added tests back in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
PottierLoic committed Jan 4, 2024
1 parent dc2dfbb commit 3a3a30e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
31 changes: 30 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set(IMGUI_DIR "${LIBS_DIR}/imgui")
set(STB_DIR "${LIBS_DIR}/stb")
set(ASSIMP_DIR "${LIBS_DIR}/assimp")


# Executable
project(space)
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -73,3 +72,33 @@ if(FLAGS STREQUAL "--debug")
else()
target_compile_options(space PRIVATE -Wall -Wextra -Werror)
endif()

# ----- Test executable section ----- #
project(
test
LANGUAGES CXX
VERSION 1.0
)

set(CMAKE_CXX_STANDARD 14)

file(
GLOB_RECURSE
TEST_SOURCES
"${SOURCE_DIR}/tests/*.cpp"
"${SOURCE_DIR}/src/*.cpp"
)

# Exclude src/main.cpp
list(REMOVE_ITEM TEST_SOURCES "${SOURCE_DIR}/src/main.cpp")

add_executable(test ${TEST_SOURCES})
target_sources(test PRIVATE ${SOURCE_LIST} ${IMGUI_SOURCES} ${HEADER_LIST} ${GLM_HEADERS})
target_include_directories(test PRIVATE ${INCLUDE_DIR}
"${GLFW_DIR}/include"
"${GLAD_DIR}/include"
"${STB_DIR}/"
"${GLM_DIR}/"
"${ASSIMP_DIR}/include"
)
target_link_libraries(test PRIVATE ${OPENGL_gl_LIBRARY} assimp glfw glad)
1 change: 0 additions & 1 deletion src/FrameBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ FrameBuffer::FrameBuffer(float width, float height) {
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}


FrameBuffer::~FrameBuffer() {
glDeleteFramebuffers(1, &fbo);
glDeleteTextures(1, &texture);
Expand Down

0 comments on commit 3a3a30e

Please sign in to comment.