commit 8a2b261e2f7fa024a9cbed26ebe8b2af8f6f860e Author: S David <2100425+s-daveb@users.noreply.github.com> Date: Sat Dec 9 14:41:42 2023 -0500 Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..569e1c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,134 @@ +# macOS +.DS_Store + +# Windows +Thumbs.db +ehthumbs.db + +# Folder config file commonly created by Windows Explorer +Desktop.ini + +# Recycle Bin used on file shares and remote volumes +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Thumbnail cache files created by Windows +Thumbs.db +Thumbs.db:encryptable + +# Windows Desktop Search +*.pst +*.ost +*.log + +# Compiled Object files, Static and Dynamic libs +*.o +*.lo +*.la +*.a +*.class +*.so +*.lib +*.dll +*.exe + +# Python +__pycache__/ +*.pyc +*.pyo +*.pyd + +# Java +*.class + +# Eclipse +.project +.classpath +.settings/ + +# IntelliJ +.idea/ + +# Visual Studio Code +.vscode/ + +# Node.js +node_modules/ + +# Jupyter Notebook +.ipynb_checkpoints/ + +# Thumbnails +Thumbs/ +Thumbs.db + +# macOS metadata +._* + +# TextMate +*.tmproj +*.tmproject +.tmtags + +# Sublime Text +*.sublime-workspace +*.sublime-project + +# VS Code directories +.vscode/ + +# CodeKit +.codekit-config.json + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Compiled files +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Logs and databases +*.log +*.sql +*.sqlite +*.sqlite3 +*.xml + +# Binary and source packages +*.dmg +*.gz +*.iso +*.jar +*.tar +*.zip +*.rar +*.bin +*.war +*.ear +*.sar +*.bbl +*.pdf +*.xls +*.xlsx +*.ppt +*.pptx + +# Virtual environment +venv/ +env/ + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..63f8999 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.12) +project() + +set(CMAKE_C_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) + +# Include directories +include_directories(${CMAKE_SOURCE_DIR}/src) +include_directories(${CMAKE_SOURCE_DIR}/include) + +# Initialize pkgconf +#find_package(PkgConfig REQUIRED) + +# Example: Find SDL2, SDL2_image, and SDL2_gfx using PkgConfig +# add IMPORTED_TARGET to enable fancy PkgConfig::SDL2 syntax +#pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET SDL2) +#pkg_check_modules(SDL2_IMAGE REQUIRED IMPORTED_TARGET SDL2_image) +#pkg_check_modules(SDL2_GFX REQUIRED IMPORTED_TARGET SDL2_gfx) + +#set(engine_DEP_LIBS +# PkgConfig::SDL2 +# PkgConfig::SDL2_IMAGE +# PkgConfig::SDL2for_GFX +# # if not using PkgConfig:: IMPORTED_TARGET syntax +# # ${SDL2_LIBRARIES} +# #${SDL2_IMG_LIBRARIES} +# # ${SDL2_GFX_LIBRARIES} +#) + +# FetchContent for Catch2 +include(FetchContent) +FetchContent_Declare( + catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.4.0 +) +FetchContent_MakeAvailable(catch2) + +# Add subdirectories +add_subdirectory(src) +add_subdirectory(test) + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..cd2b0b3 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,15 @@ +# Define the library 'engine' +add_library(library OBJECT + library.cpp +) + +# Define build targets for 'engine', 'engine-static', and 'engine-test' +add_library(library SHARED $) +add_library(library-static STATIC $) +add_library(library-testing $) + + +# Link the SDL dependencies +target_link_libraries(library PUBLIC ${library_dep_libs} ) +target_link_libraries(library-static PUBLIC ${library_dep_libs} ) +target_link_libraries(library-testing PUBLIC ${library_dep_libs}) diff --git a/src/library.cpp b/src/library.cpp new file mode 100644 index 0000000..79db373 --- /dev/null +++ b/src/library.cpp @@ -0,0 +1,5 @@ + +class Engine +{ + +}; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..56db3d0 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,12 @@ +# Define the executable 'test-runner' +add_executable(test-runner + runtime-tests.cpp +) + +# Link the 'engine' library and SDL dependencies +target_link_libraries(test-runner +PRIVATE + library-testing + ${library_dep_libs} + Catch2::Catch2WithMain +) diff --git a/test/runtime-tests.cpp b/test/runtime-tests.cpp new file mode 100644 index 0000000..f932236 --- /dev/null +++ b/test/runtime-tests.cpp @@ -0,0 +1,7 @@ + +#include + +TEST_CASE("Basic Catch2 Testcase") +{ + REQUIRE(true == true); +}