We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xcode.metal
We can use add_rules("code.metal") rule to compile *.metal files and generate xxx.metallib in target directory
add_rules("code.metal")
target("test") add_rules("xcode.metal") add_files("src/*.metal") add_files("src/*.m") add_frameworks("MetalKit")
xcode.application
this rule also contain xcode.metal rule automatically.
We can also build *.metal files to add it as default.metallib when we build macOS/iOS application.
so we can use default metal library in application.
example project: https://github.com/xmake-io/xmake/blob/dev/tests/projects/objc/metal_app/xmake.lua
add_rules("mode.debug", "mode.release") target("HelloTriangle") add_rules("xcode.application") add_includedirs("Renderer") add_frameworks("MetalKit") add_mflags("-fmodules") add_files("Renderer/*.m", "Renderer/*.metal") if is_plat("macosx") then add_files("Application/main.m") add_files("Application/AAPLViewController.m") add_files("Application/macOS/Info.plist") add_files("Application/macOS/Base.lproj/*.storyboard") add_defines("TARGET_MACOS") add_frameworks("AppKit") elseif is_plat("iphoneos") then add_files("Application/*.m") add_files("Application/iOS/Info.plist") add_files("Application/iOS/Base.lproj/*.storyboard") add_frameworks("UIKit") add_defines("TARGET_IOS") end
$ xmake [ 9%]: compiling.xcode.release Application/iOS/Base.lproj/LaunchScreen.storyboard [ 9%]: compiling.xcode.release Application/iOS/Base.lproj/Main.storyboard [ 9%]: processing.xcode.release Application/iOS/Info.plist [ 18%]: ccache compiling.release Renderer/AAPLRenderer.m [ 18%]: ccache compiling.release Application/AAPLViewController.m [ 18%]: ccache compiling.release Application/AAPLAppDelegate.m [ 18%]: ccache compiling.release Application/main.m [ 18%]: compiling.metal Renderer/AAPLShaders.metal [ 81%]: linking.metal default.metallib [ 81%]: linking.release HelloTriangle [ 90%]: generating.xcode.release HelloTriangle.app [100%]: build ok!
$ xmake run
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Add
xcode.metal
ruleWe can use
add_rules("code.metal")
rule to compile *.metal files and generate xxx.metallib in target directoryImprove
xcode.application
rulethis rule also contain
xcode.metal
rule automatically.We can also build *.metal files to add it as default.metallib when we build macOS/iOS application.
so we can use default metal library in application.
example project: https://github.com/xmake-io/xmake/blob/dev/tests/projects/objc/metal_app/xmake.lua
$ xmake run
The text was updated successfully, but these errors were encountered: