@@ -630,7 +630,7 @@ macro(add_swift_lib_subdirectory name)
630630endmacro ()
631631
632632function (add_swift_host_tool executable)
633- set (options HAS_LIBSWIFT )
633+ set (options HAS_SWIFT_MODULES )
634634 set (single_parameter_options SWIFT_COMPONENT BOOTSTRAPPING)
635635 set (multiple_parameter_options LLVM_LINK_COMPONENTS)
636636
@@ -696,11 +696,11 @@ function(add_swift_host_tool executable)
696696 # If we found a swift compiler and are going to use swift code in swift
697697 # host side tools but link with clang, add the appropriate -L paths so we
698698 # find all of the necessary swift libraries on Darwin.
699- if (ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE )
699+ if (ASHT_HAS_SWIFT_MODULES AND BOOTSTRAPPING_MODE )
700700
701- if (LIBSWIFT_BUILD_MODE STREQUAL "HOSTTOOLS" )
701+ if (BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" )
702702 # Add in the toolchain directory so we can grab compatibility libraries
703- get_filename_component (TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_LIBSWIFT } DIRECTORY )
703+ get_filename_component (TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY )
704704 get_filename_component (TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR} /../lib/swift/macosx" ABSOLUTE )
705705 target_link_directories (${executable} PUBLIC ${TOOLCHAIN_LIB_DIR} )
706706
@@ -710,7 +710,7 @@ function(add_swift_host_tool executable)
710710 # Include the abi stable system stdlib in our rpath.
711711 list (APPEND RPATH_LIST "/usr/lib/swift" )
712712
713- elseif (LIBSWIFT_BUILD_MODE STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS" )
713+ elseif (BOOTSTRAPPING_MODE STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS" )
714714
715715 # Intentinally don't add the lib dir of the cross-compiled compiler, so that
716716 # the stdlib is not picked up from there, but from the SDK.
@@ -726,7 +726,7 @@ function(add_swift_host_tool executable)
726726 # Include the abi stable system stdlib in our rpath.
727727 list (APPEND RPATH_LIST "/usr/lib/swift" )
728728
729- elseif (LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS" )
729+ elseif (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS" )
730730 # Add the SDK directory for the host platform.
731731 target_link_directories (${executable} PRIVATE "${sdk_dir} " )
732732
@@ -737,7 +737,7 @@ function(add_swift_host_tool executable)
737737 # Include the abi stable system stdlib in our rpath.
738738 list (APPEND RPATH_LIST "/usr/lib/swift" )
739739
740- elseif (LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING" )
740+ elseif (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING" )
741741 # At build time link against the built swift libraries from the
742742 # previous bootstrapping stage.
743743 get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING} " )
@@ -751,7 +751,7 @@ function(add_swift_host_tool executable)
751751 # bootstrapping stage.
752752 list (APPEND RPATH_LIST "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
753753 else ()
754- message (FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE } '" )
754+ message (FATAL_ERROR "Unknown BOOTSTRAPPING_MODE '${BOOTSTRAPPING_MODE } '" )
755755 endif ()
756756
757757 # Workaround to make lldb happy: we have to explicitly add all swift compiler modules
@@ -770,26 +770,26 @@ function(add_swift_host_tool executable)
770770 set_property (TARGET ${executable} APPEND_STRING PROPERTY
771771 LINK_FLAGS " -lobjc " )
772772
773- endif () # ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE
773+ endif () # ASHT_HAS_SWIFT_MODULES AND BOOTSTRAPPING_MODE
774774
775775 set_target_properties (${executable} PROPERTIES
776776 BUILD_WITH_INSTALL_RPATH YES
777777 INSTALL_RPATH "${RPATH_LIST} " )
778778
779- elseif (SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD" AND ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE )
779+ elseif (SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD" AND ASHT_HAS_SWIFT_MODULES AND BOOTSTRAPPING_MODE )
780780 set (swiftrt "swiftImageRegistrationObject${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _OBJECT_FORMAT}-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH} " )
781- if (${LIBSWIFT_BUILD_MODE } MATCHES "HOSTTOOLS|CROSSCOMPILE" )
781+ if (${BOOTSTRAPPING_MODE } MATCHES "HOSTTOOLS|CROSSCOMPILE" )
782782 # At build time and and run time, link against the swift libraries in the
783783 # installed host toolchain.
784- get_filename_component (swift_bin_dir ${SWIFT_EXEC_FOR_LIBSWIFT } DIRECTORY )
784+ get_filename_component (swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY )
785785 get_filename_component (swift_dir ${swift_bin_dir} DIRECTORY )
786786 set (host_lib_dir "${swift_dir} /lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
787787
788788 target_link_libraries (${executable} PRIVATE ${swiftrt} )
789789 target_link_libraries (${executable} PRIVATE "swiftCore" )
790790
791791 target_link_directories (${executable} PRIVATE ${host_lib_dir} )
792- if (LIBSWIFT_BUILD_MODE STREQUAL "HOSTTOOLS" )
792+ if (BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" )
793793 set_target_properties (${executable} PROPERTIES
794794 BUILD_WITH_INSTALL_RPATH YES
795795 INSTALL_RPATH "${host_lib_dir} " )
@@ -799,7 +799,7 @@ function(add_swift_host_tool executable)
799799 INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
800800 endif ()
801801
802- elseif (LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING" )
802+ elseif (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING" )
803803 # At build time link against the built swift libraries from the
804804 # previous bootstrapping stage.
805805 if (NOT "${ASHT_BOOTSTRAPPING} " STREQUAL "0" )
@@ -815,10 +815,10 @@ function(add_swift_host_tool executable)
815815 BUILD_WITH_INSTALL_RPATH YES
816816 INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
817817
818- elseif (LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS" )
819- message (FATAL_ERROR "LIBSWIFT_BUILD_MODE 'BOOTSTRAPPING-WITH-HOSTLIBS' not supported on Linux" )
818+ elseif (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS" )
819+ message (FATAL_ERROR "BOOTSTRAPPING_MODE 'BOOTSTRAPPING-WITH-HOSTLIBS' not supported on Linux" )
820820 else ()
821- message (FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE } '" )
821+ message (FATAL_ERROR "Unknown BOOTSTRAPPING_MODE '${BOOTSTRAPPING_MODE } '" )
822822 endif ()
823823 endif ()
824824
0 commit comments