Skip to content

Commit 33ad3be

Browse files
committed
build: avoid generator expression usage for compiler swap
When using the monorepo, it seems that even if Swift is built standalone, we would see the target as imported and attempt to use the generator expression, which would not resolve.
1 parent ea4524c commit 33ad3be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/modules/SwiftWindowsSupport.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ endfunction()
8484
macro(swift_swap_compiler_if_needed target)
8585
if(NOT CMAKE_C_COMPILER_ID MATCHES Clang)
8686
if(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
87-
get_target_property(IMPORTED clang IMPORTED)
88-
if(IMPORTED)
89-
set(CLANG_LOCATION $<TARGET_FILE_DIR:clang>)
87+
if(SWIFT_BUILT_STANDALONE)
88+
get_target_property(CLANG_LOCATION clang LOCATION)
89+
get_filename_component(CLANG_LOCATION ${CLANG_LOCATION} DIRECTORY)
9090
else()
9191
set(CLANG_LOCATION ${LLVM_RUNTIME_OUTPUT_INTDIR})
9292
endif()

0 commit comments

Comments
 (0)