File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
5757set (CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /swift)
5858
5959option (BUILD_SHARED_LIBS "build shared libraries" ON )
60+ option (BUILD_FULLY_STATIC "build fully static" NO )
6061
6162# Optionally build tools (on by default) but only when building shared libraries
6263if (BUILD_SHARED_LIBS )
Original file line number Diff line number Diff line change @@ -2283,7 +2283,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
22832283 // Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
22842284 // - Amazon Linux 2 (EoL mid-2025)
22852285 return ENOSYS ;
2286- #elif defined(__GLIBC__ ) || TARGET_OS_DARWIN || defined(__FreeBSD__ ) || defined(__ANDROID__ )
2286+ #elif defined(__GLIBC__ ) || TARGET_OS_DARWIN || defined(__FreeBSD__ ) || defined(__ANDROID__ ) || defined( __musl__ )
22872287 // Pre-standard posix_spawn_file_actions_addchdir_np version available in:
22882288 // - Solaris 11.3 (October 2015)
22892289 // - Glibc 2.29 (February 2019)
Original file line number Diff line number Diff line change @@ -61,7 +61,16 @@ if(NOT BUILD_SHARED_LIBS)
6161 target_compile_options (FoundationNetworking PRIVATE
6262 "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend curl>" )
6363 target_compile_options (FoundationNetworking PRIVATE
64- "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>" )
64+ "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>" )
65+
66+ if (BUILD_FULLY_STATIC)
67+ target_compile_options (FoundationNetworking
68+ PRIVATE
69+ "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend crypto>"
70+ "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend ssl>"
71+ "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend z>" )
72+ endif ()
73+
6574endif ()
6675
6776set_target_properties (FoundationNetworking PROPERTIES
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if(NOT BUILD_SHARED_LIBS)
3737 "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend xml2>" )
3838 target_compile_options (FoundationXML PRIVATE
3939 "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>" )
40+
41+ if (BUILD_FULLY_STATIC)
42+ target_compile_options (FoundationXML
43+ PRIVATE
44+ "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend z>" )
45+ endif ()
46+
4047endif ()
4148
4249set_target_properties (FoundationXML PROPERTIES
You can’t perform that action at this time.
0 commit comments