File tree 4 files changed +19
-2
lines changed
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)
57
57
set (CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /swift)
58
58
59
59
option (BUILD_SHARED_LIBS "build shared libraries" ON )
60
+ option (BUILD_FULLY_STATIC "build fully static" NO )
60
61
61
62
# Optionally build tools (on by default) but only when building shared libraries
62
63
if (BUILD_SHARED_LIBS )
Original file line number Diff line number Diff line change @@ -2283,7 +2283,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
2283
2283
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
2284
2284
// - Amazon Linux 2 (EoL mid-2025)
2285
2285
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__ )
2287
2287
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
2288
2288
// - Solaris 11.3 (October 2015)
2289
2289
// - Glibc 2.29 (February 2019)
Original file line number Diff line number Diff line change @@ -61,7 +61,16 @@ if(NOT BUILD_SHARED_LIBS)
61
61
target_compile_options (FoundationNetworking PRIVATE
62
62
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend curl>" )
63
63
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
+
65
74
endif ()
66
75
67
76
set_target_properties (FoundationNetworking PROPERTIES
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if(NOT BUILD_SHARED_LIBS)
37
37
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend xml2>" )
38
38
target_compile_options (FoundationXML PRIVATE
39
39
"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
+
40
47
endif ()
41
48
42
49
set_target_properties (FoundationXML PROPERTIES
You can’t perform that action at this time.
0 commit comments