mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-06-05 21:15:22 +00:00
cmake: Add option for UNITY_SUPPORT64
This commit is contained in:
@@ -44,6 +44,7 @@ project(unity
|
|||||||
# Options to Build With Extras -------------------------------------------------
|
# Options to Build With Extras -------------------------------------------------
|
||||||
option(UNITY_EXTENSION_FIXTURE "Compiles Unity with the \"fixture\" extension." OFF)
|
option(UNITY_EXTENSION_FIXTURE "Compiles Unity with the \"fixture\" extension." OFF)
|
||||||
option(UNITY_EXTENSION_MEMORY "Compiles Unity with the \"memory\" 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_FIXTURE_ENABLED $<BOOL:${UNITY_EXTENSION_FIXTURE}>)
|
||||||
set(UNITY_EXTENSION_MEMORY_ENABLED $<OR:${UNITY_EXTENSION_FIXTURE_ENABLED},$<BOOL:${UNITY_EXTENSION_MEMORY}>>)
|
set(UNITY_EXTENSION_MEMORY_ENABLED $<OR:${UNITY_EXTENSION_FIXTURE_ENABLED},$<BOOL:${UNITY_EXTENSION_MEMORY}>>)
|
||||||
@@ -56,6 +57,10 @@ if(${UNITY_EXTENSION_MEMORY})
|
|||||||
message(STATUS "Unity: Building with the memory extension.")
|
message(STATUS "Unity: Building with the memory extension.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${UNITY_SUPPORT_INT64})
|
||||||
|
message(STATUS "Unity: Building with 64bit integer support.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Main target ------------------------------------------------------------------
|
# Main target ------------------------------------------------------------------
|
||||||
add_library(${PROJECT_NAME} STATIC)
|
add_library(${PROJECT_NAME} STATIC)
|
||||||
add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME})
|
add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME})
|
||||||
@@ -89,6 +94,11 @@ set(${PROJECT_NAME}_PUBLIC_HEADERS
|
|||||||
$<$<BOOL:${UNITY_EXTENSION_MEMORY_ENABLED}>:${CMAKE_CURRENT_SOURCE_DIR}/extras/memory/src/unity_memory.h>
|
$<$<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}
|
set_target_properties(${PROJECT_NAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
C_STANDARD 11
|
C_STANDARD 11
|
||||||
|
|||||||
Reference in New Issue
Block a user