[CMake] XCode generator and .metal shader files

Gregor Jasny gjasny at googlemail.com
Tue Jul 26 19:03:12 EDT 2016


Hello,

On 22/07/16 23:07, Victor Rykov wrote:
> After adding a .metal file to a target via add_executable the metal file
> does not get pushed to the generated project`s Compile Sources queue and
> subsequently does not compile during project build unless I add the file to
> the queue manually from Xcode, I`ve tried setting compile flags on the
> .metal file as I`ve seen people mention that it works:
> 
> set(MetalTriangle_SHADERS Shaders.metal)
> 
> set_source_files_properties(${MetalTriangle_SHADERS} PROPERTIES
> COMPILE_FLAGS "-fno-fast-math")
> 
> 
> but unfortunately it did not help, is there any workaround to this problem?

Does it help to set the source files LANGUAGE property to C or C++ via
https://cmake.org/cmake/help/v3.6/prop_sf/LANGUAGE.html ?

Thanks,
Gregor


More information about the CMake mailing list