Implement fixed size options for rotgen containers

See merge request oss/rotgen!11
This commit is contained in:
Joel Falcou 2025-07-20 20:23:51 +02:00
parent 8e545dd51a
commit 2084874b1b
39 changed files with 1247 additions and 323 deletions

View file

@ -25,13 +25,30 @@ if (${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
message(FATAL_ERROR "[${PROJECT_NAME}]: In-source build is not supported")
endif()
##======================================================================================================================
## Handle options
##======================================================================================================================
option(ROTGEN_FORCE_DYNAMIC "Force dynamic configuration for rotgen" OFF)
option(ROTGEN_DISABLE_EXPRESSION_TEMPLATES "Disable expression templates" OFF)
set(ROTGEN_MAX_SIZE "" CACHE STRING "Max matrix number of elements for rotgen (integer)")
include(${ROTGEN_SOURCE_DIR}/cmake/options.cmake)
handle_option(ROTGEN_COMPILE_DEFS)
##======================================================================================================================
## Sources & Public Headers lists
##======================================================================================================================
set ( SOURCES
src/matrix.cpp
src/block.cpp
)
if(ROTGEN_FORCE_DYNAMIC)
set ( SOURCES
src/matrix.cpp
src/block.cpp
src/info.cpp
)
else()
set ( SOURCES
src/info.cpp
)
endif()
##======================================================================================================================
## Setup the library's dependencies
@ -46,6 +63,7 @@ set_target_properties(rotgen PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(rotgen PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
target_compile_options(rotgen PUBLIC -std=c++20 -Werror -Wall -Wextra -Wshadow -Wunused-variable)
target_compile_definitions(rotgen PUBLIC ${ROTGEN_COMPILE_DEFS})
set_target_properties(rotgen PROPERTIES EXPORT_NAME rotgen)
add_library(rotgen::rotgen ALIAS rotgen)