@@ -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}
@@ -825,12 +827,23 @@ function(_compile_swift_files
825
827
"-I" "${lib_dir} /${maccatalyst_library_subdir} " )
826
828
set (maccatalyst_swift_module_flags ${swift_module_flags} )
827
829
list (FIND maccatalyst_swift_module_flags "${interface_file} " interface_file_index )
830
+
831
+ # Remove original interface file
832
+ list (FIND maccatalyst_swift_module_flags "${interface_file} " interface_file_index )
828
833
if (NOT interface_file_index EQUAL -1 )
829
834
list (INSERT maccatalyst_swift_module_flags ${interface_file_index} "${maccatalyst_interface_file} " )
830
835
math (EXPR old_interface_file_index "${interface_file_index} + 1" )
831
836
list (REMOVE_AT maccatalyst_swift_module_flags ${old_interface_file_index} )
832
837
endif ()
833
838
839
+ # Remove original private interface
840
+ list (FIND maccatalyst_swift_module_flags "${private_interface_file} " private_interface_file_index )
841
+ if (NOT private_interface_file_index EQUAL -1 )
842
+ list (INSERT maccatalyst_swift_module_flags ${private_interface_file_index} "${maccatalyst_private_interface_file} " )
843
+ math (EXPR old_interface_file_index "${private_interface_file_index} + 1" )
844
+ list (REMOVE_AT maccatalyst_swift_module_flags ${old_interface_file_index} )
845
+ endif ()
846
+
834
847
# We still need to change the main swift flags
835
848
# so we can use the correct modules
836
849
# when building for macOS
0 commit comments