Avatar
できました! ↓みたいな感じでdynamic libraryを作成して swiftc -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -target arm64-apple-macosx13.0 -I /Users/myname/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host -L /Users/myname/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host -emit-library -o /Users/myname/swift-project/work/libMacroDefinition.dylib -parse-as-library -module-name=MacroDefinition /Users/myname/swift-project/work/macro.swift -g -no-toolchain-stdlib-rpath -swift-version 5 -load-plugin-libraryで読み込めました ↓ は swift-frontend scheme の Arguments Passed on Launch の中身です -load-plugin-library /Users/myname/swift-project/work/libMacroDefinition.dylib -parse-as-library -module-name=MacroDefinition -emit-ir test.swift (edited)