diff --git a/CMakeLists.txt b/CMakeLists.txt index a3c5de36220db..586d1d05aea19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,6 +190,8 @@ cmake_dependent_option(LIBSWIFT_BUILD_MODE "How to build libswift. Possible valu BOOTSTRAPPING: libswift is built with a 2-stage bootstrapping process BOOTSTRAPPING-WITH-HOSTLIBS: libswift is built with a 2-stage bootstrapping process, but the compiler links against the host system swift libs (macOS only) + CROSSCOMPILE: libswift is built with a bootstrapping compiled compiler, provided in + `SWIFT_NATIVE_SWIFT_TOOLS_PATH` CROSSCOMPILE-WITH-HOSTLIBS: libswift is built with a bootstrapping-with-hostlibs compiled compiler, provided in `SWIFT_NATIVE_SWIFT_TOOLS_PATH`" OFF "NOT CMAKE_GENERATOR STREQUAL \"Xcode\"" OFF) @@ -610,6 +612,8 @@ elseif(LIBSWIFT_BUILD_MODE MATCHES "BOOTSTRAPPING.*") set(SWIFT_EXEC_FOR_LIBSWIFT "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc") if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS") set(LIBSWIFT_BUILD_MODE "CROSSCOMPILE-WITH-HOSTLIBS") + elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING") + set(LIBSWIFT_BUILD_MODE "CROSSCOMPILE") else() set(LIBSWIFT_BUILD_MODE "HOSTTOOLS") endif() diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index dfddb8eb297ed..ca427c187ff17 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -738,6 +738,8 @@ function(add_libswift name) # The compiler will instead pick up the stdlib from the SDK. get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY) set(sdk_option ${sdk_option} "-resource-dir" "${swift_exec_bin_dir}/../bootstrapping0/lib/swift") + elseif(${LIBSWIFT_BUILD_MODE} STREQUAL "CROSSCOMPILE") + set(sdk_option ${sdk_option} "-resource-dir" "${build_dir}/../bootstrapping1/lib/swift") endif() endif() get_versioned_target_triple(target ${SWIFT_HOST_VARIANT_SDK} @@ -789,7 +791,6 @@ function(add_libswift name) # Create a static libswift library containing all module object files. add_library(${name} STATIC ${all_obj_files}) set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) - set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name}) endfunction() macro(add_swift_tool_subdirectory name) @@ -917,19 +918,7 @@ function(add_swift_host_tool executable) # Include the abi stable system stdlib in our rpath. list(APPEND RPATH_LIST "/usr/lib/swift") - elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING") - # Pick up the built libswiftCompatibility.a libraries - _link_built_compatibility_libs(${executable}) - - # At build time link against the built swift libraries from the - # previous bootstrapping stage. - get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING}") - target_link_directories(${executable} PRIVATE ${bs_lib_dir}) - - # At runtime link against the built swift libraries from the current - # bootstrapping stage. - list(APPEND RPATH_LIST "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}") - else() + elseif(NOT LIBSWIFT_BUILD_MODE MATCHES "CROSSCOMPILE|BOOTSTRAPPING") message(FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE}'") endif() @@ -991,24 +980,19 @@ function(add_swift_host_tool executable) INSTALL_RPATH "${host_lib_dir}") elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING") - # At build time link against the built swift libraries from the - # previous bootstrapping stage. if (NOT "${ASHT_BOOTSTRAPPING}" STREQUAL "0") - get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING}") - target_link_directories(${executable} PRIVATE ${bs_lib_dir}) target_link_libraries(${executable} PRIVATE ${swiftrt}) - target_link_libraries(${executable} PRIVATE "swiftCore") + if(SWIFT_PATH_TO_LIBICU_BUILD) + set(icu_dir "${SWIFT_PATH_TO_LIBICU_BUILD}/lib") + target_link_libraries(${executable} PRIVATE + ${icu_dir}/libicui18nswift.a + ${icu_dir}/libicuucswift.a + ${icu_dir}/libicudataswift.a) + endif() endif() - - # At runtime link against the built swift libraries from the current - # bootstrapping stage. - set_target_properties(${executable} PROPERTIES - BUILD_WITH_INSTALL_RPATH YES - INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SDK_LINUX_LIB_SUBDIR}") - elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS") message(FATAL_ERROR "LIBSWIFT_BUILD_MODE 'BOOTSTRAPPING-WITH-HOSTLIBS' not supported on Linux") - else() + elseif(NOT LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING") message(FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE}'") endif() endif() diff --git a/cmake/modules/SwiftUtils.cmake b/cmake/modules/SwiftUtils.cmake index 0754cb41c66ee..5e955ee54d613 100644 --- a/cmake/modules/SwiftUtils.cmake +++ b/cmake/modules/SwiftUtils.cmake @@ -98,7 +98,7 @@ function(get_bootstrapping_swift_lib_dir bs_lib_dir bootstrapping) set(bs_lib_dir "") if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING") set(lib_dir - "${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}") + "${SWIFTSTATICLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}") # If building the stdlib with bootstrapping, the compiler has to pick up # the libswift of the previous bootstrapping level (because in the current # lib-directory it's not built yet. diff --git a/libswift/CMakeLists.txt b/libswift/CMakeLists.txt index bc462fe3582b3..b7bd5f1dc2bef 100644 --- a/libswift/CMakeLists.txt +++ b/libswift/CMakeLists.txt @@ -20,44 +20,54 @@ else() add_subdirectory(Sources) - if(${LIBSWIFT_BUILD_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE-WITH-HOSTLIBS") + set(bs1_libs) + set(final_libs) + if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING|CROSSCOMPILE") + set(bs1_libs ${bs1_libs} swiftCore-bootstrapping0-static) + set(final_libs ${final_libs} swiftCore-bootstrapping1-static) + set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS swiftCore-bootstrapping1-static) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(bs1_libs ${bs1_libs} swiftOnoneSupport-bootstrapping0-static) + set(final_libs ${final_libs} swiftOnoneSupport-bootstrapping1-static) + set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS swiftSwiftOnoneSupport-bootstrapping1-static) + endif() + if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) + set(bs1_libs ${bs1_libs} swiftDarwin-bootstrapping0-static) + set(final_libs ${final_libs} swiftDarwin-bootstrapping1-static) + set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS swiftDarwin-bootstrapping1-static) + endif() + endif() + + + if(${LIBSWIFT_BUILD_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE.*") if (NOT SWIFT_EXEC_FOR_LIBSWIFT) message(FATAL_ERROR "Need a swift toolchain for building libswift") endif() - + add_libswift("libswift" - SWIFT_EXEC "${SWIFT_EXEC_FOR_LIBSWIFT}") + SWIFT_EXEC "${SWIFT_EXEC_FOR_LIBSWIFT}" + DEPENDS ${final_libs}) - elseif(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*") + target_link_libraries(libswift PUBLIC ${final_libs}) - set(b0_deps swift-frontend-bootstrapping0 symlink-headers-bootstrapping0) - set(b1_deps swift-frontend-bootstrapping1 symlink-headers-bootstrapping1) - if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING") - set(b0_deps ${b0_deps} swiftCore-bootstrapping0) - set(b1_deps ${b1_deps} swiftCore-bootstrapping1) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(b0_deps ${b0_deps} swiftOnoneSupport-bootstrapping0) - set(b1_deps ${b1_deps} swiftOnoneSupport-bootstrapping1) - endif() - if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - set(b0_deps ${b0_deps} swiftDarwin-bootstrapping0) - set(b1_deps ${b1_deps} swiftDarwin-bootstrapping1) - endif() - endif() + elseif(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*") # Bootstrapping - stage 1, using the compiler from level 0 add_libswift("libswift-bootstrapping1" SWIFT_EXEC "${CMAKE_BINARY_DIR}/bootstrapping0/bin/swiftc" - DEPENDS ${b0_deps} + DEPENDS swift-frontend-bootstrapping0 symlink-headers-bootstrapping0 ${bs1_libs} BOOTSTRAPPING 1) # The final build, using the compiler from stage 1 add_libswift("libswift" SWIFT_EXEC "${CMAKE_BINARY_DIR}/bootstrapping1/bin/swiftc" - DEPENDS ${b1_deps}) + DEPENDS swift-frontend-bootstrapping0 symlink-headers-bootstrapping0 ${final_libs}) + + target_link_libraries(libswift-bootstrapping1 PUBLIC ${bs1_libs}) + target_link_libraries(libswift PUBLIC ${final_libs}) if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS") file(GLOB module_dirs "${CMAKE_BINARY_DIR}/bootstrapping*/lib/swift/macosx/*.swiftmodule") @@ -69,5 +79,7 @@ else() else() message(FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE}'") endif() + + set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS libswift) endif() diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 781c9d4610c8e..3398af2ccb584 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -487,7 +487,9 @@ function(_compile_swift_files endif() if(SWIFTFILE_IS_SDK_OVERLAY) - list(APPEND swift_flags "-autolink-force-load") + if("${SWIFTFILE_BOOTSTRAPPING}" STREQUAL "") + list(APPEND swift_flags "-autolink-force-load") + endif() endif() # Don't need to link runtime compatibility libraries for older runtimes @@ -538,6 +540,7 @@ function(_compile_swift_files set(interface_file_static) get_bootstrapping_path(lib_dir ${SWIFTLIB_DIR} "${SWIFTFILE_BOOTSTRAPPING}") + get_bootstrapping_path(static_lib_dir ${SWIFTSTATICLIB_DIR} "${SWIFTFILE_BOOTSTRAPPING}") if(NOT SWIFTFILE_IS_MAIN) # Determine the directory where the module file should be placed. @@ -553,7 +556,7 @@ function(_compile_swift_files set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}") - set(module_dir_static "${SWIFTSTATICLIB_DIR}/${library_subdir}") + set(module_dir_static "${static_lib_dir}/${library_subdir}") set(module_base_static "${module_dir_static}/${SWIFTFILE_MODULE_NAME}") set(module_triple ${SWIFT_SDK_${library_subdir_sdk}_ARCH_${SWIFTFILE_ARCHITECTURE}_MODULE}) @@ -690,11 +693,11 @@ function(_compile_swift_files else() set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc${HOST_EXECUTABLE_SUFFIX}") - get_bootstrapping_path(swift_compiler_tool - "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc${HOST_EXECUTABLE_SUFFIX}" - "${SWIFTFILE_BOOTSTRAPPING}") + if(NOT ${SWIFTFILE_BOOTSTRAPPING} STREQUAL "" AND NOT ${LIBSWIFT_BUILD_MODE} MATCHES "CROSSCOMPILE.*") + get_bootstrapping_path(swift_compiler_tool + "${swift_compiler_tool}" + "${SWIFTFILE_BOOTSTRAPPING}") - if(NOT ${SWIFTFILE_BOOTSTRAPPING} STREQUAL "") set(target_suffix "-bootstrapping${SWIFTFILE_BOOTSTRAPPING}") endif() @@ -704,7 +707,7 @@ function(_compile_swift_files endif() set(swift_compiler_tool_dep) - if(SWIFT_INCLUDE_TOOLS) + if(SWIFT_INCLUDE_TOOLS AND NOT ${LIBSWIFT_BUILD_MODE} MATCHES "CROSSCOMPILE.*") # Depend on the binary itself, in addition to the symlink. set(swift_compiler_tool_dep "swift-frontend${target_suffix}") endif() @@ -726,23 +729,6 @@ function(_compile_swift_files set(swift_compiler_tool "${SWIFT_SOURCE_DIR}/utils/check-incremental" "${swift_compiler_tool}") endif() - if(SWIFTFILE_IS_STDLIB) - get_bootstrapping_swift_lib_dir(bs_lib_dir "${SWIFTFILE_BOOTSTRAPPING}") - if(bs_lib_dir) - # When building the stdlib with libswift bootstrapping, the compiler needs - # to pick up the stdlib from the previous bootstrapping stage, because the - # stdlib in the current stage is not built yet. - if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_APPLE_PLATFORMS) - set(set_environment_args "${CMAKE_COMMAND}" "-E" "env" "DYLD_LIBRARY_PATH=${bs_lib_dir}") - elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX") - set(set_environment_args "${CMAKE_COMMAND}" "-E" "env" "LD_LIBRARY_PATH=${bs_lib_dir}") - else() - message(FATAL_ERROR "TODO: bootstrapping support for ${SWIFT_HOST_VARIANT_SDK}") - endif() - endif() - - endif() - if (SWIFT_REPORT_STATISTICS) list(GET dirs_to_create 0 first_obj_dir) list(APPEND swift_flags "-stats-output-dir" ${first_obj_dir}) diff --git a/stdlib/public/CMakeLists.txt b/stdlib/public/CMakeLists.txt index 073982e55946a..8b16667c555e9 100644 --- a/stdlib/public/CMakeLists.txt +++ b/stdlib/public/CMakeLists.txt @@ -127,7 +127,8 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR) add_subdirectory(SwiftRemoteMirror) endif() -if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES) +if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES OR + ${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING|CROSSCOMPILE") add_subdirectory(Platform) endif() diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index ec5af3a99c5d1..e07e3a0027e6e 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -42,12 +42,12 @@ set(swiftDarwin_common_options DEPENDS ${darwin_depends}) -if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" AND +if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING|CROSSCOMPILE" AND ${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) set(swiftDarwin_common_bootstrapping_options ${swiftDarwin_common_options} - SHARED + STATIC IS_STDLIB SDK ${SWIFT_HOST_VARIANT_SDK} ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH} @@ -71,6 +71,10 @@ if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" AND BOOTSTRAPPING 1) endif() +if(NOT SWIFT_BUILD_SDK_OVERLAY AND NOT SWIFT_BUILD_TEST_SUPPORT_MODULES) + return() +endif() + add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} ${swiftDarwin_common_options} TARGET_SDKS "${swiftDarwin_target_sdks}" diff --git a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt index 72ab90fa20c68..d95d26f648d1a 100644 --- a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt +++ b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt @@ -10,10 +10,10 @@ set(swiftOnoneSupport_common_options SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "-Xfrontend" "-check-onone-completeness" "-Xfrontend" "-disable-access-control" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}" LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}") -if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING") +if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING|CROSSCOMPILE") set(swiftOnoneSupport_common_bootstrapping_options - SHARED + STATIC ${swiftOnoneSupport_common_options} SDK ${SWIFT_HOST_VARIANT_SDK} ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH} diff --git a/stdlib/public/SwiftShims/CMakeLists.txt b/stdlib/public/SwiftShims/CMakeLists.txt index 9b7dcd50460d7..3c6599258be37 100644 --- a/stdlib/public/SwiftShims/CMakeLists.txt +++ b/stdlib/public/SwiftShims/CMakeLists.txt @@ -1,3 +1,4 @@ + set(sources AssertionReporting.h CoreFoundationShims.h @@ -83,19 +84,21 @@ endif() # First extract the "version" used for Clang's resource directory. string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION "${LLVM_PACKAGE_VERSION}") +if(SWIFT_COMPILER_IS_MSVC_LIKE) + execute_process(COMMAND ${CMAKE_C_COMPILER} /clang:-print-resource-dir + OUTPUT_VARIABLE host_clang_headers_location + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) +else() + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-resource-dir + OUTPUT_VARIABLE host_clang_headers_location + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) +endif() + if(NOT SWIFT_INCLUDE_TOOLS AND (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER OR SWIFT_PREBUILT_CLANG)) - if(SWIFT_COMPILER_IS_MSVC_LIKE) - execute_process(COMMAND ${CMAKE_C_COMPILER} /clang:-print-resource-dir - OUTPUT_VARIABLE clang_headers_location - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET) - else() - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-resource-dir - OUTPUT_VARIABLE clang_headers_location - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET) - endif() + set(clang_headers_location "${host_clang_headers_location}") message(STATUS "Using clang Resource Directory: ${clang_headers_location}") else() set(clang_headers_location "${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}") @@ -156,7 +159,7 @@ if(NOT SWIFT_BUILT_STANDALONE) endforeach() endif() -if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*") +if(${LIBSWIFT_BUILD_MODE} MATCHES "CROSSCOMPILE|BOOTSTRAPPING.*") foreach(bootstrapping "0" "1") get_bootstrapping_path(outdir ${SWIFTLIB_DIR} ${bootstrapping}) set(target_name "symlink-headers-bootstrapping${bootstrapping}") @@ -169,7 +172,7 @@ if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*") ${output_dir} "${outdir}/shims" COMMAND "${CMAKE_COMMAND}" "-E" "${cmake_symlink_option}" - "${clang_headers_location}" + "${host_clang_headers_location}" "${outdir}/clang" CUSTOM_TARGET_NAME ${target_name} diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index 12980fdea992d..087f94ef1e66b 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -338,41 +338,13 @@ set(swiftCore_common_options set(swiftCore_common_dependencies copy_shim_headers "${SWIFTLIB_DIR}/shims" ${GROUP_INFO_JSON_FILE}) -if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING") +if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING|CROSSCOMPILE") set(b0_deps symlink-headers-bootstrapping0) set(b1_deps symlink-headers-bootstrapping1) - if(SWIFT_PATH_TO_LIBICU_BUILD) - foreach(bootstrapping "0" "1") - # Need to symlink the libicu libraries to be able to run - # the bootstrapping compiler with a custom library path. - get_bootstrapping_path(output_dir - "${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" "${bootstrapping}") - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") - message("TODO: support for copying ICU libraries on Windows") - endif() - set(target "symlink-icu-bootstrapping${bootstrapping}") - add_custom_target(${target}) - add_custom_command(TARGET ${target} POST_BUILD - COMMAND - "${CMAKE_COMMAND}" "-E" "make_directory" "${output_dir}" - COMMAND - "ln" "-s" "-f" "${SWIFT_PATH_TO_LIBICU_BUILD}/lib/libicu*" "." - WORKING_DIRECTORY "${output_dir}" - COMMENT "symlink ICU libraries for bootstrapping stage ${bootstrapping}") - endforeach() - set(b0_deps ${b0_deps} symlink-icu-bootstrapping0) - set(b1_deps ${b1_deps} symlink-icu-bootstrapping1) - endif() - - list(FIND SWIFT_STDLIB_LIBRARY_BUILD_TYPES "SHARED" index_of_shared) - if(index_of_shared EQUAL -1) - message(FATAL_ERROR "bootstrapping requires SHARED stdlib build type") - endif() - set(swiftCore_common_bootstrapping_options - SHARED + STATIC ${swiftCore_common_options} SDK ${SWIFT_HOST_VARIANT_SDK} ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}