@@ -430,7 +430,6 @@ endfunction()
430430# [SHARED]
431431# [STATIC]
432432# [OBJECT]
433- # [PURE_SWIFT]
434433# [LLVM_LINK_COMPONENTS comp1 ...]
435434# source1 [source2 source3 ...])
436435#
@@ -449,18 +448,13 @@ endfunction()
449448# LLVM_LINK_COMPONENTS
450449# LLVM components this library depends on.
451450#
452- # PURE_SWIFT
453- # This has two effects if set: we do not use llvm_update_compile_flags to
454- # generate cflags/etc and we leave the linking mode of the library as swift.
455- #
456451# source1 ...
457452# Sources to add into this library.
458453function (add_swift_host_library name )
459454 set (options
460455 SHARED
461456 STATIC
462- OBJECT
463- PURE_SWIFT)
457+ OBJECT)
464458 set (single_parameter_options)
465459 set (multiple_parameter_options
466460 LLVM_LINK_COMPONENTS)
@@ -523,9 +517,7 @@ function(add_swift_host_library name)
523517 if (LLVM_COMMON_DEPENDS)
524518 add_dependencies (${name} ${LLVM_COMMON_DEPENDS} )
525519 endif ()
526- if (NOT ASHL_PURE_SWIFT)
527- llvm_update_compile_flags(${name} )
528- endif ()
520+ llvm_update_compile_flags(${name} )
529521 swift_common_llvm_config(${name} ${ASHL_LLVM_LINK_COMPONENTS} )
530522 set_output_directory(${name}
531523 BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
@@ -584,11 +576,7 @@ function(add_swift_host_library name)
584576 NO_SONAME YES )
585577 endif ()
586578
587- # Always link as CXX even if we have swift content unless we only contain
588- # swift content signaled via us being marked "PURE_SWIFT".
589- if (NOT ASHL_PURE_SWIFT)
590- set_target_properties (${name} PROPERTIES LINKER_LANGUAGE CXX)
591- endif ()
579+ set_target_properties (${name} PROPERTIES LINKER_LANGUAGE CXX)
592580
593581 if (${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
594582 target_link_options (${name} PRIVATE
@@ -598,30 +586,6 @@ function(add_swift_host_library name)
598586 "LINKER:-current_version,${SWIFT_COMPILER_VERSION} " )
599587 endif ()
600588
601- # If we found a swift compiler and are going to use swift code in swift
602- # host side tools but link with clang, add the appropriate -L paths so we
603- # find all of the necessary swift libraries on Darwin.
604- if (NOT ASHL_PURE_SWIFT)
605- if (CMAKE_Swift_COMPILER)
606- # Add in the toolchain directory so we can grab compatibility libraries
607- get_filename_component (TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER} DIRECTORY )
608- get_filename_component (TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR} /../lib/swift/macosx" ABSOLUTE )
609- target_link_directories (${name} PUBLIC ${TOOLCHAIN_LIB_DIR} )
610-
611- # Add in the SDK directory for the host platform.
612- #
613- # NOTE: We do this /after/ target_link_directorying TOOLCHAIN_LIB_DIR to
614- # ensure that we first find libraries from the toolchain, rather than
615- # from the SDK. The reason why this is important is that when we perform
616- # a stage2 build, this path is into the stage1 build. This is not a pure
617- # SDK and also contains compatibility libraries. We need to make sure
618- # that the compiler sees the actual toolchain's compatibility libraries
619- # first before the just built compability libraries or build errors occur.
620- target_link_directories (${name} PRIVATE
621- ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _ARCH_${SWIFT_HOST_VARIANT_ARCH} _PATH}/usr/lib/swift)
622- endif ()
623- endif ()
624-
625589 # For now turn off on Darwin swift targets, debug info if we are compiling a static
626590 # library and set up an rpath so that if someone works around this by using
627591 # shared libraries that in the short term we can find shared libraries.
@@ -947,25 +911,7 @@ function(add_swift_host_tool executable)
947911 set_property (TARGET ${executable} APPEND_STRING PROPERTY
948912 LINK_FLAGS " -lobjc " )
949913
950- else () # ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE
951-
952- # TODO: do we really need this? Do any tools which don't link libswift include other swift code?
953-
954- # Add in the SDK directory for the host platform.
955- #
956- # NOTE: We do this /after/ target_link_directorying TOOLCHAIN_LIB_DIR to
957- # ensure that we first find libraries from the toolchain, rather than from
958- # the SDK.
959- target_link_directories (${executable} PRIVATE "${sdk_dir} " )
960-
961- # We also want to be able to find libraries from the base toolchain
962- # directory. This is so swiftc can rely on its own host side dylibs that may
963- # contain swift content.
964- list (APPEND RPATH_LIST "@executable_path/../lib" )
965-
966- # Also include the abi stable system stdlib in our rpath.
967- list (APPEND RPATH_LIST "/usr/lib/swift" )
968- endif ()
914+ endif () # ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE
969915
970916 set_target_properties (${executable} PROPERTIES
971917 BUILD_WITH_INSTALL_RPATH YES
0 commit comments