create SDL window
Some checks failed
Build and Test verification / build (push) Failing after 26s
Build and Test verification / test (push) Has been skipped

This commit is contained in:
2026-05-09 15:36:53 -05:00
parent c3afcadc0f
commit f72bd8c44f
7 changed files with 151 additions and 28 deletions

View File

@@ -17,28 +17,45 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(googletest)
# sdl3
FetchContent_Declare(
sdl3
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
GIT_TAG release-3.4.x
)
FetchContent_MakeAvailable(sdl3)
# add_subdirectory() to nest CMakeLists
add_executable(maiden
src/App.cpp
src/Window.cpp
src/main.cpp
# include extra source files here
)
add_executable(maiden_test
src/App.cpp
src/Window.cpp
test/TestApp.cpp
)
# i think the strat is to build all of the core app components into a single library
# and then you link that to the two different executables (real main and test main)
target_include_directories(maiden PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
# add additional include directories here
)
target_link_libraries(maiden PRIVATE
SDL3::SDL3
)
target_include_directories(maiden_test PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
# test only stuff down here VVV
target_compile_options(maiden_test PRIVATE --coverage)
target_link_options(maiden_test PRIVATE --coverage)
@@ -46,6 +63,7 @@ target_link_options(maiden_test PRIVATE --coverage)
target_link_libraries(maiden_test PRIVATE
GTest::gmock
GTest::gmock_main
SDL3::SDL3
)
include(CTest)