File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed
tools/SourceKit/cmake/modules Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -632,12 +632,13 @@ set(SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
632
632
set (SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib" )
633
633
if ("${SWIFT_NATIVE_SWIFT_TOOLS_PATH} " STREQUAL "" )
634
634
set (SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
635
- set (SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER} " )
636
635
elseif (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*" )
637
636
# If cross-compiling, we don't have to bootstrap. We can just use the previously
638
637
# built native swiftc to build the swift compiler modules.
639
638
message (STATUS "Building swift modules with previously built tools instead of bootstrapping" )
640
- set (SWIFT_EXEC_FOR_SWIFT_MODULES "${SWIFT_NATIVE_SWIFT_TOOLS_PATH} /swiftc" )
639
+ if (NOT "${SWIFT_NATIVE_SWIFT_TOOLS_PATH} /swiftc" STREQUAL "${CMAKE_Swift_COMPILER} " )
640
+ message (FATAL_ERROR "The Swift compiler (${CMAKE_Swift_COMPILER} ) differs from the Swift compiler in SWIFT_NATIVE_SWIFT_TOOLS_PATH (${SWIFT_NATIVE_SWIFT_TOOLS_PATH} /swiftc)." )
641
+ endif ()
641
642
if (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS" )
642
643
set (BOOTSTRAPPING_MODE "CROSSCOMPILE-WITH-HOSTLIBS" )
643
644
elseif (BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING" )
Original file line number Diff line number Diff line change @@ -200,12 +200,12 @@ else()
200
200
201
201
if (${BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE" )
202
202
203
- if (NOT SWIFT_EXEC_FOR_SWIFT_MODULES )
203
+ if (NOT CMAKE_Swift_COMPILER )
204
204
message (FATAL_ERROR "Need a swift toolchain building swift compiler sources" )
205
205
endif ()
206
206
207
207
add_swift_compiler_modules_library (swiftCompilerModules
208
- SWIFT_EXEC "${SWIFT_EXEC_FOR_SWIFT_MODULES } " )
208
+ SWIFT_EXEC "${CMAKE_Swift_COMPILER } " )
209
209
210
210
elseif (${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*" )
211
211
Original file line number Diff line number Diff line change @@ -707,7 +707,7 @@ function(add_swift_host_tool executable)
707
707
708
708
if(BOOTSTRAPPING_MODE STREQUAL " HOSTTOOLS ")
709
709
# Add in the toolchain directory so we can grab compatibility libraries
710
- get_filename_component(TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY)
710
+ get_filename_component(TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER } DIRECTORY)
711
711
get_filename_component(TOOLCHAIN_LIB_DIR " ${TOOLCHAIN_BIN_DIR} /../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} " ABSOLUTE)
712
712
target_link_directories(${executable} PUBLIC ${TOOLCHAIN_LIB_DIR} )
713
713
@@ -788,7 +788,7 @@ function(add_swift_host_tool executable)
788
788
if(${BOOTSTRAPPING_MODE} MATCHES " HOSTTOOLS|CROSSCOMPILE ")
789
789
# At build time and run time, link against the swift libraries in the
790
790
# installed host toolchain.
791
- get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY)
791
+ get_filename_component(swift_bin_dir ${CMAKE_Swift_COMPILER } DIRECTORY)
792
792
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
793
793
set(host_lib_dir " ${swift_dir} /lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} ")
794
794
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function(add_sourcekitd_swifrt_linking target path HAS_SWIFT_MODULES)
35
35
36
36
if (BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" )
37
37
# Add in the toolchain directory so we can grab compatibility libraries
38
- get_filename_component (TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY )
38
+ get_filename_component (TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER } DIRECTORY )
39
39
get_filename_component (TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR} /../lib/swift/macosx" ABSOLUTE )
40
40
target_link_directories (${target} PUBLIC ${TOOLCHAIN_LIB_DIR} )
41
41
@@ -113,7 +113,7 @@ function(add_sourcekitd_swifrt_linking target path HAS_SWIFT_MODULES)
113
113
if (${BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE" )
114
114
# At build time and and run time, link against the swift libraries in the
115
115
# installed host toolchain.
116
- get_filename_component (swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES } DIRECTORY )
116
+ get_filename_component (swift_bin_dir ${CMAKE_Swift_COMPILER } DIRECTORY )
117
117
get_filename_component (swift_dir ${swift_bin_dir} DIRECTORY )
118
118
set (host_lib_dir "${swift_dir} /lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
119
119
You can’t perform that action at this time.
0 commit comments