Skip to content

Commit 29451d6

Browse files
committed
cmake: Add option for UNITY_SUPPORT64
1 parent 4d35efd commit 29451d6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)