Added fennec::allocation and all necessary dependencies

This commit is contained in:
2025-05-30 21:10:52 -04:00
parent 1a27e37f66
commit 67c8ad9a0d
24 changed files with 847 additions and 74 deletions

View File

@@ -4,6 +4,7 @@ project(fennec)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_C_STANDARD 26)
# any necessary include directories
include_directories(include)
add_library(fennec STATIC
@@ -22,12 +23,15 @@ add_library(fennec STATIC
include/fennec/lang/conditional_types.h
include/fennec/lang/intrinsics.h
include/fennec/lang/limits.h
include/fennec/lang/numeric_transforms.h
include/fennec/lang/sequences.h
include/fennec/lang/type_traits.h
include/fennec/lang/type_transforms.h
include/fennec/lang/types.h
include/fennec/lang/utility.h
include/fennec/lang/variadics.h
include/fennec/lang/detail/__numeric_transforms.h
include/fennec/lang/detail/__type_traits.h
@@ -35,9 +39,11 @@ add_library(fennec STATIC
include/fennec/memory/allocator.h
include/fennec/memory/bits.h
include/fennec/memory/memory.h
include/fennec/memory/new.h
include/fennec/memory/new.h source/memory/new.cpp
include/fennec/memory/pointers.h
include/fennec/memory/ptr_traits.h
source/memory/new.cpp
include/fennec/memory/detail/__ptr_traits.h
# MATH =================================================================================================================
@@ -65,21 +71,30 @@ add_library(fennec STATIC
include/fennec/math/detail/__types.h
include/fennec/math/detail/__vector_traits.h
include/fennec/lang/detail/__variadics.h
)
add_subdirectory(metaprogramming)
# add metaprogramming templates as a dependency and also force documentation to be generated when fennec is compiled
add_dependencies(fennec fennecdocs metaprogramming)
# Compiler Warning Flags
if(MSVC)
add_compile_options("/W4" "/WX")
add_compile_options("/W4" "/WX") # All MSVC Warnings throw as Errors
else()
add_compile_options("-Wall" "-Wextra" "-pedantic" "-Werror")
add_compile_options("-Wall" "-Wextra" "-pedantic" "-Werror") # All gcc/etc. Warnings throw as errors
endif()
target_compile_options(fennec PUBLIC "-mavx" "-mavx2" "-mavx512f")
target_link_options(fennec PRIVATE "-nostdlib" "-nocstdlib")
#target_compile_options(fennec PUBLIC "-mavx" "-mavx2" "-mavx512f") # SIMD Instructions, currently unused
target_link_options(fennec PRIVATE "-nostdlib") # Do not compile base fennec library with c++ stdlib
# fennec does not use the C++ stdlib because it is bloated, difficult to read, and implementation defined.
# This implementation is designed to be as readable as possible, and expose information that would otherwise be obfuscated
# add the test suite as a sub-project
add_subdirectory(test)
@@ -90,20 +105,21 @@ add_subdirectory(test)
find_package(Doxygen)
if(DOXYGEN_FOUND)
get_filename_component(DOXYGEN_PROJECT_NAME ${PROJECT_SOURCE_DIR} NAME)
set(DOXYGEN_CONFIG_IN "${PROJECT_SOURCE_DIR}/doxy/Doxyfile.in")
set(DOXYGEN_CONFIG_OUT "${PROJECT_SOURCE_DIR}/doxy/Doxyfile")
get_filename_component(DOXYGEN_PROJECT_NAME ${PROJECT_SOURCE_DIR} NAME) # Set Doxy Project name to the name of the root dir
set(DOXYGEN_CONFIG_IN "${PROJECT_SOURCE_DIR}/doxy/Doxyfile.in") # Input config file with preprocessor arguments
set(DOXYGEN_CONFIG_OUT "${PROJECT_SOURCE_DIR}/doxy/Doxyfile") # Generated config file from input
configure_file(${DOXYGEN_CONFIG_IN} ${DOXYGEN_CONFIG_OUT} @ONLY)
configure_file(${DOXYGEN_CONFIG_IN} ${DOXYGEN_CONFIG_OUT} @ONLY) # Execute preprocessing step
message("Doxygen Build Started.")
# Target for building docs
add_custom_target(fennecdocs ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG_OUT}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating Doxygen Documentation"
VERBATIM)
# Target for cleaning docs
add_custom_target(fennecdocs-clean ALL
COMMAND rm -r "${PROJECT_SOURCE_DIR}/docs/"
COMMENT "Cleaning Doxygen Documentation"