mellinoe / ShaderGen

Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
MIT License
497 stars 56 forks source link

Added: code to get active xcode path #85

Closed equinox2k closed 5 years ago

equinox2k commented 6 years ago

I noticed ShaderGen assumed path of Xcode which caused problems on my machine as my Xcode's are installed under Applications as Xcode94.app, Xcode101.app etc

equinox2k commented 6 years ago

I see AppVeyor failed but dont think from what ive done as tested locally

mellinoe commented 6 years ago

This path actually isn't correct on my machine, and I think there may be a better way to find these applications. There is an xcrun utility which has a --find option to help locate things like this, apparently. On my machine, I get this output from the command:

xcrun --find metal
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal
xcrun --find metallib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metallib

xcrun --sdk iphoneos --find metal
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal
xcrun --sdk iphoneos --find metallib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metallib

The last two are the same for me, but I suppose they could be different, depending on the SDK (?)

equinox2k commented 6 years ago

I thought Xcode-select was way to go, maybe In your case you not installed the command line tools. Will look further.

equinox2k commented 5 years ago

@mellinoe see what you think of my latest change :)

mellinoe commented 5 years ago

Unfortunately, the current version isn't working. I got past a couple of initial problems, but the logic to locate metal and metallib isn't correct, at least for my machine. I think the correct way to find the tools is to use xcrun --find as I mentioned above. I am going to try to spend a little bit of time implementing that.

mellinoe commented 5 years ago

I merged in some extra changes on top of this, thanks for working on it!