@@ -477,7 +477,17 @@ function(add_swift_host_library name)
477
477
endif()
478
478
479
479
add_library(${name} ${libkind} ${ASHL_SOURCES} )
480
- add_dependencies(${name} ${LLVM_COMMON_DEPENDS} )
480
+
481
+ # Respect LLVM_COMMON_DEPENDS if it is set.
482
+ #
483
+ # LLVM_COMMON_DEPENDS if a global variable set in ./lib that provides targets
484
+ # such as swift-syntax or tblgen that all LLVM/Swift based tools depend on. If
485
+ # we don't have it defined, then do not add the dependency since some parts of
486
+ # swift host tools do not interact with LLVM/Swift tools and do not define
487
+ # LLVM_COMMON_DEPENDS.
488
+ if (LLVM_COMMON_DEPENDS)
489
+ add_dependencies(${name} ${LLVM_COMMON_DEPENDS} )
490
+ endif()
481
491
if (NOT ASHL_PURE_SWIFT)
482
492
llvm_update_compile_flags(${name} )
483
493
endif()
@@ -628,7 +638,17 @@ function(add_swift_host_tool executable)
628
638
# Force executables linker language to be CXX so that we do not link using the
629
639
# host toolchain swiftc.
630
640
set_target_properties(${executable} PROPERTIES LINKER_LANGUAGE CXX)
631
- add_dependencies(${executable} ${LLVM_COMMON_DEPENDS} )
641
+
642
+ # Respect LLVM_COMMON_DEPENDS if it is set.
643
+ #
644
+ # LLVM_COMMON_DEPENDS if a global variable set in ./lib that provides targets
645
+ # such as swift-syntax or tblgen that all LLVM/Swift based tools depend on. If
646
+ # we don't have it defined, then do not add the dependency since some parts of
647
+ # swift host tools do not interact with LLVM/Swift tools and do not define
648
+ # LLVM_COMMON_DEPENDS.
649
+ if (LLVM_COMMON_DEPENDS)
650
+ add_dependencies(${executable} ${LLVM_COMMON_DEPENDS} )
651
+ endif()
632
652
633
653
set_target_properties(${executable} PROPERTIES
634
654
FOLDER " Swift executables ")
0 commit comments