@@ -317,6 +317,7 @@ function(_compile_swift_files
317
317
set (sibopt_file "${module_base} .O.sib" )
318
318
set (sibgen_file "${module_base} .sibgen" )
319
319
set (module_doc_file "${module_base} .swiftdoc" )
320
+ set (interface_file "${module_base} .swiftinterface" )
320
321
321
322
list (APPEND command_create_dirs
322
323
COMMAND "${CMAKE_COMMAND} " -E make_directory "${module_dir} " )
@@ -395,7 +396,7 @@ function(_compile_swift_files
395
396
396
397
set (standard_outputs ${SWIFTFILE_OUTPUT} )
397
398
set (apinotes_outputs ${apinote_files} )
398
- set (module_outputs "${module_file} " "${module_doc_file} " )
399
+ set (module_outputs "${module_file} " "${module_doc_file} " " ${interface_file} " )
399
400
set (sib_outputs "${sib_file} " )
400
401
set (sibopt_outputs "${sibopt_file} " )
401
402
set (sibgen_outputs "${sibgen_file} " )
@@ -483,13 +484,14 @@ function(_compile_swift_files
483
484
#
484
485
# 1. *.swiftmodule
485
486
# 2. *.swiftdoc
486
- # 3. *.Onone.sib
487
- # 4. *.O.sib
488
- # 5. *.sibgen
487
+ # 3. *.swiftinterface
488
+ # 4. *.Onone.sib
489
+ # 5. *.O.sib
490
+ # 6. *.sibgen
489
491
#
490
- # Only 1,2 are built by default. 3, 4,5 are utility targets for use by engineers
491
- # and thus even though the targets are generated, the targets are not built by
492
- # default.
492
+ # Only 1,2,3 are built by default. 4,5,6 are utility targets for use by
493
+ # engineers and thus even though the targets are generated, the targets are
494
+ # not built by default.
493
495
#
494
496
# We only build these when we are not producing a main file. We could do this
495
497
# with sib/sibgen, but it is useful for looking at the stdlib.
@@ -500,10 +502,12 @@ function(_compile_swift_files
500
502
"${CMAKE_COMMAND} " "-E" "remove" "-f" "${module_file} "
501
503
COMMAND
502
504
"${CMAKE_COMMAND} " "-E" "remove" "-f" "${module_doc_file} "
505
+ COMMAND
506
+ "${CMAKE_COMMAND} " "-E" "remove" "-f" "${interface_file} "
503
507
COMMAND
504
508
"${PYTHON_EXECUTABLE} " "${line_directive_tool} " "@${file_path} " --
505
- "${swift_compiler_tool} " "-emit-module" "-o" "${module_file} " ${swift_flags}
506
- "@${file_path} "
509
+ "${swift_compiler_tool} " "-emit-module" "-o" "${module_file} "
510
+ "-experimental-emit-interface" ${swift_flags} " @${file_path} "
507
511
${command_touch_module_outputs}
508
512
OUTPUT ${module_outputs}
509
513
DEPENDS
0 commit comments