@@ -428,7 +428,6 @@ endfunction()
428
428
# [SHARED]
429
429
# [STATIC]
430
430
# [OBJECT]
431
- # [PURE_SWIFT]
432
431
# [LLVM_LINK_COMPONENTS comp1 ...]
433
432
# source1 [source2 source3 ...])
434
433
#
@@ -447,18 +446,13 @@ endfunction()
447
446
# LLVM_LINK_COMPONENTS
448
447
# LLVM components this library depends on.
449
448
#
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
- #
454
449
# source1 ...
455
450
# Sources to add into this library.
456
451
function(add_swift_host_library name)
457
452
set(options
458
453
SHARED
459
454
STATIC
460
- OBJECT
461
- PURE_SWIFT)
455
+ OBJECT)
462
456
set(single_parameter_options)
463
457
set(multiple_parameter_options
464
458
LLVM_LINK_COMPONENTS)
@@ -521,9 +515,7 @@ function(add_swift_host_library name)
521
515
if (LLVM_COMMON_DEPENDS)
522
516
add_dependencies(${name} ${LLVM_COMMON_DEPENDS} )
523
517
endif()
524
- if (NOT ASHL_PURE_SWIFT)
525
- llvm_update_compile_flags(${name} )
526
- endif()
518
+ llvm_update_compile_flags(${name} )
527
519
swift_common_llvm_config(${name} ${ASHL_LLVM_LINK_COMPONENTS} )
528
520
set_output_directory(${name}
529
521
BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
@@ -582,11 +574,7 @@ function(add_swift_host_library name)
582
574
NO_SONAME YES)
583
575
endif()
584
576
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)
590
578
591
579
if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
592
580
target_link_options(${name} PRIVATE
@@ -596,30 +584,6 @@ function(add_swift_host_library name)
596
584
" LINKER:-current_version,${SWIFT_COMPILER_VERSION} ")
597
585
endif()
598
586
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
-
623
587
# For now turn off on Darwin swift targets, debug info if we are compiling a static
624
588
# library and set up an rpath so that if someone works around this by using
625
589
# shared libraries that in the short term we can find shared libraries.
@@ -945,25 +909,7 @@ function(add_swift_host_tool executable)
945
909
set_property(TARGET ${executable} APPEND_STRING PROPERTY
946
910
LINK_FLAGS " -lobjc ")
947
911
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
967
913
968
914
set_target_properties(${executable} PROPERTIES
969
915
BUILD_WITH_INSTALL_RPATH YES
0 commit comments