Skip to content

Commit d3d348f

Browse files
authored
Merge pull request #823 from Dariqq/UNITY_SUPPORT64
Add option for UNITY_SUPPORT_64
2 parents cdfc44e + 29451d6 commit d3d348f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ project(unity
4444
# Options to Build With Extras -------------------------------------------------
4545
option(UNITY_EXTENSION_FIXTURE "Compiles Unity with the \"fixture\" extension." OFF)
4646
option(UNITY_EXTENSION_MEMORY "Compiles Unity with the \"memory\" extension." OFF)
47+
option(UNITY_SUPPORT_INT64 "Enable 64bit integer support. OFF means autodetect." OFF)
4748

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

60+
if(${UNITY_SUPPORT_INT64})
61+
message(STATUS "Unity: Building with 64bit integer support.")
62+
endif()
63+
5964
# Main target ------------------------------------------------------------------
6065
add_library(${PROJECT_NAME} STATIC)
6166
add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME})
@@ -89,6 +94,11 @@ set(${PROJECT_NAME}_PUBLIC_HEADERS
8994
$<$<BOOL:${UNITY_EXTENSION_MEMORY_ENABLED}>:${CMAKE_CURRENT_SOURCE_DIR}/extras/memory/src/unity_memory.h>
9095
)
9196

97+
target_compile_definitions(${PROJECT_NAME}
98+
PUBLIC
99+
$<$<BOOL:${UNITY_SUPPORT_INT64}>:UNITY_SUPPORT_64>
100+
)
101+
92102
set_target_properties(${PROJECT_NAME}
93103
PROPERTIES
94104
C_STANDARD 11

meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ project('unity', 'c',
2626
build_fixture = get_option('extension_fixture')
2727
build_memory = get_option('extension_memory')
2828
support_double = get_option('support_double')
29+
support_int64 = get_option('support_int64')
2930
fixture_help_message = get_option('fixture_help_message')
3031

3132
unity_args = []
@@ -51,6 +52,10 @@ if support_double
5152
unity_args += '-DUNITY_INCLUDE_DOUBLE'
5253
endif
5354

55+
if support_int64
56+
unity_args += '-DUNITY_SUPPORT_64'
57+
endif
58+
5459
unity_lib = static_library(meson.project_name(),
5560
sources: unity_src,
5661
c_args: unity_args,

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
option('extension_fixture', type: 'boolean', value: false, description: 'Whether to enable the fixture extension.')
22
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.')
33
option('support_double', type: 'boolean', value: false, description: 'Whether to enable double precision floating point assertions.')
4+
option('support_int64', type: 'boolean', value: false, description: 'Whether to enable support for 64bit integers. false means autodetect.')
45
option('fixture_help_message', type: 'string', description: 'If the fixture extension is enabled, this allows a custom help message to be defined.')

0 commit comments

Comments
 (0)