diff --git a/CMakeLists.txt b/CMakeLists.txt index d07a127..eb7b935 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,16 @@ target_sources( date INTERFACE $$/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 $$/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