From a45ea7c17b4a7f320e199b71436074bd624c9e15 Mon Sep 17 00:00:00 2001 From: Nikolay Baklicharov Date: Wed, 19 Mar 2025 00:30:39 +0200 Subject: [PATCH] CMake: Fix Apple Mobile platforms detection --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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