From 7fa5e462df0ce6d3163b374f9ec5a52d646f2114 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 16 Feb 2024 15:54:03 -0500 Subject: [PATCH] init --- .gitignore | 0 .gitmodules | 3 ++ CMakeLists.txt | 63 +++++++++++++++++++++++++++++++++++++++ include/lilfbtf/lilfbtf.h | 29 ++++++++++++++++++ libs/BLT | 1 + src/lilfbtf.cpp | 26 ++++++++++++++++ tests/src/main.cpp | 7 +++++ 7 files changed, 129 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 CMakeLists.txt create mode 100644 include/lilfbtf/lilfbtf.h create mode 160000 libs/BLT create mode 100644 src/lilfbtf.cpp create mode 100644 tests/src/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d5c64c9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libs/BLT"] + path = libs/BLT + url = https://github.com/tri11paragon/blt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c0a1d58 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 3.25) +project(lilfbtf5) + +option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) +option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) +option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF) + +set(CMAKE_CXX_STANDARD 17) + +add_subdirectory(libs/BLT) + +file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") +file(GLOB_RECURSE PROJECT_TESTS_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/tests/src/*.cpp") + +add_library(lilfbtf5 ${PROJECT_BUILD_FILES}) + +target_include_directories(lilfbtf5 PUBLIC include/) +target_link_libraries(lilfbtf5 PUBLIC BLT) + +target_compile_options(lilfbtf5 PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-comment) +target_link_options(lilfbtf5 PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-comment) + +if (${ENABLE_ADDRSAN} MATCHES ON) + target_compile_options(lilfbtf5 PRIVATE -fsanitize=address) + target_link_options(lilfbtf5 PRIVATE -fsanitize=address) +endif () + +if (${ENABLE_UBSAN} MATCHES ON) + target_compile_options(lilfbtf5 PRIVATE -fsanitize=undefined) + target_link_options(lilfbtf5 PRIVATE -fsanitize=undefined) +endif () + +if (${ENABLE_TSAN} MATCHES ON) + target_compile_options(lilfbtf5 PRIVATE -fsanitize=thread) + target_link_options(lilfbtf5 PRIVATE -fsanitize=thread) +endif () + +project(lilfbtf5_test) + +add_executable(lilfbtf5_test ${PROJECT_TESTS_BUILD_FILES}) + +target_include_directories(lilfbtf5_test PUBLIC tests/include/) +target_link_libraries(lilfbtf5_test PUBLIC lilfbtf5) + +target_compile_options(lilfbtf5_test PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-comment) +target_link_options(lilfbtf5_test PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-comment) + +if (${ENABLE_ADDRSAN} MATCHES ON) + target_compile_options(lilfbtf5_test PRIVATE -fsanitize=address) + target_link_options(lilfbtf5_test PRIVATE -fsanitize=address) +endif () + +if (${ENABLE_UBSAN} MATCHES ON) + target_compile_options(lilfbtf5_test PRIVATE -fsanitize=undefined) + target_link_options(lilfbtf5_test PRIVATE -fsanitize=undefined) +endif () + +if (${ENABLE_TSAN} MATCHES ON) + target_compile_options(lilfbtf5_test PRIVATE -fsanitize=thread) + target_link_options(lilfbtf5_test PRIVATE -fsanitize=thread) +endif () + +project(lilfbtf5) \ No newline at end of file diff --git a/include/lilfbtf/lilfbtf.h b/include/lilfbtf/lilfbtf.h new file mode 100644 index 0000000..533d559 --- /dev/null +++ b/include/lilfbtf/lilfbtf.h @@ -0,0 +1,29 @@ +/* + * + * Copyright (C) 2024 Brett Terpstra + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LILFBTF5_LILFBTF_H +#define LILFBTF5_LILFBTF_H + +namespace lilfb +{ + + + +} + +#endif //LILFBTF5_LILFBTF_H diff --git a/libs/BLT b/libs/BLT new file mode 160000 index 0000000..68f6a0a --- /dev/null +++ b/libs/BLT @@ -0,0 +1 @@ +Subproject commit 68f6a0af44fe8ba5044a7f37b8bac9809ab709f1 diff --git a/src/lilfbtf.cpp b/src/lilfbtf.cpp new file mode 100644 index 0000000..6c853e3 --- /dev/null +++ b/src/lilfbtf.cpp @@ -0,0 +1,26 @@ +/* + * + * Copyright (C) 2024 Brett Terpstra + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +namespace lilfb +{ + + + +} diff --git a/tests/src/main.cpp b/tests/src/main.cpp new file mode 100644 index 0000000..4f9de56 --- /dev/null +++ b/tests/src/main.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +}