Skip to content

Commit 85def51

Browse files
committed
build: do not attempt to link against dispatch/Foundation
On macOS, these libraries are provided by the system and are implicit. This allows building XCTest on macOS.
1 parent d767a70 commit 85def51

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ add_library(XCTest
4646
Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
4747
Sources/XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift
4848
Sources/XCTest/Public/Asynchronous/XCTestExpectation.swift)
49-
target_link_libraries(XCTest PRIVATE
50-
dispatch
51-
Foundation)
49+
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
50+
target_link_libraries(XCTest PRIVATE
51+
dispatch
52+
Foundation)
53+
endif()
5254
set_target_properties(XCTest PROPERTIES
5355
Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift
5456
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/swift)

0 commit comments

Comments
 (0)