1
1
include (SwiftUtils )
2
+ include (SwiftLocalJobPool )
2
3
3
4
# Process the sources within the given variable, pulling out any Swift
4
5
# sources to be compiled with 'swift' directly. This updates
@@ -433,6 +434,7 @@ function(_compile_swift_files
433
434
COMMAND ""
434
435
OUTPUT ${obj_dirs}
435
436
COMMENT "Generating obj dirs for ${first_output} " )
437
+ add_target_to_local_jobpool (${obj_dirs_dependency_target} )
436
438
437
439
# Generate the api notes if we need them.
438
440
if (apinotes_outputs )
@@ -449,6 +451,7 @@ function(_compile_swift_files
449
451
${depends_create_apinotes}
450
452
${obj_dirs_dependency_target}
451
453
COMMENT "Generating API notes ${first_output} " )
454
+ add_target_to_local_jobpool (${api_notes_dependency_target} )
452
455
endif ()
453
456
454
457
# Then we can compile both the object files and the swiftmodule files
@@ -476,6 +479,7 @@ function(_compile_swift_files
476
479
${swift_ide_test_dependency} ${api_notes_dependency_target}
477
480
${obj_dirs_dependency_target}
478
481
COMMENT "Compiling ${first_output} " )
482
+ add_target_to_local_jobpool (${dependency_target} )
479
483
set ("${dependency_target_out_var_name} " "${dependency_target} " PARENT_SCOPE )
480
484
481
485
# This is the target to generate:
@@ -511,6 +515,7 @@ function(_compile_swift_files
511
515
${swift_ide_test_dependency} ${api_notes_dependency_target}
512
516
${obj_dirs_dependency_target}
513
517
COMMENT "Generating ${module_file} " )
518
+ add_target_to_local_jobpool (${module_dependency_target} )
514
519
set ("${dependency_module_target_out_var_name} " "${module_dependency_target} " PARENT_SCOPE )
515
520
516
521
# This is the target to generate the .sib files. It is not built by default.
@@ -528,6 +533,7 @@ function(_compile_swift_files
528
533
${obj_dirs_dependency_target}
529
534
COMMENT "Generating ${sib_file} "
530
535
EXCLUDE_FROM_ALL )
536
+ add_target_to_local_jobpool (${sib_dependency_target} )
531
537
set ("${dependency_sib_target_out_var_name} " "${sib_dependency_target} " PARENT_SCOPE )
532
538
533
539
add_custom_command_target (
@@ -544,6 +550,7 @@ function(_compile_swift_files
544
550
${obj_dirs_dependency_target}
545
551
COMMENT "Generating ${sibopt_file} "
546
552
EXCLUDE_FROM_ALL )
553
+ add_target_to_local_jobpool (${sibopt_dependency_target} )
547
554
set ("${dependency_sibopt_target_out_var_name} " "${sibopt_dependency_target} " PARENT_SCOPE )
548
555
549
556
# This is the target to generate the .sibgen files. It is not built by default.
@@ -561,6 +568,7 @@ function(_compile_swift_files
561
568
${obj_dirs_dependency_target}
562
569
COMMENT "Generating ${sibgen_file} "
563
570
EXCLUDE_FROM_ALL )
571
+ add_target_to_local_jobpool (${sibgen_dependency_target} )
564
572
set ("${dependency_sibgen_target_out_var_name} " "${sibgen_dependency_target} " PARENT_SCOPE )
565
573
endif ()
566
574
0 commit comments