@@ -12,22 +12,6 @@ set(SWIFTLIB_DIR
12
12
set (SWIFTSTATICLIB_DIR
13
13
"${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib/swift_static" )
14
14
15
- function (add_dependencies_multiple_targets )
16
- cmake_parse_arguments (
17
- ADMT # prefix
18
- "" # options
19
- "" # single-value args
20
- "TARGETS;DEPENDS" # multi-value args
21
- ${ARGN} )
22
- precondition (ADMT_UNPARSED_ARGUMENTS NEGATE MESSAGE "unrecognized arguments: ${ADMT_UNPARSED_ARGUMENTS} " )
23
-
24
- if (NOT "${ADMT_DEPENDS} " STREQUAL "" )
25
- foreach (target ${ADMT_TARGETS} )
26
- add_dependencies ("${target} " ${ADMT_DEPENDS} )
27
- endforeach ()
28
- endif ()
29
- endfunction ()
30
-
31
15
function (_compute_lto_flag option out_var )
32
16
string (TOLOWER "${option} " lowercase_option )
33
17
if (lowercase_option STREQUAL "full" )
@@ -522,6 +506,7 @@ function(_add_swift_host_library_single target)
522
506
523
507
add_library ("${target} " ${libkind} ${ASHLS_SOURCES} )
524
508
_set_target_prefix_and_suffix ("${target} " "${libkind} " "${SWIFT_HOST_VARIANT_SDK} " )
509
+ add_dependencies (${target} ${LLVM_COMMON_DEPENDS} )
525
510
526
511
if (SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS )
527
512
swift_windows_include_for_arch (${SWIFT_HOST_VARIANT_ARCH} SWIFTLIB_INCLUDE )
@@ -562,13 +547,6 @@ function(_add_swift_host_library_single target)
562
547
set_target_properties ("${target} " PROPERTIES BUILD_WITH_INSTALL_RPATH YES )
563
548
set_target_properties ("${target} " PROPERTIES FOLDER "Swift libraries" )
564
549
565
- # Handle linking and dependencies.
566
- add_dependencies_multiple_targets (
567
- TARGETS "${target} "
568
- DEPENDS
569
- ${gyb_dependency_targets}
570
- ${LLVM_COMMON_DEPENDS} )
571
-
572
550
# Call llvm_config() only for libraries that are part of the compiler.
573
551
swift_common_llvm_config ("${target} " ${ASHLS_LLVM_LINK_COMPONENTS} )
574
552
@@ -731,6 +709,7 @@ function(add_swift_host_tool executable)
731
709
_add_host_variant_link_flags (${executable} )
732
710
target_link_directories (${executable} PRIVATE
733
711
${SWIFTLIB_DIR} /${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} )
712
+ add_dependencies (${executable} ${LLVM_COMMON_DEPENDS} )
734
713
735
714
set_target_properties (${executable} PROPERTIES
736
715
FOLDER "Swift executables" )
@@ -744,9 +723,6 @@ function(add_swift_host_tool executable)
744
723
INSTALL_RPATH "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}" )
745
724
endif ()
746
725
747
- add_dependencies_multiple_targets (
748
- TARGETS ${executable}
749
- DEPENDS ${LLVM_COMMON_DEPENDS} )
750
726
llvm_update_compile_flags (${executable} )
751
727
swift_common_llvm_config (${executable} ${ASHT_LLVM_LINK_COMPONENTS} )
752
728
set_output_directory (${executable}
0 commit comments