Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_INT64 "Enable 64bit integer support. OFF means autodetect." OFF)

set(UNITY_EXTENSION_FIXTURE_ENABLED $<BOOL:${UNITY_EXTENSION_FIXTURE}>)
set(UNITY_EXTENSION_MEMORY_ENABLED $<OR:${UNITY_EXTENSION_FIXTURE_ENABLED},$<BOOL:${UNITY_EXTENSION_MEMORY}>>)
Expand All @@ -56,6 +57,10 @@ if(${UNITY_EXTENSION_MEMORY})
message(STATUS "Unity: Building with the memory extension.")
endif()

if(${UNITY_SUPPORT_INT64})
message(STATUS "Unity: Building with 64bit integer support.")
endif()

# Main target ------------------------------------------------------------------
add_library(${PROJECT_NAME} STATIC)
add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME})
Expand Down Expand Up @@ -89,6 +94,11 @@ set(${PROJECT_NAME}_PUBLIC_HEADERS
$<$<BOOL:${UNITY_EXTENSION_MEMORY_ENABLED}>:${CMAKE_CURRENT_SOURCE_DIR}/extras/memory/src/unity_memory.h>
)

target_compile_definitions(${PROJECT_NAME}
PUBLIC
$<$<BOOL:${UNITY_SUPPORT_INT64}>:UNITY_SUPPORT_64>
)

set_target_properties(${PROJECT_NAME}
PROPERTIES
C_STANDARD 11
Expand Down
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ project('unity', 'c',
build_fixture = get_option('extension_fixture')
build_memory = get_option('extension_memory')
support_double = get_option('support_double')
support_int64 = get_option('support_int64')
fixture_help_message = get_option('fixture_help_message')

unity_args = []
Expand All @@ -51,6 +52,10 @@ if support_double
unity_args += '-DUNITY_INCLUDE_DOUBLE'
endif

if support_int64
unity_args += '-DUNITY_SUPPORT_64'
endif

unity_lib = static_library(meson.project_name(),
sources: unity_src,
c_args: unity_args,
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
option('extension_fixture', type: 'boolean', value: false, description: 'Whether to enable the fixture extension.')
option('extension_memory', type: 'feature', value: 'auto', description: 'Whether to enable the memory extension. By default this is automatically enabled when extension_fixture is enabled.')
option('support_double', type: 'boolean', value: false, description: 'Whether to enable double precision floating point assertions.')
option('support_int64', type: 'boolean', value: false, description: 'Whether to enable support for 64bit integers. false means autodetect.')
option('fixture_help_message', type: 'string', description: 'If the fixture extension is enabled, this allows a custom help message to be defined.')