@ -37,7 +37,7 @@
# A N Y W A Y O U T O F T H E U S E O F T H I S S O F T W A R E , E V E N I F A D V I S E D O F T H E
# P O S S I B I L I T Y O F S U C H D A M A G E .
#
# T h i s f i l e i s b a s e d o f f o f t h e P l a t f o r m / D a r w i n . c m a k e a n d
# T h i s f i l e i s b a s e d o n t h e P l a t f o r m / D a r w i n . c m a k e a n d
# P l a t f o r m / U n i x P a t h s . c m a k e f i l e s w h i c h a r e i n c l u d e d w i t h C M a k e 2 . 8 . 4
# I t h a s b e e n a l t e r e d f o r i O S d e v e l o p m e n t .
#
@ -51,47 +51,61 @@
#
# I N F O R M A T I O N / H E L P
#
# T h e f o l l o w i n g o p t i o n s c o n t r o l t h e b e h a v i o u r o f t h i s t o o l c h a i n :
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# O P T I O N S #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# P L A T F O R M : ( d e f a u l t " O S 6 4 " )
# O S = B u i l d f o r i P h o n e O S .
# O S 6 4 = B u i l d f o r a r m 6 4 i p h o n e O S .
# O S 6 4 C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 i p h o n e O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMakewith "-G Xcode" argument ONLY )
# O S 6 4 C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 i p h o n e O S + i p h o n e O S S i m u l a t o r . C o m b i n e d i n t o F A T S T A T I C lib ( only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step )
# S I M U L A T O R = B u i l d f o r x 8 6 i 3 8 6 i p h o n e O S S i m u l a t o r .
# S I M U L A T O R 6 4 = B u i l d f o r x 8 6 _ 6 4 i p h o n e O S S i m u l a t o r .
# S I M U L A T O R A R M 6 4 = B u i l d f o r a r m 6 4 i p h o n e O S S i m u l a t o r .
# S I M U L A T O R 6 4 C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 i p h o n e O S S i m u l a t o r . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMakewith "-G Xcode" argument ONLY )
# T V O S = B u i l d f o r a r m 6 4 t v O S .
# T V O S C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 t v O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMake with "-G Xcode" argument ONLY )
# T V O S C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 t v O S + t v O S S i m u l a t o r . C o m b i n e d i n t o F A T S T A T I C lib ( only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step )
# S I M U L A T O R _ T V O S = B u i l d f o r x 8 6 _ 6 4 t v O S S i m u l a t o r .
# S I M U L A T O R A R M 6 4 _ T V O S = B u i l d f o r a r m 6 4 t v O S S i m u l a t o r .
# V I S I O N O S C O M B I N E D = B u i l d f o r a r m 6 4 v i s i o n O S + v i s i o n O S S i m u l a t o r . C o m b i n e d i n t o F A T S T A T I C lib ( only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step )
# V I S I O N O S = B u i l d f o r a r m 6 4 v i s i o n O S .
# S I M U L A T O R _ V I S I O N O S = B u i l d f o r a r m 6 4 v i s i o n O S S i m u l a t o r .
# W A T C H O S = B u i l d f o r a r m v 7 k a r m 6 4 _ 3 2 f o r w a t c h O S .
# W A T C H O S C O M B I N E D = B u i l d f o r a r m v 7 k a r m 6 4 _ 3 2 x 8 6 _ 6 4 w a t c h O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMake with "-G Xcode" argument ONLY )
# W A T C H O S C O M B I N E D = B u i l d f o r a r m v 7 k a r m 6 4 _ 3 2 x 8 6 _ 6 4 w a t c h O S + w a t c h O S S i m u l a t o r . C o m b i n e d i n t o F A T S T A T I C lib ( only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step )
# S I M U L A T O R _ W A T C H O S = B u i l d f o r x 8 6 _ 6 4 f o r w a t c h O S S i m u l a t o r .
# S I M U L A T O R A R M 6 4 _ W A T C H O S = B u i l d f o r a r m 6 4 f o r w a t c h O S S i m u l a t o r .
# M A C = B u i l d f o r x 8 6 _ 6 4 m a c O S .
# M A C _ A R M 6 4 = B u i l d f o r A p p l e S i l i c o n m a c O S .
# M A C _ U N I V E R S A L = C o m b i n e d b u i l d f o r x 8 6 _ 6 4 a n d A p p l e S i l i c o n o n m a c O S .
# M A C _ C A T A L Y S T = B u i l d f o r x 8 6 _ 6 4 m a c O S w i t h C a t a l y s t support ( iOS toolchain on macOS ) .
# N o t e : T h e b u i l d a r g u m e n t " M A C O S X _ D E P L O Y M E N T _ T A R G E T " c a n b e u s e d t o c o n t r o l m i n - v e r s i o n o f m a c O S
# M A C _ C A T A L Y S T _ A R M 6 4 = B u i l d f o r A p p l e S i l i c o n m a c O S w i t h C a t a l y s t support ( iOS toolchain on macOS ) .
# N o t e : T h e b u i l d a r g u m e n t " M A C O S X _ D E P L O Y M E N T _ T A R G E T " c a n b e u s e d t o c o n t r o l m i n - v e r s i o n o f m a c O S
# M A C _ C A T A L Y S T _ U N I V E R S A L = C o m b i n e d b u i l d f o r x 8 6 _ 6 4 a n d A p p l e S i l i c o n o n C a t a l y s t .
#
# C M A K E _ O S X _ S Y S R O O T : P a t h t o t h e S D K t o u s e . B y d e f a u l t t h i s i s
# a u t o m a t i c a l l y d e t e r m i n e d f r o m P L A T F O R M a n d x c o d e b u i l d , b u t
# c a n a l s o b e m a n u a l l y specified ( although this should not be required ) .
#
# C M A K E _ D E V E L O P E R _ R O O T : P a t h t o t h e D e v e l o p e r d i r e c t o r y f o r t h e p l a t f o r m
# b e i n g c o m p i l e d f o r . B y d e f a u l t t h i s i s a u t o m a t i c a l l y d e t e r m i n e d f r o m
# b e i n g c o m p i l e d f o r . B y d e f a u l t , t h i s i s a u t o m a t i c a l l y d e t e r m i n e d f r o m
# C M A K E _ O S X _ S Y S R O O T , b u t c a n a l s o b e m a n u a l l y specified ( although this should
# n o t b e r e q u i r e d ) .
#
# D E P L O Y M E N T _ T A R G E T : M i n i m u m S D K v e r s i o n t o t a r g e t . D e f a u l t 2 . 0 o n w a t c h O S a n d 9 . 0 o n t v O S + i O S
# D E P L O Y M E N T _ T A R G E T : M i n i m u m S D K v e r s i o n t o t a r g e t . D e f a u l t 6 . 0 o n w a t c h O S , 1 3 . 0 o n t v O S + i O S / i P a d O S , 1 1 . 0 o n m a c O S , 1 . 0 o n v i s i o n O S
#
# N A M E D _ L A N G U A G E _ S U P P O R T :
# ON ( default ) = W i l l r e q u i r e " enable_language ( OBJC ) a n d / o r enable_language ( OBJCXX ) " f o r f u l l O B J C | O B J C X X s u p p o r t
# O F F = W i l l e m b e d t h e O B J C a n d O B J C X X f l a g s i n t o t h e C M A K E _ C _ F L A G S a n d CMAKE_CXX_FLAGS ( legacy behavior, CMake version < 3.16 )
#
# E N A B L E _ B I T C O D E : ( 1 | 0 ) E n a b l e s o r d i s a b l e s b i t c o d e s u p p o r t . D e f a u l t 1 ( true )
# E N A B L E _ B I T C O D E : ( O N | O F F ) E n a b l e s o r d i s a b l e s b i t c o d e s u p p o r t . D e f a u l t O F F
#
# E N A B L E _ A R C : ( 1 | 0 ) E n a b l e s o r d i s a b l e s A R C s u p p o r t . D e f a u l t 1 ( true, ARC enabled by default )
# E N A B L E _ A R C : ( O N | O F F ) E n a b l e s o r d i s a b l e s A R C s u p p o r t . D e f a u l t ON ( ARC enabled by default )
#
# E N A B L E _ V I S I B I L I T Y : ( 1 | 0 ) E n a b l e s o r d i s a b l e s s y m b o l v i s i b i l i t y s u p p o r t . D e f a u l t 0 ( false, visibility hidden by default )
# E N A B L E _ V I S I B I L I T Y : ( O N | O F F ) E n a b l e s o r d i s a b l e s s y m b o l v i s i b i l i t y s u p p o r t . D e f a u l t OFF ( visibility hidden by default )
#
# E N A B L E _ S T R I C T _ T R Y _ C O M P I L E : ( 1 | 0 ) E n a b l e s o r d i s a b l e s s t r i c t try_compile ( ) o n a l l C h e c k * directives ( will run linker
# t o a c t u a l l y c h e c k i f l i n k i n g i s p o s s i b l e ) . D e f a u l t 0 ( false, will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY )
# E N A B L E _ S T R I C T _ T R Y _ C O M P I L E : ( O N | O F F ) E n a b l e s o r d i s a b l e s s t r i c t try_compile ( ) o n a l l C h e c k * directives ( will run linker
# t o a c t u a l l y c h e c k i f l i n k i n g i s p o s s i b l e ) . D e f a u l t OFF ( will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY )
#
# A R C H S : ( a r m v 7 a r m v 7 s a r m v 7 k a r m 6 4 a r m 6 4 _ 3 2 i 3 8 6 x 8 6 _ 6 4 ) I f s p e c i f i e d , w i l l o v e r r i d e t h e d e f a u l t a r c h i t e c t u r e s f o r t h e g i v e n P L A T F O R M
# O S = a r m v 7 a r m v 7 s arm64 ( if applicable )
@ -101,12 +115,22 @@
# S I M U L A T O R A R M 6 4 = a r m 6 4
# T V O S = a r m 6 4
# S I M U L A T O R _ T V O S = x86_64 ( i386 has since long been deprecated )
# S I M U L A T O R A R M 6 4 _ T V O S = a r m 6 4
# W A T C H O S = a r m v 7 k arm64_32 ( if applicable )
# S I M U L A T O R _ W A T C H O S = x86_64 ( i386 has since long been deprecated )
# S I M U L A T O R A R M 6 4 _ W A T C H O S = a r m 6 4
# M A C = x 8 6 _ 6 4
# M A C _ A R M 6 4 = a r m 6 4
# M A C _ U N I V E R S A L = x 8 6 _ 6 4 a r m 6 4
# M A C _ C A T A L Y S T = x 8 6 _ 6 4
# M A C _ C A T A L Y S T _ A R M 6 4 = a r m 6 4
# M A C _ C A T A L Y S T _ U N I V E R S A L = x 8 6 _ 6 4 a r m 6 4
#
# N O T E : W h e n m a n u a l l y s p e c i f y i n g A R C H S , p u t a s e m i - c o l o n b e t w e e n t h e e n t r i e s . E . g . , - D A R C H S = " a r m v 7 ; a r m 6 4 "
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# E N D O P T I O N S #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# T h i s t o o l c h a i n d e f i n e s t h e f o l l o w i n g properties ( available via get_property( ) ) f o r u s e e x t e r n a l l y :
#
@ -114,7 +138,7 @@
# X C O D E _ V E R S I O N : V e r s i o n number ( not including Build version ) o f X c o d e d e t e c t e d .
# S D K _ V E R S I O N : V e r s i o n o f S D K b e i n g u s e d .
# O S X _ A R C H I T E C T U R E S : A r c h i t e c t u r e s b e i n g c o m p i l e d for ( generated from PLATFORM ) .
# A P P L E _ T A R G E T _ T R I P L E : U s e d b y a u t o c o n f b u i l d s y s t e m s . N O T E : I f " A R C H S " a r e o v e r r i d d e n , t h i s w i l l * N O T * b e s e t !
# A P P L E _ T A R G E T _ T R I P L E : U s e d b y a u t o c o n f b u i l d s y s t e m s . N O T E : I f " A R C H S " i s o v e r r i d d e n , t h i s w i l l * N O T * b e s e t !
#
# T h i s t o o l c h a i n d e f i n e s t h e f o l l o w i n g m a c r o s f o r u s e e x t e r n a l l y :
#
@ -132,28 +156,20 @@
cmake_minimum_required ( VERSION 3.8.0 )
# C M a k e i n v o k e s t h e t o o l c h a i n f i l e t w i c e d u r i n g t h e f i r s t b u i l d , b u t o n l y o n c e d u r i n g s u b s e q u e n t r e b u i l d s .
if ( DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN} )
# N O T E : T o i m p r o v e s i n g l e - l i b r a r y b u i l d - t i m e s , p r o v i d e t h e f l a g " O S _ S I N G L E _ B U I L D " a s a b u i l d a r g u m e n t .
if ( DEFINED OS_SINGLE_BUILD AND DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN} )
return ( )
endif ( )
set ( ENV{_IOS_TOOLCHAIN_HAS_RUN} true )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# O P T I O N S #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
option ( DROP_32_BIT "Drops the 32-bit targets universally." YES )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# E N D O P T I O N S #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# L i s t o f s u p p o r t e d p l a t f o r m v a l u e s
list ( APPEND _supported_platforms
" O S " " O S 6 4 " " O S 6 4 C O M B I N E D " " S I M U L A T O R " " S I M U L A T O R 6 4 " " S I M U L A T O R A R M 6 4 "
" T V O S " " T V O S C O M B I N E D " " S I M U L A T O R _ T V O S "
" W A T C H O S " " W A T C H O S C O M B I N E D " " S I M U L A T O R _ W A T C H O S "
" M A C " " M A C _ A R M 6 4 "
" M A C _ C A T A L Y S T " " M A C _ C A T A L Y S T _ A R M 6 4 " )
" O S " " O S 6 4 " " O S 6 4 C O M B I N E D " " S I M U L A T O R " " S I M U L A T O R 6 4 " " S I M U L A T O R A R M 6 4 " " S I M U L A T O R 6 4 C O M B I N E D "
" T V O S " " T V O S C O M B I N E D " " S I M U L A T O R _ T V O S " " S I M U L A T O R A R M 6 4 _ T V O S "
" W A T C H O S " " W A T C H O S C O M B I N E D " " S I M U L A T O R _ W A T C H O S " " S I M U L A T O R A R M 6 4 _ W A T C H O S "
" M A C " " M A C _ A R M 6 4 " " M A C _ U N I V E R S A L "
" V I S I O N O S " " S I M U L A T O R _ V I S I O N O S " " V I S I O N O S C O M B I N E D "
" M A C _ C A T A L Y S T " " M A C _ C A T A L Y S T _ A R M 6 4 " " M A C _ C A T A L Y S T _ U N I V E R S A L " )
# C a c h e w h a t g e n e r a t o r i s u s e d
set ( USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" )
@ -165,9 +181,9 @@ endif()
# G e t t h e X c o d e v e r s i o n b e i n g u s e d .
# P r o b l e m : C M a k e r u n s t o o l c h a i n f i l e s m u l t i p l e t i m e s , b u t c a n ' t r e a d c a c h e v a r i a b l e s o n s o m e r u n s .
# W o r k a r o u n d : O n f i r s t run ( in which cache variables are always accessible ) , s e t a n i n t e r m e d i a r y e n v i r o n m e n t v a r i a b l e .
# W o r k a r o u n d : O n t h e f i r s t run ( in which cache variables are always accessible ) , s e t a n i n t e r m e d i a r y e n v i r o n m e n t v a r i a b l e .
#
# N O T E : T h i s p a t t e r n i s u s e d i m a n y p l a c e s i n t h i s t o o l c h a i n t o s p e e d u p c h e c k s o f a l l s o r t s
# N O T E : T h i s p a t t e r n i s u s e d i n m a n y p l a c e s i n t h i s t o o l c h a i n t o s p e e d u p c h e c k s o f a l l s o r t s
if ( DEFINED XCODE_VERSION_INT )
# E n v i r o n m e n t v a r i a b l e s a r e a l w a y s p r e s e r v e d .
set ( ENV{_XCODE_VERSION_INT} "${XCODE_VERSION_INT}" )
@ -189,10 +205,10 @@ endif()
# A s s u m i n g t h a t x c o d e 1 2 . 0 i s i n s t a l l e d y o u m o s t p r o b a b l y h a v e i o s s d k 1 4 . 0 o r l a t e r installed ( tested on Big Sur )
# i f y o u d o n ' t s e t a d e p l o y m e n t t a r g e t i t w i l l b e s e t t h e w a y y o u o n l y g e t 6 4 - b i t b u i l d s
if ( NOT DEFINED DEPLOYMENT_TARGET AND XCODE_VERSION_INT VERSION_GREATER 12.0 )
# T e m p o r a r i l y f i x t h e a r m 6 4 i s s u e s i n C M a k e i n s t a l l - c o m b i n e d b y e x c l u d i n g a r m 6 4 f o r s i m u l a t o r builds ( needed for Apple Silicon... )
set ( CMAKE_XCODE_ATTRIBUTE_EXCLUDED_ARCHS[sdk=iphonesimulator*] "arm64" )
endif ( )
# if ( NOT DEFINED DEPLOYMENT_TARGET AND XCODE_VERSION_INT VERSION_GREATER 12.0 )
# T e m p o r a r i l y f i x t h e a r m 6 4 i s s u e s i n C M a k e i n s t a l l - c o m b i n e d b y e x c l u d i n g a r m 6 4 f o r s i m u l a t o r builds ( needed for Apple Silicon... )
# set ( CMAKE_XCODE_ATTRIBUTE_EXCLUDED_ARCHS[sdk=iphonesimulator*] "arm64" )
# endif ( )
# C h e c k i f t h e p l a t f o r m v a r i a b l e i s s e t
if ( DEFINED PLATFORM )
@ -205,7 +221,7 @@ elseif(NOT DEFINED PLATFORM)
endif ( )
if ( PLATFORM MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode" )
message ( FATAL_ERROR "The combined builds support requires Xcode to be used as generator via '-G Xcode' command-line argument in CMake" )
message ( FATAL_ERROR "The combined builds support requires Xcode to be used as a generator via '-G Xcode' command-line argument in CMake" )
endif ( )
# S a f e g u a r d t h a t t h e p l a t f o r m v a l u e i s s e t a n d i s o n e o f t h e s u p p o r t e d v a l u e s
@ -217,11 +233,11 @@ if("${contains_PLATFORM}" EQUAL "-1")
endif ( )
# C h e c k i f A p p l e S i l i c o n i s s u p p o r t e d
if ( PLATFORM MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$" AND ${ CMAKE_VERSION } VERSION_LESS "3.19.5" )
if ( PLATFORM MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$|^(MAC_UNIVERSAL)$|^(MAC_CATALYST_UNIVERSAL)$ " AND ${ CMAKE_VERSION } VERSION_LESS "3.19.5" )
message ( FATAL_ERROR "Apple Silicon builds requires a minimum of CMake 3.19.5" )
endif ( )
# T o u c h t o o l c h a i n v a r i a b l e t o s u p p r e s s " u n u s e d v a r i a b l e " w a r n i n g .
# T o u c h t h e t o o l c h a i n v a r i a b l e t o s u p p r e s s t h e " u n u s e d v a r i a b l e " w a r n i n g .
# T h i s h a p p e n s i f C M a k e i s i n v o k e d w i t h t h e s a m e c o m m a n d l i n e t h e s e c o n d t i m e .
if ( CMAKE_TOOLCHAIN_FILE )
endif ( )
@ -232,27 +248,46 @@ set(CMAKE_HAVE_THREADS_LIBRARY 1)
set ( CMAKE_USE_WIN32_THREADS_INIT 0 )
set ( CMAKE_USE_PTHREADS_INIT 1 )
# S p e c i f y m i n i m u m v e r s i o n o f d e p l o y m e n t t a r g e t .
# S p e c i f y n a m e d l a n g u a g e s u p p o r t d e f a u l t s .
if ( NOT DEFINED NAMED_LANGUAGE_SUPPORT AND ${ CMAKE_VERSION } VERSION_GREATER_EQUAL "3.16" )
set ( NAMED_LANGUAGE_SUPPORT ON )
message ( STATUS "[DEFAULTS] Using explicit named language support! E.g., enable_language(CXX) is needed in the project files." )
elseif ( NOT DEFINED NAMED_LANGUAGE_SUPPORT AND ${ CMAKE_VERSION } VERSION_LESS "3.16" )
set ( NAMED_LANGUAGE_SUPPORT OFF )
message ( STATUS "[DEFAULTS] Disabling explicit named language support. Falling back to legacy behavior." )
elseif ( DEFINED NAMED_LANGUAGE_SUPPORT AND ${ CMAKE_VERSION } VERSION_LESS "3.16" )
message ( FATAL_ERROR "CMake named language support for OBJC and OBJCXX was added in CMake 3.16." )
endif ( )
set ( NAMED_LANGUAGE_SUPPORT_INT ${ NAMED_LANGUAGE_SUPPORT } CACHE BOOL
" W h e t h e r o r n o t t o e n a b l e e x p l i c i t n a m e d l a n g u a g e s u p p o r t " F O R C E )
# S p e c i f y t h e m i n i m u m v e r s i o n o f t h e d e p l o y m e n t t a r g e t .
if ( NOT DEFINED DEPLOYMENT_TARGET )
if ( PLATFORM MATCHES "WATCHOS" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 4 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( watchOS ) .
set ( DEPLOYMENT_TARGET "4.0" )
set ( DEPLOYMENT_TARGET "6 .0" )
elseif ( PLATFORM STREQUAL "MAC" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 0 . 13 ( High sierra ) i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( macos ) .
set ( DEPLOYMENT_TARGET "10.13" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 0 . 13 ( High Sierra ) i s u s e d b y d e f a u l t a s t h e m i n i m u m t a r g e t version ( macos ) .
set ( DEPLOYMENT_TARGET "11.0" )
elseif ( PLATFORM STREQUAL "VISIONOS" OR PLATFORM STREQUAL "SIMULATOR_VISIONOS" OR PLATFORM STREQUAL "VISIONOSCOMBINED" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( visionOS ) .
set ( DEPLOYMENT_TARGET "1.0" )
elseif ( PLATFORM STREQUAL "MAC_ARM64" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 1 . 0 ( Big Sur ) i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( macos on arm ) .
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 1 . 0 ( Big Sur ) i s u s e d b y d e f a u l t a s t h e m i n i m u m t a r g e t version ( macOS on arm ) .
set ( DEPLOYMENT_TARGET "11.0" )
elseif ( PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 3 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( mac catalyst minimum requirement ) .
set ( DEPLOYMENT_TARGET "13.0" )
else ( )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 1 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( iOS, tvOS ) .
elseif ( PLATFORM STREQUAL "MAC_UNIVERSAL" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 1 . 0 ( Big Sur ) i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t v e r s i o n f o r u n i v e r s a l b u i l d s .
set ( DEPLOYMENT_TARGET "11.0" )
elseif ( PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64" OR PLATFORM STREQUAL "MAC_CATALYST_UNIVERSAL" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 3 . 0 i s u s e d b y d e f a u l t a s t h e m i n i m u m t a r g e t version ( mac catalyst minimum requirement ) .
set ( DEPLOYMENT_TARGET "13.1" )
else ( )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 1 1 . 0 i s u s e d b y d e f a u l t a s t h e m i n i m u m t a r g e t version ( iOS, tvOS ) .
set ( DEPLOYMENT_TARGET "13.0" )
endif ( )
message ( STATUS "[DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!" )
elseif ( DEFINED DEPLOYMENT_TARGET AND PLATFORM MATCHES "^MAC_CATALYST" AND ${ DEPLOYMENT_TARGET } VERSION_LESS "13.0" )
message ( FATAL_ERROR "Mac Catalyst builds requires a minimum deployment target of 13.0!" )
elseif ( DEFINED DEPLOYMENT_TARGET AND PLATFORM MATCHES "^MAC_CATALYST" AND ${ DEPLOYMENT_TARGET } VERSION_LESS "13.1 " )
message ( FATAL_ERROR "Mac Catalyst builds requires a minimum deployment target of 13.1 !" )
endif ( )
# S t o r e t h e D E P L O Y M E N T _ T A R G E T i n t h e c a c h e
@ -279,19 +314,19 @@ if(PLATFORM_INT STREQUAL "OS")
set ( SDK_NAME iphoneos )
if ( NOT ARCHS )
set ( ARCHS armv7 armv7s arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm-apple-ios $ ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm-apple-ios ${ DEPLOYMENT_TARGET } )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } )
endif ( )
elseif ( PLATFORM_INT STREQUAL "OS64" )
set ( SDK_NAME iphoneos )
if ( NOT ARCHS )
if ( XCODE_VERSION_INT VERSION_GREATER 10.0 )
set ( ARCHS arm64 ) # A d d a r m 6 4 e w h e n A p p l e h a v e f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s u n g b i t c o d e m a r k e r s f o r e x a m p l e
set ( ARCHS arm64 ) # F I X M E : A d d a r m 6 4 e w h e n A p p l e h a s f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s i n g b i t c o d e m a r k e r s f o r e x a m p l e
else ( )
set ( ARCHS arm64 )
endif ( )
set ( APPLE_TARGET_TRIPLE_INT aarch 64-apple-ios ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64-apple-ios ${ DEPLOYMENT_TARGET } )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } )
endif ( )
@ -299,12 +334,12 @@ elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
set ( SDK_NAME iphoneos )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
if ( XCODE_VERSION_INT VERSION_GREATER 10 .0 )
set ( ARCHS arm64 x86_64 ) # A d d a r m 6 4 e w h e n A p p l e h a v e f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s u n g b i t c o d e m a r k e r s f o r e x a m p l e
if ( XCODE_VERSION_INT VERSION_GREATER 12 .0 )
set ( ARCHS arm64 x86_64 )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64 arm64 " )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64 arm64 " )
else ( )
set ( ARCHS arm64 x86_64 )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64" )
@ -312,13 +347,37 @@ elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64" )
endif ( )
set ( APPLE_TARGET_TRIPLE_INT aarch 64-x86_64-apple-ios ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64-x86_64-apple-ios ${ DEPLOYMENT_TARGET } )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR64COMBINED" )
set ( SDK_NAME iphonesimulator )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
if ( XCODE_VERSION_INT VERSION_GREATER 12.0 )
set ( ARCHS arm64 x86_64 ) # F I X M E : A d d a r m 6 4 e w h e n A p p l e h a v e f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s i n g b i t c o d e m a r k e r s f o r e x a m p l e
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64 arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64 arm64" )
else ( )
set ( ARCHS arm64 x86_64 )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64" )
endif ( )
set ( APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-ios ${ DEPLOYMENT_TARGET } -simulator )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the SIMULATOR64COMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR" )
set ( SDK_NAME iphonesimulator )
if ( NOT ARCHS )
@ -340,7 +399,7 @@ elseif(PLATFORM_INT STREQUAL "SIMULATORARM64")
set ( SDK_NAME iphonesimulator )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT aarch 64-apple-ios ${ DEPLOYMENT_TARGET } -simulator )
set ( APPLE_TARGET_TRIPLE_INT arm 64-apple-ios ${ DEPLOYMENT_TARGET } -simulator )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
@ -348,7 +407,7 @@ elseif(PLATFORM_INT STREQUAL "TVOS")
set ( SDK_NAME appletvos )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT aarch 64-apple-tvos ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64-apple-tvos ${ DEPLOYMENT_TARGET } )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-tvos ${ DEPLOYMENT_TARGET } )
endif ( )
@ -357,11 +416,11 @@ elseif (PLATFORM_INT STREQUAL "TVOSCOMBINED")
if ( MODERN_CMAKE )
if ( NOT ARCHS )
set ( ARCHS arm64 x86_64 )
set ( APPLE_TARGET_TRIPLE_INT aarch 64-x86_64-apple-tvos ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64-x86_64-apple-tvos ${ DEPLOYMENT_TARGET } )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvos*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvsimulator*] "x86_64" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvsimulator*] "x86_64 arm64 " )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvos*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvsimulator*] "x86_64" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvsimulator*] "x86_64 arm64 " )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-tvos ${ DEPLOYMENT_TARGET } )
endif ( )
@ -376,12 +435,20 @@ elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-tvos ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATORARM64_TVOS" )
set ( SDK_NAME appletvsimulator )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm64-apple-tvos ${ DEPLOYMENT_TARGET } -simulator )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-tvos ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
elseif ( PLATFORM_INT STREQUAL "WATCHOS" )
set ( SDK_NAME watchos )
if ( NOT ARCHS )
if ( XCODE_VERSION_INT VERSION_GREATER 10.0 )
set ( ARCHS armv7k arm64_32 )
set ( APPLE_TARGET_TRIPLE_INT aarch64_32-apple-watchos ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64_32-apple-watchos ${ DEPLOYMENT_TARGET } )
else ( )
set ( ARCHS armv7k )
set ( APPLE_TARGET_TRIPLE_INT arm-apple-watchos ${ DEPLOYMENT_TARGET } )
@ -395,7 +462,7 @@ elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED")
if ( NOT ARCHS )
if ( XCODE_VERSION_INT VERSION_GREATER 10.0 )
set ( ARCHS armv7k arm64_32 i386 )
set ( APPLE_TARGET_TRIPLE_INT aarch 64_32-i386-apple-watchos ${ DEPLOYMENT_TARGET } )
set ( APPLE_TARGET_TRIPLE_INT arm 64_32-i386-apple-watchos ${ DEPLOYMENT_TARGET } )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchos*] "armv7k arm64_32" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchsimulator*] "i386" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchos*] "armv7k arm64_32" )
@ -422,6 +489,44 @@ elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-watchos ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATORARM64_WATCHOS" )
set ( SDK_NAME watchsimulator )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm64-apple-watchos ${ DEPLOYMENT_TARGET } -simulator )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-watchos ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_VISIONOS" )
set ( SDK_NAME xrsimulator )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm64-apple-xros ${ DEPLOYMENT_TARGET } -simulator )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-xros ${ DEPLOYMENT_TARGET } -simulator )
endif ( )
elseif ( PLATFORM_INT STREQUAL "VISIONOS" )
set ( SDK_NAME xros )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm64-apple-xros ${ DEPLOYMENT_TARGET } )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-xros ${ DEPLOYMENT_TARGET } )
endif ( )
elseif ( PLATFORM_INT STREQUAL "VISIONOSCOMBINED" )
set ( SDK_NAME xros )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm64-apple-xros ${ DEPLOYMENT_TARGET } )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=xros*] "arm64" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=xrsimulator*] "arm64" )
else ( )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-xros ${ DEPLOYMENT_TARGET } )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the VISIONOSCOMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "MAC" OR PLATFORM_INT STREQUAL "MAC_CATALYST" )
set ( SDK_NAME macosx )
if ( NOT ARCHS )
@ -444,10 +549,26 @@ elseif(PLATFORM_INT MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$")
elseif ( PLATFORM_INT STREQUAL "MAC_CATALYST_ARM64" )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } -macabi )
endif ( )
elseif ( PLATFORM_INT STREQUAL "MAC_UNIVERSAL" )
set ( SDK_NAME macosx )
if ( NOT ARCHS )
set ( ARCHS "x86_64;arm64" )
endif ( )
string ( REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}" )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-macosx ${ DEPLOYMENT_TARGET } )
elseif ( PLATFORM_INT STREQUAL "MAC_CATALYST_UNIVERSAL" )
set ( SDK_NAME macosx )
if ( NOT ARCHS )
set ( ARCHS "x86_64;arm64" )
endif ( )
string ( REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}" )
set ( APPLE_TARGET_TRIPLE_INT ${ ARCHS_SPLIT } -apple-ios ${ DEPLOYMENT_TARGET } -macabi )
else ( )
message ( FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}" )
endif ( )
string ( REPLACE ";" " " ARCHS_SPACED "${ARCHS}" )
if ( MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode" )
message ( FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode" )
endif ( )
@ -455,21 +576,22 @@ endif()
if ( CMAKE_GENERATOR MATCHES "Xcode" AND PLATFORM_INT MATCHES "^MAC_CATALYST" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
set ( CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx" )
set ( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-maccatalyst " )
set ( CMAKE_XCODE_ATTRIBUTE_SUPPORTS_MACCATALYST "YES " )
if ( NOT DEFINED MACOSX_DEPLOYMENT_TARGET )
set ( CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "10.15" )
else ( )
set ( CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}" )
endif ( )
elseif ( CMAKE_GENERATOR MATCHES "Xcode" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
set ( CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}" )
if ( NOT PLATFORM_INT MATCHES ".*COMBINED" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk= ${ SDK_NAME } *] "${ARCHS}" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk= ${ SDK_NAME } *] "${ARCHS}" )
set ( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk= ${ SDK_NAME } *] "${ARCHS_SPACED }" )
set ( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk= ${ SDK_NAME } *] "${ARCHS_SPACED }" )
endif ( )
endif ( )
# I f u s e r d i d n o t s p e c i f y t h e S D K r o o t t o u s e , t h e n q u e r y x c o d e b u i l d f o r i t .
# I f t h e u s e r d i d n o t s p e c i f y t h e S D K r o o t t o u s e , t h e n q u e r y x c o d e b u i l d f o r i t .
if ( DEFINED CMAKE_OSX_SYSROOT_INT )
# E n v i r o n m e n t v a r i a b l e s a r e a l w a y s p r e s e r v e d .
set ( ENV{_CMAKE_OSX_SYSROOT_INT} "${CMAKE_OSX_SYSROOT_INT}" )
@ -496,34 +618,30 @@ elseif(DEFINED CMAKE_OSX_SYSROOT_INT)
endif ( )
# U s e b i t c o d e o r n o t
if ( NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+" )
# U n l e s s s p e c i f i e d , e n a b l e b i t c o d e s u p p o r t b y d e f a u l t
message ( STATUS "[DEFAULTS] Enabling bitcode support by default. ENABLE_BITCODE not provided!" )
set ( ENABLE_BITCODE TRUE )
elseif ( NOT DEFINED ENABLE_BITCODE )
message ( STATUS "[DEFAULTS] Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!" )
set ( ENABLE_BITCODE FALSE )
if ( NOT DEFINED ENABLE_BITCODE )
message ( STATUS "[DEFAULTS] Disabling bitcode support by default. ENABLE_BITCODE not provided for override!" )
set ( ENABLE_BITCODE OFF )
endif ( )
set ( ENABLE_BITCODE_INT ${ ENABLE_BITCODE } CACHE BOOL
" W h e t h e r o r n o t t o e n a b l e b i t c o d e " F O R C E )
# U s e A R C o r n o t
if ( NOT DEFINED ENABLE_ARC )
# U n l e s s s p e c i f i e d , e n a b l e A R C s u p p o r t b y d e f a u l t
set ( ENABLE_ARC TRUE )
set ( ENABLE_ARC ON )
message ( STATUS "[DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided!" )
endif ( )
set ( ENABLE_ARC_INT ${ ENABLE_ARC } CACHE BOOL "Whether or not to enable ARC" FORCE )
# U s e h i d d e n v i s i b i l i t y o r n o t
if ( NOT DEFINED ENABLE_VISIBILITY )
# U n l e s s s p e c i f i e d , d i s a b l e s y m b o l s v i s i b i l i t y b y d e f a u l t
set ( ENABLE_VISIBILITY FALSE )
set ( ENABLE_VISIBILITY OFF )
message ( STATUS "[DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!" )
endif ( )
set ( ENABLE_VISIBILITY_INT ${ ENABLE_VISIBILITY } CACHE BOOL "Whether or not to hide symbols from the dynamic linker (-fvisibility=hidden)" FORCE )
# S e t s t r i c t c o m p i l e r c h e c k s o r n o t
if ( NOT DEFINED ENABLE_STRICT_TRY_COMPILE )
# U n l e s s s p e c i f i e d , d i s a b l e s t r i c t try_compile ( )
set ( ENABLE_STRICT_TRY_COMPILE FALSE )
set ( ENABLE_STRICT_TRY_COMPILE OFF )
message ( STATUS "[DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!" )
endif ( )
set ( ENABLE_STRICT_TRY_COMPILE_INT ${ ENABLE_STRICT_TRY_COMPILE } CACHE BOOL
@ -613,10 +731,14 @@ foreach(lang ${languages})
set ( CMAKE_ ${ lang } _CREATE_STATIC_LIBRARY "${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE INTERNAL "" )
endforeach ( )
# C M a k e 3 . 1 4 + s u p p o r t b u i l d i n g f o r i O S , w a t c h O S a n d t v O S o u t o f t h e b o x .
# C M a k e 3 . 1 4 + s u p p o r t b u i l d i n g f o r i O S , w a t c h O S , a n d t v O S o u t o f t h e b o x .
if ( MODERN_CMAKE )
if ( SDK_NAME MATCHES "iphone" )
set ( CMAKE_SYSTEM_NAME iOS )
elseif ( SDK_NAME MATCHES "xros" )
set ( CMAKE_SYSTEM_NAME visionOS )
elseif ( SDK_NAME MATCHES "xrsimulator" )
set ( CMAKE_SYSTEM_NAME visionOS )
elseif ( SDK_NAME MATCHES "macosx" )
set ( CMAKE_SYSTEM_NAME Darwin )
elseif ( SDK_NAME MATCHES "appletv" )
@ -626,33 +748,38 @@ if(MODERN_CMAKE)
endif ( )
# P r o v i d e f l a g s f o r a c o m b i n e d F A T l i b r a r y b u i l d o n n e w e r C M a k e v e r s i o n s
if ( PLATFORM_INT MATCHES ".*COMBINED" )
set ( CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO" )
set ( CMAKE_IOS_INSTALL_COMBINED YES )
message ( STATUS "Will combine built (static) artifacts into FAT lib..." )
if ( CMAKE_GENERATOR MATCHES "Xcode" )
# S e t t h e S D K R O O T X c o d e p r o p e r t i e s t o a X c o d e - f r i e n d l y value ( the SDK_NAME, E.g, iphoneos )
# T h i s w a y , X c o d e w i l l a u t o m a t i c a l l y s w i t c h b e t w e e n t h e s i m u l a t o r a n d d e v i c e S D K w h e n b u i l d i n g .
set ( CMAKE_XCODE_ATTRIBUTE_SDKROOT "${SDK_NAME}" )
# F o r c e t o n o t b u i l d j u s t o n e A R C H , b u t a l l !
set ( CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO" )
endif ( )
endif ( )
elseif ( NOT DEFINED CMAKE_SYSTEM_NAME AND ${ CMAKE_VERSION } VERSION_GREATER_EQUAL "3.10" )
# L e g a c y c o d e p a t h p r i o r t o C M a k e 3 . 1 4 o r f a l l b a c k i f n o C M A K E _ S Y S T E M _ N A M E s p e c i f i e d
set ( CMAKE_SYSTEM_NAME iOS )
elseif ( NOT DEFINED CMAKE_SYSTEM_NAME )
# L e g a c y c o d e p a t h p r i o r t o C M a k e 3 . 1 4 o r f a l l b a c k i f n o C M A K E _ S Y S T E M _ N A M E s p e c i f i e d
# L e g a c y c o d e p a t h b e f o r e C M a k e 3 . 1 4 o r f a l l b a c k i f n o C M A K E _ S Y S T E M _ N A M E s p e c i f i e d
set ( CMAKE_SYSTEM_NAME Darwin )
endif ( )
# S t a n d a r d s e t t i n g s .
set ( CMAKE_SYSTEM_VERSION ${ SDK_VERSION } CACHE INTERNAL "" )
set ( UNIX TRUE CACHE BOOL "" )
set ( APPLE TRUE CACHE BOOL "" )
if ( PLATFORM STREQUAL "MAC" OR PLATFORM STREQUAL "MAC_ARM64" )
set ( IOS FALSE CACHE BOOL "" )
set ( MACOS TRUE CACHE BOOL "" )
elseif ( PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64" )
set ( IOS TRUE CACHE BOOL "" )
set ( MACOS TRUE CACHE BOOL "" )
set ( UNIX ON CACHE BOOL "" )
set ( APPLE ON CACHE BOOL "" )
if ( PLATFORM STREQUAL "MAC" OR PLATFORM STREQUAL "MAC_ARM64" OR PLATFORM STREQUAL "MAC_UNIVERSAL" )
set ( IOS OFF CACHE BOOL "" )
set ( MACOS ON CACHE BOOL "" )
elseif ( PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64" OR PLATFORM STREQUAL "MAC_CATALYST_UNIVERSAL" )
set ( IOS ON CACHE BOOL "" )
set ( MACOS ON CACHE BOOL "" )
elseif ( PLATFORM STREQUAL "VISIONOS" OR PLATFORM STREQUAL "SIMULATOR_VISIONOS" OR PLATFORM STREQUAL "VISIONOSCOMBINED" )
set ( IOS OFF CACHE BOOL "" )
set ( VISIONOS ON CACHE BOOL "" )
else ( )
set ( IOS TRUE CACHE BOOL "" )
set ( IOS ON CACHE BOOL "" )
endif ( )
set ( CMAKE_AR ar CACHE FILEPATH "" FORCE )
set ( CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE )
set ( CMAKE_STRIP strip CACHE FILEPATH "" FORCE )
# S e t t h e a r c h i t e c t u r e s f o r w h i c h t o b u i l d .
set ( CMAKE_OSX_ARCHITECTURES ${ ARCHS } CACHE INTERNAL "" )
# C h a n g e t h e t y p e o f t a r g e t g e n e r a t e d f o r try_compile ( ) s o i t ' l l w o r k w h e n c r o s s - c o m p i l i n g , w e a k c o m p i l e r c h e c k s
@ -660,10 +787,14 @@ if(NOT ENABLE_STRICT_TRY_COMPILE_INT)
set ( CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY )
endif ( )
# A l l i O S / D a r w i n s p e c i f i c s e t t i n g s - s o m e m a y b e r e d u n d a n t .
set ( CMAKE_MACOSX_BUNDLE YES )
if ( NOT DEFINED CMAKE_MACOSX_BUNDLE )
set ( CMAKE_MACOSX_BUNDLE YES )
endif ( )
set ( CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" )
set ( CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO" )
set ( CMAKE_SHARED_LIBRARY_PREFIX "lib" )
set ( CMAKE_SHARED_LIBRARY_SUFFIX ".dylib" )
set ( CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".tbd" ".so" )
set ( CMAKE_SHARED_MODULE_PREFIX "lib" )
set ( CMAKE_SHARED_MODULE_SUFFIX ".so" )
set ( CMAKE_C_COMPILER_ABI ELF )
@ -710,12 +841,18 @@ if(${CMAKE_VERSION} VERSION_LESS "3.11")
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_TVOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m t v o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "SIMULATORARM64_TVOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m t v o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "WATCHOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m w a t c h o s - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m w a t c h o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "SIMULATORARM64_WATCHOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m w a t c h o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "MAC" )
set ( SDK_NAME_VERSION_FLAGS
" - m m a c o s x - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
@ -726,7 +863,7 @@ if(${CMAKE_VERSION} VERSION_LESS "3.11")
endif ( )
elseif ( NOT PLATFORM_INT MATCHES "^MAC_CATALYST" )
# N e w e r v e r s i o n s o f C M a k e s e t s t h e v e r s i o n m i n f l a g s c o r r e c t l y , s k i p t h i s f o r M a c C a t a l y s t t a r g e t s
set ( CMAKE_OSX_DEPLOYMENT_TARGET ${ DEPLOYMENT_TARGET } )
set ( CMAKE_OSX_DEPLOYMENT_TARGET ${ DEPLOYMENT_TARGET } CACHE INTERNAL "Minimum OS X deployment version" )
endif ( )
if ( DEFINED APPLE_TARGET_TRIPLE_INT )
@ -757,6 +894,14 @@ else()
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO" )
endif ( )
if ( NAMED_LANGUAGE_SUPPORT_INT )
set ( OBJC_VARS "-fobjc-abi-version=2 -DOBJC_OLD_DISPATCH_PROTOTYPES=0" )
set ( OBJC_LEGACY_VARS "" )
else ( )
set ( OBJC_VARS "" )
set ( OBJC_LEGACY_VARS "-fobjc-abi-version=2 -DOBJC_OLD_DISPATCH_PROTOTYPES=0" )
endif ( )
if ( NOT ENABLE_VISIBILITY_INT )
foreach ( lang ${ languages } )
set ( CMAKE_ ${ lang } _VISIBILITY_PRESET "hidden" CACHE INTERNAL "" )
@ -775,35 +920,48 @@ if(DEFINED APPLE_TARGET_TRIPLE)
set ( APPLE_TARGET_TRIPLE_FLAG "-target ${APPLE_TARGET_TRIPLE}" )
endif ( )
# C h e c k i f X c o d e g e n e r a t o r i s u s e d , s i n c e t h a t w i l l h a n d l e t h e s e f l a g s a u t o m a g i c a l l y
# C h e c k i f X c o d e g e n e r a t o r i s u s e d s i n c e t h a t w i l l h a n d l e t h e s e f l a g s a u t o m a g i c a l l y
if ( CMAKE_GENERATOR MATCHES "Xcode" )
message ( STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator." )
message ( STATUS "Not setting any manual command-line buildflags, since Xcode is selected as the generator. Modifying the Xcode build-settings directly instead ." )
else ( )
set ( CMAKE_C_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${CMAKE_C_FLAGS}" )
set ( CMAKE_C_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${OBJC_LEGACY_VARS} ${BITCODE} ${VISIBILITY} ${CMAKE_C_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r d u r i n g a l l C b u i l d t y p e s . " )
set ( CMAKE_C_FLAGS_DEBUG "-O0 -g ${CMAKE_C_FLAGS_DEBUG}" )
set ( CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_C_FLAGS_MINSIZEREL}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_C_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_C_FLAGS_RELEASE}" )
set ( CMAKE_CXX_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${CMAKE_CXX_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${OBJC_LEGACY_VARS} ${BITCODE} ${VISIBILITY} ${CMAKE_CXX_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r d u r i n g a l l C X X b u i l d t y p e s . " )
set ( CMAKE_CXX_FLAGS_DEBUG "-O0 -g ${CMAKE_CXX_FLAGS_DEBUG}" )
set ( CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_CXX_FLAGS_RELEASE}" )
set ( CMAKE_OBJC_FLAGS "${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} -fobjc-weak -fobjc-abi-version=2 -fobjc-legacy-dispatch -DOBJC_OLD_DISPATCH_PROTOTYPES=0 ${CMAKE_OBJC_FLAGS}" )
set ( CMAKE_OBJC_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJC_FLAGS_DEBUG}" )
set ( CMAKE_OBJC_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJC_FLAGS_MINSIZEREL}" )
set ( CMAKE_OBJC_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJC_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_OBJC_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJC_FLAGS_RELEASE}" )
set ( CMAKE_OBJCXX_FLAGS "${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} -fobjc-weak -fobjc-abi-version=2 -fobjc-legacy-dispatch -DOBJC_OLD_DISPATCH_PROTOTYPES=0 ${CMAKE_OBJCXX_FLAGS}" )
set ( CMAKE_OBJCXX_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJCXX_FLAGS_DEBUG}" )
set ( CMAKE_OBJCXX_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJCXX_FLAGS_MINSIZEREL}" )
set ( CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_OBJCXX_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJCXX_FLAGS_RELEASE}" )
set ( CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}" )
set ( CMAKE_CXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}" )
set ( CMAKE_OBJC_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJC_LINK_FLAGS}" )
set ( CMAKE_OBJCXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJCXX_LINK_FLAGS}" )
set ( CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES} ${APPLE_TARGET_TRIPLE_FLAG}" )
if ( NAMED_LANGUAGE_SUPPORT_INT )
set ( CMAKE_OBJC_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} ${OBJC_VARS} ${CMAKE_OBJC_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r d u r i n g a l l O B J C b u i l d t y p e s . " )
set ( CMAKE_OBJC_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJC_FLAGS_DEBUG}" )
set ( CMAKE_OBJC_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJC_FLAGS_MINSIZEREL}" )
set ( CMAKE_OBJC_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJC_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_OBJC_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJC_FLAGS_RELEASE}" )
set ( CMAKE_OBJCXX_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} ${OBJC_VARS} ${CMAKE_OBJCXX_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r d u r i n g a l l O B J C X X b u i l d t y p e s . " )
set ( CMAKE_OBJCXX_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJCXX_FLAGS_DEBUG}" )
set ( CMAKE_OBJCXX_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJCXX_FLAGS_MINSIZEREL}" )
set ( CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_OBJCXX_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJCXX_FLAGS_RELEASE}" )
endif ( )
set ( CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r f o r a l l C l i n k t y p e s . " )
set ( CMAKE_CXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r f o r a l l C X X l i n k t y p e s . " )
if ( NAMED_LANGUAGE_SUPPORT_INT )
set ( CMAKE_OBJC_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJC_LINK_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r f o r a l l O B J C l i n k t y p e s . " )
set ( CMAKE_OBJCXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJCXX_LINK_FLAGS}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r f o r a l l O B J C X X l i n k t y p e s . " )
endif ( )
set ( CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES} ${APPLE_TARGET_TRIPLE_FLAG}" CACHE INTERNAL
" F l a g s u s e d b y t h e c o m p i l e r f o r a l l A S M b u i l d t y p e s . " )
endif ( )
# # P r i n t s t a t u s m e s s a g e s t o i n f o r m o f t h e c u r r e n t s t a t e
@ -820,6 +978,9 @@ message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}"
" ( S D K v e r s i o n : $ { S D K _ V E R S I O N } ) " )
if ( MODERN_CMAKE )
message ( STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!" )
if ( PLATFORM_INT MATCHES ".*COMBINED" )
message ( STATUS "Will combine built (static) artifacts into FAT lib..." )
endif ( )
endif ( )
if ( CMAKE_GENERATOR MATCHES "Xcode" )
message ( STATUS "Using Xcode version: ${XCODE_VERSION_INT}" )
@ -859,6 +1020,7 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
P L A T F O R M
X C O D E _ V E R S I O N _ I N T
S D K _ V E R S I O N
N A M E D _ L A N G U A G E _ S U P P O R T
D E P L O Y M E N T _ T A R G E T
C M A K E _ D E V E L O P E R _ R O O T
C M A K E _ O S X _ S Y S R O O T _ I N T
@ -881,6 +1043,13 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
C M A K E _ C X X _ F L A G S _ M I N S I Z E R E L
C M A K E _ C X X _ F L A G S _ R E L W I T H D E B I N F O
C M A K E _ C X X _ F L A G S _ R E L E A S E
C M A K E _ C _ L I N K _ F L A G S
C M A K E _ C X X _ L I N K _ F L A G S
C M A K E _ A S M _ F L A G S
)
if ( NAMED_LANGUAGE_SUPPORT_INT )
list ( APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
C M A K E _ O B J C _ F L A G S
C M A K E _ O B J C _ D E B U G
C M A K E _ O B J C _ M I N S I Z E R E L
@ -891,12 +1060,10 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
C M A K E _ O B J C X X _ M I N S I Z E R E L
C M A K E _ O B J C X X _ R E L W I T H D E B I N F O
C M A K E _ O B J C X X _ R E L E A S E
C M A K E _ C _ L I N K _ F L A G S
C M A K E _ C X X _ L I N K _ F L A G S
C M A K E _ O B J C _ L I N K _ F L A G S
C M A K E _ O B J C X X _ L I N K _ F L A G S
C M A K E _ A S M _ F L A G S
)
)
endif ( )
set ( CMAKE_PLATFORM_HAS_INSTALLNAME 1 )
set ( CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks" )
@ -909,16 +1076,18 @@ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
# S e t t h e f i n d r o o t t o t h e S D K d e v e l o p e r r o o t s .
# N o t e : C M A K E _ F I N D _ R O O T _ P A T H i s o n l y u s e f u l w h e n c r o s s - c o m p i l i n g . T h u s , d o n o t s e t o n m a c O S b u i l d s .
if ( NOT PLATFORM_INT STREQUAL "MAC" AND NOT PLATFORM_INT STREQUAL "MAC_ARM64 ")
if ( NOT PLATFORM_INT MATCHES "^MAC.*$ ")
list ( APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "" )
set ( CMAKE_IGNORE_PATH "/System/Library/Frameworks;/usr/local/lib" CACHE INTERNAL "" )
set ( CMAKE_IGNORE_PATH "/System/Library/Frameworks;/usr/local/lib;/opt/homebrew " CACHE INTERNAL "" )
endif ( )
# D e f a u l t t o s e a r c h i n g f o r f r a m e w o r k s f i r s t .
set ( CMAKE_FIND_FRAMEWORK FIRST )
IF ( NOT DEFINED CMAKE_FIND_FRAMEWORK )
set ( CMAKE_FIND_FRAMEWORK FIRST )
ENDIF ( NOT DEFINED CMAKE_FIND_FRAMEWORK )
# S e t u p t h e d e f a u l t s e a r c h d i r e c t o r i e s f o r f r a m e w o r k s .
if ( PLATFORM_INT MATCHES "^MAC_CATALYST" )
if ( PLATFORM_INT MATCHES "^MAC_CATALYST" )
set ( CMAKE_FRAMEWORK_PATH
$ { C M A K E _ D E V E L O P E R _ R O O T } / L i b r a r y / P r i v a t e F r a m e w o r k s
$ { C M A K E _ O S X _ S Y S R O O T _ I N T } / S y s t e m / L i b r a r y / F r a m e w o r k s
@ -966,7 +1135,7 @@ macro(find_host_package)
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
set ( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER )
set ( _TOOLCHAIN_IOS ${ IOS } )
set ( IOS FALSE )
set ( IOS OFF )
find_package ( ${ ARGN } )
set ( IOS ${ _TOOLCHAIN_IOS } )
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )