[target.aarch64-apple-darwin] rustflags = [ "-L", "/opt/homebrew/lib", "-l", "c++", # 新增:連結 Metal 相關框架 (解決 Undefined symbols 錯誤) "-framework", "Metal", "-framework", "Foundation", "-framework", "QuartzCore", "-framework", "CoreGraphics" ] # 如果是 Intel Mac,取消下面註解並使用 # [target.x86_64-apple-darwin] # rustflags = [ # "-L", "/usr/local/lib", # "-l", "c++", # "-framework", "Metal", # "-framework", "Foundation", # "-framework", "QuartzCore", # "-framework", "CoreGraphics" # ]