Skip to content

Commit e20774a

Browse files
authored
Merge pull request #693 from rintaro/cmake-link-foundation
[CMake] Explicitly link Testing to Foundation
2 parents 0bad002 + c2f8ccc commit e20774a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ endif()
1515
project(SwiftTesting
1616
LANGUAGES CXX Swift)
1717

18+
if(NOT APPLE)
19+
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
20+
find_package(dispatch CONFIG)
21+
endif()
22+
find_package(Foundation CONFIG)
23+
endif()
24+
1825
include(GNUInstallDirs)
1926

2027
list(APPEND CMAKE_MODULE_PATH

Sources/Testing/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ add_library(Testing
9797
Traits/Trait.swift)
9898
target_link_libraries(Testing PRIVATE
9999
_TestingInternals)
100+
if(NOT APPLE)
101+
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
102+
target_link_libraries(Testing PUBLIC
103+
dispatch)
104+
endif()
105+
target_link_libraries(Testing PUBLIC
106+
Foundation)
107+
endif()
100108
if(NOT BUILD_SHARED_LIBS)
101109
# When building a static library, tell clients to autolink the internal
102110
# library.

0 commit comments

Comments
 (0)