@@ -698,9 +698,11 @@ function(_compile_swift_files
698
698
699
699
if (SWIFT_ENABLE_MODULE_INTERFACES )
700
700
set (maccatalyst_interface_file "${maccatalyst_module_base} .swiftinterface" )
701
- list (APPEND maccatalyst_module_outputs "${maccatalyst_interface_file} " )
701
+ set (maccatalyst_private_interface_file "${maccatalyst_module_base} .private.swiftinterface" )
702
+ list (APPEND maccatalyst_module_outputs "${maccatalyst_interface_file} " "${maccatalyst_private_interface_file} " )
702
703
else ()
703
704
set (maccatalyst_interface_file )
705
+ set (maccatalyst_private_interface_file )
704
706
endif ()
705
707
706
708
swift_install_in_component (DIRECTORY ${maccatalyst_specific_module_dir}
@@ -824,13 +826,23 @@ function(_compile_swift_files
824
826
list (APPEND maccatalyst_swift_flags
825
827
"-I" "${lib_dir} /${maccatalyst_library_subdir} " )
826
828
set (maccatalyst_swift_module_flags ${swift_module_flags} )
829
+
830
+ # Remove original interface file
827
831
list (FIND maccatalyst_swift_module_flags "${interface_file} " interface_file_index )
828
832
if (NOT interface_file_index EQUAL -1 )
829
833
list (INSERT maccatalyst_swift_module_flags ${interface_file_index} "${maccatalyst_interface_file} " )
830
834
math (EXPR old_interface_file_index "${interface_file_index} + 1" )
831
835
list (REMOVE_AT maccatalyst_swift_module_flags ${old_interface_file_index} )
832
836
endif ()
833
837
838
+ # Remove original private interface
839
+ list (FIND maccatalyst_swift_module_flags "${private_interface_file} " private_interface_file_index )
840
+ if (NOT private_interface_file_index EQUAL -1 )
841
+ list (INSERT maccatalyst_swift_module_flags ${private_interface_file_index} "${maccatalyst_private_interface_file} " )
842
+ math (EXPR old_interface_file_index "${private_interface_file_index} + 1" )
843
+ list (REMOVE_AT maccatalyst_swift_module_flags ${old_interface_file_index} )
844
+ endif ()
845
+
834
846
# We still need to change the main swift flags
835
847
# so we can use the correct modules
836
848
# when building for macOS
0 commit comments