Initial commit.
This commit is contained in:
commit
8a2b261e2f
134
.gitignore
vendored
Normal file
134
.gitignore
vendored
Normal file
@ -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/
|
||||||
|
|
42
CMakeLists.txt
Normal file
42
CMakeLists.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
project(<APPLICATION-NAME>)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
15
src/CMakeLists.txt
Normal file
15
src/CMakeLists.txt
Normal file
@ -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 $<TARGET_OBJECTS:engineobj>)
|
||||||
|
add_library(library-static STATIC $<TARGET_OBJECTS:engineobj>)
|
||||||
|
add_library(library-testing $<TARGET_OBJECTS:engineobj>)
|
||||||
|
|
||||||
|
|
||||||
|
# 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})
|
5
src/library.cpp
Normal file
5
src/library.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
class Engine
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
12
test/CMakeLists.txt
Normal file
12
test/CMakeLists.txt
Normal file
@ -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
|
||||||
|
)
|
7
test/runtime-tests.cpp
Normal file
7
test/runtime-tests.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
|
TEST_CASE("Basic Catch2 Testcase")
|
||||||
|
{
|
||||||
|
REQUIRE(true == true);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user