CoreML not found anymore once I add C++ compile source

I have a small Swift command line tool for MacOS. I have added a small demo CoreML model to the project and can correctly load the model in Swift like let model = try! Matcher_512x256().

However, once I add a single C++ or Objective C file to the Compile Sources of my build target, the compilation fails with an error stating that the model cannot be found: "...ModelAndCpp/ModelAndCpp/main.swift:11:18 Cannot find 'Matcher_512x256' in scope".

Please help me resolve this. Does XCode change into a different "compilation mode" once a C++ file is present which might cause this error? XCode version is 16A242d.

I can reproduce the issue with a tiny repository (5 small files) which I have uploaded here on GitHub. To reproduce the issue, simply remove the .m and .cpp files from Compile Sources to compile correctly, or add one of them to get the error.

Thank you and best regards, Manuel

CoreML not found anymore once I add C++ compile source
 
 
Q