Skip to content

Commit 47875a1

Browse files
committed
build: follow the Swift semantics for linking
The Foundation module is a public link target as that is re-exposed to users of FoundationNetwork and FoundationXML. Explicitly make the link to Foundation `PUBLIC`.
1 parent 1f85007 commit 47875a1

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Sources/FoundationNetworking/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ target_compile_definitions(FoundationNetworking PRIVATE
3434
target_compile_options(FoundationNetworking PUBLIC
3535
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
3636
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
37-
target_link_libraries(FoundationNetworking PRIVATE
38-
Foundation
39-
CFURLSessionInterface)
37+
target_link_libraries(FoundationNetworking
38+
PRIVATE
39+
CFURLSessionInterface
40+
PUBLIC
41+
Foundation)
4042
set_target_properties(FoundationNetworking PROPERTIES
4143
INSTALL_RPATH "$ORIGIN"
4244
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift

Sources/FoundationXML/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ target_compile_definitions(FoundationXML PRIVATE
1010
target_compile_options(FoundationXML PUBLIC
1111
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
1212
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
13-
target_link_libraries(FoundationXML PRIVATE
14-
Foundation
15-
CFXMLInterface)
13+
target_link_libraries(FoundationXML
14+
PRIVATE
15+
CFXMLInterface
16+
PUBLIC
17+
Foundation)
1618
set_target_properties(FoundationXML PROPERTIES
1719
INSTALL_RPATH "$ORIGIN"
1820
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift

0 commit comments

Comments
 (0)