Skip to content

Commit 9cb5948

Browse files
authored
Merge pull request #75983 from etcwilde/ewilde/error-on-missing-compiler
CMake: Improving missing compiler error message
2 parents f81793e + 824c66a commit 9cb5948

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,13 @@ if(SWIFT_INCLUDE_TOOLS AND SWIFT_BUILD_SWIFT_SYNTAX)
968968
if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
969969
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
970970
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
971+
if(NOT CMAKE_Swift_COMPILER)
972+
message(SEND_ERROR "No Swift compiler found.\n"
973+
"Tell CMake where to find the Swift compiler by setting either the "
974+
"environment variable \"SWIFTC\" or the CMake cache entry "
975+
"CMAKE_Swift_COMPILER to the full path of the compiler, or to the "
976+
"compiler name if it is in the PATH")
977+
endif()
971978
endif()
972979
add_definitions(-DSWIFT_BUILD_SWIFT_SYNTAX)
973980
endif()

0 commit comments

Comments
 (0)