Revert "Revert "Revert "swift-lang: shuffle the source directory structure (N…"

This commit is contained in:
Michael Ilseman
2020-02-20 15:39:51 -08:00
committed by GitHub
parent 1b078531ca
commit bfd0de4928
11 changed files with 32 additions and 45 deletions

View File

@@ -1293,11 +1293,6 @@ function(_add_swift_target_library_single target name)
-libc;${SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY})
endif()
if(sourcekitd IN_LIST SWIFTLIB_SINGLE_DEPENDS)
list(REMOVE_ITEM SWIFTLIB_SINGLE_DEPENDS sourcekitd)
set(SWIFTLIB_SINGLE_INJECT_SOURCEKITD_DEPENDENCY TRUE)
endif()
# FIXME: don't actually depend on the libraries in SWIFTLIB_SINGLE_LINK_LIBRARIES,
# just any swiftmodule files that are associated with them.
handle_swift_sources(
@@ -1323,10 +1318,6 @@ function(_add_swift_target_library_single target name)
${embed_bitcode_arg}
INSTALL_IN_COMPONENT "${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}"
MACCATALYST_BUILD_FLAVOR "${SWIFTLIB_SINGLE_MACCATALYST_BUILD_FLAVOR}")
if(SWIFTLIB_SINGLE_INJECT_SOURCEKITD_DEPENDENCY)
add_dependencies(${swift_object_dependency_target}
sourcekitd)
endif()
add_swift_source_group("${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}")
# If there were any swift sources, then a .swiftmodule may have been created.

View File

@@ -1,11 +1,3 @@
if(SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_INCLUDE_TESTS)
add_subdirectory(swift-reflection-test)
endif()
if(SWIFT_BUILD_SDK_OVERLAY)
include(CheckIncludeFiles)
check_include_files("xpc/xpc.h" HAVE_XPC_H)
if(SWIFT_BUILD_SOURCEKIT AND CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_XPC_H)
add_subdirectory(swift-lang)
endif()
endif()

View File

@@ -1,28 +0,0 @@
if(SWIFT_HOST_VARIANT MATCHES "^iphoneos")
set(SWIFT_LANG_TARGET_SDK "IOS")
elseif(SWIFT_HOST_VARIANT MATCHES "^iphonesimulator")
set(SWIFT_LANG_TARGET_SDK "IOS_SIMULATOR")
elseif(SWIFT_HOST_VARIANT MATCHES "^macosx")
set(SWIFT_LANG_TARGET_SDK "OSX")
else()
message(SEND_ERROR "Unknown SDK for SwiftLang")
endif()
add_swift_target_library(swiftSwiftLang SHARED
SwiftLang.swift
SourceKitdClient.swift
SourceKitdRequest.swift
SourceKitdResponse.swift
SourceKitdUID.swift
GYB_SOURCES
UIDs.swift.gyb
DEPENDS sourcekitd
SWIFT_MODULE_DEPENDS_OSX Darwin Foundation
PRIVATE_LINK_LIBRARIES sourcekitd
SWIFT_COMPILE_FLAGS -F${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib
INSTALL_IN_COMPONENT sourcekit-xpc-service
DARWIN_INSTALL_NAME_DIR "@rpath"
TARGET_SDKS ${SWIFT_LANG_TARGET_SDK}
IS_STDLIB)

View File

@@ -10,3 +10,4 @@ if(LibEdit_FOUND AND LibEdit_HAS_UNICODE)
add_swift_tool_subdirectory(sourcekitd-repl)
endif()
add_swift_tool_subdirectory(complete-test)
add_subdirectory(swift-lang)

View File

@@ -0,0 +1,31 @@
if(NOT SWIFT_SOURCEKIT_USE_INPROC_LIBRARY AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
# The build type of swiftlang should agree with stdlib
# This setting could avoid us adding additional search paths when building
# executables using SwiftLang.
set(SWIFT_LANG_LIBRARY_BUILD_TYPES)
if(SWIFT_BUILD_DYNAMIC_STDLIB)
list(APPEND SWIFT_LANG_LIBRARY_BUILD_TYPES SHARED)
endif()
if(SWIFT_BUILD_STATIC_STDLIB)
list(APPEND SWIFT_LANG_LIBRARY_BUILD_TYPES STATIC)
endif()
add_swift_target_library(swiftSwiftLang ${SWIFT_LANG_LIBRARY_BUILD_TYPES}
SwiftLang.swift
SourceKitdClient.swift
SourceKitdRequest.swift
SourceKitdResponse.swift
SourceKitdUID.swift
GYB_SOURCES
UIDs.swift.gyb
DEPENDS sourcekitd-test
SWIFT_MODULE_DEPENDS_OSX Darwin Foundation
PRIVATE_LINK_LIBRARIES sourcekitd
SWIFT_COMPILE_FLAGS -F${SWIFT_LIBRARY_OUTPUT_INTDIR}
INSTALL_IN_COMPONENT sourcekit-xpc-service
DARWIN_INSTALL_NAME_DIR "@rpath"
TARGET_SDKS ${SOURCEKIT_DEFAULT_TARGET_SDK}
IS_STDLIB)
endif()