Skip to content

Commit 9017ef5

Browse files
committed
[CMake] Update for review comments
1 parent 0f0c492 commit 9017ef5

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,9 @@ if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
955955
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})
956956

957957
if(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
958-
message(FATAL_ERROR "Only BOOTSTRAPPING=HOSTTOOLS is supported in Linux when Swift parser integration is enabled")
958+
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
959+
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
960+
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
959961
endif()
960962
endif()
961963
endif()

cmake/modules/AddPureSwift.cmake

+6-7
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,20 @@ endfunction()
6767

6868
function(_set_pure_swift_link_flags name relpath_to_lib_dir)
6969
if(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX")
70-
# Don't add builder's stdlib RPATH automatically, because we want to *de-prioritize* it.
70+
# Don't add builder's stdlib RPATH automatically.
7171
target_compile_options(${name} PRIVATE
7272
$<$<COMPILE_LANGUAGE:Swift>:-no-toolchain-stdlib-rpath>
7373
)
7474

75-
get_filename_component(swift_bin_dir ${CMAKE_Swift_COMPILER} DIRECTORY)
76-
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
77-
set(host_lib_dir "${swift_dir}/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
78-
7975
set_property(TARGET ${name}
8076
APPEND PROPERTY INSTALL_RPATH
81-
# At runtime, use swiftCore in the current toolchain.
77+
# At runtime, use swiftCore in the current just-built toolchain.
78+
# NOTE: This relies on the ABI being the same as the builder.
8279
"$ORIGIN/${relpath_to_lib_dir}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}"
8380
)
84-
81+
# NOTE: At this point we don't have any pure swift executables/shared
82+
# libraries required for building runtime/stdlib. So we don't need to add
83+
# RPATH to the builder's runtime.
8584
endif()
8685
endfunction()
8786

tools/driver/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
2626
HAS_SWIFT_MODULES
2727
BOOTSTRAPPING 0
2828
THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY
29-
REQUIRED_FOR_MINIMAL_COMPILER
3029
)
3130
target_link_libraries(swift-frontend-bootstrapping0
3231
PRIVATE
@@ -48,7 +47,6 @@ if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
4847
HAS_SWIFT_MODULES
4948
BOOTSTRAPPING 1
5049
THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY
51-
REQUIRED_FOR_MINIMAL_COMPILER
5250
)
5351
target_link_libraries(swift-frontend-bootstrapping1
5452
PRIVATE

utils/build-presets.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ install-lldb
859859
install-llbuild
860860
install-swiftpm
861861
install-swift-driver
862+
install-swiftsyntax
862863
install-xctest
863864
install-libicu
864865
install-prefix=/usr
@@ -889,8 +890,6 @@ installable-package=%(installable_package)s
889890
# in Linux CI bots
890891
relocate-xdg-cache-home-under-build-subdir
891892

892-
# Linux only support 'hosttools' with early-swiftsyntax.
893-
bootstrapping=hosttools
894893

895894
[preset: buildbot_linux_base]
896895
mixin-preset=

utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ def should_install(self, host_target):
7979

8080
def install(self, host_target):
8181
# No-op.
82-
None
82+
pass

0 commit comments

Comments
 (0)