mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-01 03:34:26 +02:00
CMake: Fix Apple Mobile platforms detection
This commit is contained in:
committed by
Howard Hinnant
parent
0b336657b1
commit
a45ea7c17b
@@ -81,6 +81,16 @@ target_sources( date INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>/date/julian.h
|
||||
)
|
||||
|
||||
set( APPLE_MOBILE_PLATFORM FALSE )
|
||||
if ( IOS
|
||||
OR CMAKE_SYSTEM_NAME STREQUAL "iOS"
|
||||
OR CMAKE_SYSTEM_NAME STREQUAL "visionOS"
|
||||
OR CMAKE_SYSTEM_NAME STREQUAL "watchOS"
|
||||
OR CMAKE_SYSTEM_NAME STREQUAL "tvOS"
|
||||
)
|
||||
set( APPLE_MOBILE_PLATFORM TRUE )
|
||||
endif()
|
||||
|
||||
set(TARGET_HEADERS
|
||||
include/date/date.h
|
||||
include/date/solar_hijri.h
|
||||
@@ -127,7 +137,7 @@ if( BUILD_TZ_LIB )
|
||||
PRIVATE
|
||||
include/date/tz_private.h
|
||||
src/tz.cpp )
|
||||
if ( IOS )
|
||||
if ( APPLE_MOBILE_PLATFORM )
|
||||
target_sources( date-tz
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>/date/ios.h
|
||||
@@ -158,7 +168,7 @@ if( BUILD_TZ_LIB )
|
||||
|
||||
set(TZ_HEADERS include/date/tz.h)
|
||||
|
||||
if( IOS )
|
||||
if( APPLE_MOBILE_PLATFORM )
|
||||
list(APPEND TZ_HEADERS include/date/ios.h)
|
||||
endif( )
|
||||
set_target_properties( date-tz PROPERTIES
|
||||
|
Reference in New Issue
Block a user