premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.22k stars 620 forks source link

Metal compiler setup #1487

Open fhoenig opened 4 years ago

fhoenig commented 4 years ago

How would I set up **.metal compiler options for an xcode project? Xcode seems to keep MSL include directories and other options separate from the C compiler.

These following build setting would need to be generated. Where would I start implementing this?

https://xcodebuildsettings.com/#category-metal-opencl

fhoenig commented 4 years ago

I guess this is enough: https://github.com/fhoenig/premake-core/commit/61b25d21e7e57380436942dc825ec53edd29faa4

Then I used: xcodebuildsettings { MTL_HEADER_SEARCH_PATHS = '../External/glm', MTL_FAST_MATH = "YES", MTL_COMPILER_FLAGS = '-fnative-double', }

Is this how this is supposed to be used?

samsinsane commented 4 years ago

That is in the intended use of xcodebuildsettings but we might be able to hook up some of the shader* APIs that exist in the VS module, as well as handling the file extension correctly.