How to match XCode's building of a module.swiftmodule/ folder and artifacts?

Hello

TLDR

When compiling a Swift Package for embedding to a target via Xcode, swiftc (presumably?) produces a set of artifacts that I am unable to match when manually invoking swiftc.

For my workflow, i need to manually produce via the swift toolchain (again, presumably via swiftc)

Satin.swiftmodule/

  • arm64-apple-macos.abi.json
  • arm64-apple-macos.swiftdoc
  • arm64-apple-macos.swiftmodule
  • Project/

I am invoking swiftc manually like so:

 swiftc -v \
-emit-library \
-target arm64-apple-macos14.0 \
-module-name Satin \
$(find Sources/Satin -name "*.swift") \
-I ./build \
-L ./build \
-lSatinCore \
-o ./build/libSatin.dylib \
-emit-module-path ./build/Satin.swiftmodule \
-emit-module-interface-path ./build/Satin.swiftinterface \
-Xlinker -rpath -Xlinker @loader_path \
-Xlinker -install_name -Xlinker @rpath/libSatin.dylib \
-Xcc -I./Sources/SatinCore/include \
-Xcc -fmodule-map-file=./Sources/SatinCore/include/SatinCore.modulemap \
-DSWIFT_PACKAGE -j8 \
-framework Metal -framework MetalKit

and this produces the flat file module.

How can I match Xcodes method of compilation myself?

Thank you!

Should be something like:

-emit-module-path ./build/Satin.swiftmodule/arm64-apple-macos.swiftmodule \
-emit-module-interface-path ./build/Satin.swiftmodule/arm64-apple-macos.swiftinterface \

Oh! For some reason i thought it was more involved, but this appears to just work!

Thank you for the prompt response!

Separately, I would look into the custom toolset support in SwiftPM to avoid having to manually invoke swiftc to match SwiftPM. I found that it works pretty well for my GameBoy Advance implementation