Skip to content

Commit edbe22b

Browse files
committed
swift-lang: shuffle the source directory structure (NFC)
This moves the swift-lang library out of the tools/SourceKit directory and into the stdlib directory. As it stands, the library required that the standard library and the SDK overlay was being built. This is implicitly done when building the stdlib subdirectory. Furthermore, it had an odd tie between the flags for Swift and SourceKit which now have the logic separated. This clearly delineates the host and target components in the repository.
1 parent 3777ec0 commit edbe22b

File tree

10 files changed

+35
-32
lines changed

10 files changed

+35
-32
lines changed

stdlib/tools/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
if(SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_INCLUDE_TESTS)
22
add_subdirectory(swift-reflection-test)
33
endif()
4+
if(SWIFT_BUILD_SDK_OVERLAY)
5+
include(CheckIncludeFiles)
6+
check_include_files("xpc/xpc.h" HAVE_XPC_H)
7+
8+
if(SWIFT_BUILD_SOURCEKIT AND CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_XPC_H)
9+
add_subdirectory(swift-lang)
10+
endif()
11+
endif()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
if(SWIFT_HOST_VARIANT MATCHES "^iphoneos")
2+
set(SWIFT_LANG_TARGET_SDK "IOS")
3+
elseif(SWIFT_HOST_VARIANT MATCHES "^iphonesimulator")
4+
set(SWIFT_LANG_TARGET_SDK "IOS_SIMULATOR")
5+
elseif(SWIFT_HOST_VARIANT MATCHES "^macosx")
6+
set(SWIFT_LANG_TARGET_SDK "OSX")
7+
else()
8+
message(SEND_ERROR "Unknown SDK for SwiftLang")
9+
endif()
10+
11+
add_swift_target_library(swiftSwiftLang SHARED
12+
SwiftLang.swift
13+
SourceKitdClient.swift
14+
SourceKitdRequest.swift
15+
SourceKitdResponse.swift
16+
SourceKitdUID.swift
17+
18+
GYB_SOURCES
19+
UIDs.swift.gyb
20+
21+
SWIFT_MODULE_DEPENDS_OSX Darwin Foundation
22+
PRIVATE_LINK_LIBRARIES sourcekitd
23+
SWIFT_COMPILE_FLAGS -F${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib
24+
INSTALL_IN_COMPONENT sourcekit-xpc-service
25+
DARWIN_INSTALL_NAME_DIR "@rpath"
26+
TARGET_SDKS ${SWIFT_LANG_TARGET_SDK}
27+
IS_STDLIB)

tools/SourceKit/tools/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ if(LibEdit_FOUND AND LibEdit_HAS_UNICODE)
1010
add_swift_tool_subdirectory(sourcekitd-repl)
1111
endif()
1212
add_swift_tool_subdirectory(complete-test)
13-
add_subdirectory(swift-lang)

tools/SourceKit/tools/swift-lang/CMakeLists.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)