diff --git a/CMakeLists.txt b/CMakeLists.txt index f7062199..1e20b88b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ project(unity # Options to Build With Extras ------------------------------------------------- option(UNITY_EXTENSION_FIXTURE "Compiles Unity with the \"fixture\" extension." OFF) option(UNITY_EXTENSION_MEMORY "Compiles Unity with the \"memory\" extension." OFF) +option(UNITY_SUPPORT_DOUBLE "Enable double precision support in Unity." OFF) set(UNITY_EXTENSION_FIXTURE_ENABLED $) set(UNITY_EXTENSION_MEMORY_ENABLED $>) @@ -56,6 +57,10 @@ if(${UNITY_EXTENSION_MEMORY}) message(STATUS "Unity: Building with the memory extension.") endif() +if(${UNITY_SUPPORT_DOUBLE}) + message(STATUS "Unity: Building with double precision support.") +endif() + # Main target ------------------------------------------------------------------ add_library(${PROJECT_NAME} STATIC) add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME}) @@ -71,6 +76,11 @@ target_sources(${PROJECT_NAME} $<$:extras/memory/src/unity_memory.c> ) +target_compile_definitions(${PROJECT_NAME} + PUBLIC + $<$:UNITY_SUPPORT_DOUBLE> +) + target_include_directories(${PROJECT_NAME} PUBLIC $