File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT CMAKE_CROSSCOMPILING)
35
35
endif ()
36
36
37
37
# If we were don't have XPC, just build inproc.
38
- if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" AND NOT HAVE_XPC_H )
38
+ if (NOT "${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" OR NOT HAVE_XPC_H )
39
39
set (SWIFT_SOURCEKIT_USE_INPROC_LIBRARY TRUE )
40
40
endif ()
41
41
@@ -95,12 +95,11 @@ include_directories(BEFORE
95
95
${SOURCEKIT_BINARY_DIR} /tools/SourceKit/include
96
96
)
97
97
98
- if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Linux " )
99
- set ( SOURCEKIT_DEFAULT_TARGET_SDK "LINUX" )
98
+ if (NOT "${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin " )
99
+ string ( TOUPPER " ${CMAKE_SYSTEM_NAME} " SOURCEKIT_DEFAULT_TARGET_SDK )
100
100
set (SOURCEKIT_NEED_EXPLICIT_LIBDISPATCH TRUE )
101
101
102
102
if (SWIFT_BUILD_SOURCEKIT )
103
-
104
103
include (ExternalProject )
105
104
ExternalProject_Add (libdispatch
106
105
SOURCE_DIR
Original file line number Diff line number Diff line change @@ -69,7 +69,13 @@ function(add_sourcekit_default_compiler_flags target)
69
69
# TODO(compnerd) this should really use target_compile_options but the use
70
70
# of keyword and non-keyword flags prevents this
71
71
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
72
- list (APPEND c_compile_flags "-fblocks" )
72
+ list (APPEND c_compile_flags -fblocks )
73
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
74
+ if (SWIFT_COMPILER_IS_MSVC_LIKE )
75
+ list (APPEND c_compile_flags -Xclang;-fblocks )
76
+ else ()
77
+ list (APPEND c_compile_flags -fblocks )
78
+ endif ()
73
79
endif ()
74
80
75
81
# Convert variables to space-separated strings.
You can’t perform that action at this time.
0 commit comments