@@ -428,7 +428,6 @@ endfunction()
428428# [SHARED]
429429# [STATIC]
430430# [OBJECT]
431- # [PURE_SWIFT]
432431# [LLVM_LINK_COMPONENTS comp1 ...]
433432# source1 [source2 source3 ...])
434433#
@@ -447,18 +446,13 @@ endfunction()
447446# LLVM_LINK_COMPONENTS
448447# LLVM components this library depends on.
449448#
450- # PURE_SWIFT
451- # This has two effects if set: we do not use llvm_update_compile_flags to
452- # generate cflags/etc and we leave the linking mode of the library as swift.
453- #
454449# source1 ...
455450# Sources to add into this library.
456451function (add_swift_host_library name )
457452 set (options
458453 SHARED
459454 STATIC
460- OBJECT
461- PURE_SWIFT)
455+ OBJECT)
462456 set (single_parameter_options)
463457 set (multiple_parameter_options
464458 LLVM_LINK_COMPONENTS)
@@ -521,9 +515,7 @@ function(add_swift_host_library name)
521515 if (LLVM_COMMON_DEPENDS)
522516 add_dependencies (${name} ${LLVM_COMMON_DEPENDS} )
523517 endif ()
524- if (NOT ASHL_PURE_SWIFT)
525- llvm_update_compile_flags(${name} )
526- endif ()
518+ llvm_update_compile_flags(${name} )
527519 swift_common_llvm_config(${name} ${ASHL_LLVM_LINK_COMPONENTS} )
528520 set_output_directory(${name}
529521 BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
@@ -582,11 +574,7 @@ function(add_swift_host_library name)
582574 NO_SONAME YES )
583575 endif ()
584576
585- # Always link as CXX even if we have swift content unless we only contain
586- # swift content signaled via us being marked "PURE_SWIFT".
587- if (NOT ASHL_PURE_SWIFT)
588- set_target_properties (${name} PROPERTIES LINKER_LANGUAGE CXX)
589- endif ()
577+ set_target_properties (${name} PROPERTIES LINKER_LANGUAGE CXX)
590578
591579 if (${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
592580 target_link_options (${name} PRIVATE
@@ -596,30 +584,6 @@ function(add_swift_host_library name)
596584 "LINKER:-current_version,${SWIFT_COMPILER_VERSION} " )
597585 endif ()
598586
599- # If we found a swift compiler and are going to use swift code in swift
600- # host side tools but link with clang, add the appropriate -L paths so we
601- # find all of the necessary swift libraries on Darwin.
602- if (NOT ASHL_PURE_SWIFT)
603- if (CMAKE_Swift_COMPILER)
604- # Add in the toolchain directory so we can grab compatibility libraries
605- get_filename_component (TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER} DIRECTORY )
606- get_filename_component (TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR} /../lib/swift/macosx" ABSOLUTE )
607- target_link_directories (${name} PUBLIC ${TOOLCHAIN_LIB_DIR} )
608-
609- # Add in the SDK directory for the host platform.
610- #
611- # NOTE: We do this /after/ target_link_directorying TOOLCHAIN_LIB_DIR to
612- # ensure that we first find libraries from the toolchain, rather than
613- # from the SDK. The reason why this is important is that when we perform
614- # a stage2 build, this path is into the stage1 build. This is not a pure
615- # SDK and also contains compatibility libraries. We need to make sure
616- # that the compiler sees the actual toolchain's compatibility libraries
617- # first before the just built compability libraries or build errors occur.
618- target_link_directories (${name} PRIVATE
619- ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _ARCH_${SWIFT_HOST_VARIANT_ARCH} _PATH}/usr/lib/swift)
620- endif ()
621- endif ()
622-
623587 # For now turn off on Darwin swift targets, debug info if we are compiling a static
624588 # library and set up an rpath so that if someone works around this by using
625589 # shared libraries that in the short term we can find shared libraries.
@@ -945,25 +909,7 @@ function(add_swift_host_tool executable)
945909 set_property (TARGET ${executable} APPEND_STRING PROPERTY
946910 LINK_FLAGS " -lobjc " )
947911
948- else () # ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE
949-
950- # TODO: do we really need this? Do any tools which don't link libswift include other swift code?
951-
952- # Add in the SDK directory for the host platform.
953- #
954- # NOTE: We do this /after/ target_link_directorying TOOLCHAIN_LIB_DIR to
955- # ensure that we first find libraries from the toolchain, rather than from
956- # the SDK.
957- target_link_directories (${executable} PRIVATE "${sdk_dir} " )
958-
959- # We also want to be able to find libraries from the base toolchain
960- # directory. This is so swiftc can rely on its own host side dylibs that may
961- # contain swift content.
962- list (APPEND RPATH_LIST "@executable_path/../lib" )
963-
964- # Also include the abi stable system stdlib in our rpath.
965- list (APPEND RPATH_LIST "/usr/lib/swift" )
966- endif ()
912+ endif () # ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE
967913
968914 set_target_properties (${executable} PROPERTIES
969915 BUILD_WITH_INSTALL_RPATH YES
0 commit comments