File tree Expand file tree Collapse file tree 8 files changed +19
-27
lines changed Expand file tree Collapse file tree 8 files changed +19
-27
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,10 @@ option(SWIFT_BUILD_SOURCEKIT "Build SourceKit" TRUE)
465
465
option (SWIFT_ENABLE_SOURCEKIT_TESTS "Enable running SourceKit tests" ${SWIFT_BUILD_SOURCEKIT} )
466
466
467
467
if (SWIFT_BUILD_SYNTAXPARSERLIB OR SWIFT_BUILD_SOURCEKIT )
468
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
468
+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
469
+ set (SWIFT_NEED_EXPLICIT_LIBDISPATCH FALSE )
470
+ else ()
471
+ set (SWIFT_NEED_EXPLICIT_LIBDISPATCH TRUE )
469
472
if (NOT EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE} " )
470
473
message (SEND_ERROR "SyntaxParserLib and SourceKit require libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE" )
471
474
endif ()
@@ -951,7 +954,7 @@ if (LLVM_ENABLE_DOXYGEN)
951
954
message (STATUS "Doxygen: enabled" )
952
955
endif ()
953
956
954
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
957
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
955
958
if (CMAKE_C_COMPILER_ID STREQUAL Clang AND
956
959
CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.8
957
960
OR LLVM_USE_SANITIZER )
Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ target_link_libraries(SourceKitSupport PRIVATE
11
11
swiftSyntax
12
12
clangBasic
13
13
clangRewrite )
14
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
15
- target_link_libraries (SourceKitSupport INTERFACE
16
- dispatch
17
- BlocksRuntime )
14
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
15
+ target_link_libraries (SourceKitSupport INTERFACE dispatch BlocksRuntime )
18
16
endif ()
19
17
Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
7
7
else ()
8
8
target_link_libraries (complete-test PRIVATE sourcekitd )
9
9
endif ()
10
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
11
- target_link_libraries (complete-test PRIVATE
12
- dispatch
13
- BlocksRuntime )
10
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
11
+ target_link_libraries (complete-test PRIVATE dispatch BlocksRuntime )
14
12
endif ()
15
13
16
14
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
Original file line number Diff line number Diff line change @@ -12,10 +12,8 @@ if(HAVE_UNICODE_LIBEDIT)
12
12
else ()
13
13
target_link_libraries (sourcekitd-repl PRIVATE sourcekitd )
14
14
endif ()
15
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
16
- target_link_libraries (sourcekitd-repl PRIVATE
17
- dispatch
18
- BlocksRuntime )
15
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
16
+ target_link_libraries (sourcekitd-repl PRIVATE dispatch BlocksRuntime )
19
17
endif ()
20
18
21
19
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
Original file line number Diff line number Diff line change @@ -17,10 +17,8 @@ if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
17
17
else ()
18
18
target_link_libraries (sourcekitd-test PRIVATE sourcekitd )
19
19
endif ()
20
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
21
- target_link_libraries (sourcekitd-test PRIVATE
22
- dispatch
23
- BlocksRuntime )
20
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
21
+ target_link_libraries (sourcekitd-test PRIVATE dispatch BlocksRuntime )
24
22
endif ()
25
23
26
24
add_dependencies (sourcekitd-test sourcekitdTestOptionsTableGen )
Original file line number Diff line number Diff line change @@ -45,9 +45,8 @@ endif()
45
45
46
46
set_property (TARGET libSwiftSyntaxParser APPEND_STRING PROPERTY
47
47
COMPILE_FLAGS " -fblocks" )
48
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
49
- target_link_libraries (libSwiftSyntaxParser PRIVATE
50
- BlocksRuntime )
48
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
49
+ target_link_libraries (libSwiftSyntaxParser PRIVATE BlocksRuntime )
51
50
endif ()
52
51
53
52
add_dependencies (parser-lib libSwiftSyntaxParser )
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ endif()
27
27
28
28
set_property (TARGET swift-syntax-parser-test APPEND_STRING PROPERTY
29
29
COMPILE_FLAGS " -fblocks" )
30
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
31
- target_link_libraries (swift-syntax-parser-test PRIVATE
32
- BlocksRuntime )
30
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
31
+ target_link_libraries (swift-syntax-parser-test PRIVATE BlocksRuntime )
33
32
endif ()
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ endif()
24
24
25
25
set_property (TARGET SwiftSyntaxParserTests APPEND_STRING PROPERTY
26
26
COMPILE_FLAGS " -fblocks" )
27
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
28
- target_link_libraries (SwiftSyntaxParserTests PRIVATE
29
- BlocksRuntime )
27
+ if (SWIFT_NEED_EXPLICIT_LIBDISPATCH )
28
+ target_link_libraries (SwiftSyntaxParserTests PRIVATE BlocksRuntime )
30
29
endif ()
You can’t perform that action at this time.
0 commit comments