premake-core
premake-core copied to clipboard
CMake generator expression equivalent?
Hi all,
I have this command here that I want to run in a build rule
vendor/shader-compiling/fxc.exe /nologo /Emain /Tvs_5_0 /Od /Zi /Fo assets/shaders/hlsl/%(Filename)_vs.cso /Fd %{cfg.buildtarget.directory}/%(Filename)_vs.pdb assets/shaders/hlsl/%(Filename)_vs.hlsl
and in release mode I want to not include the /Od
option. In CMake I would use a generator expression: $<$<CONFIG:Debug>:/Od>
How would I achieve the same thing in premake?
Thanks in advance.
propertydefinition
might help, something along:
propertydefinition {
name = "ShaderOptimizationLevel",
display = "Shader Optimization Level",
value = false,
switch = "/Od"}
And
buildcommand "vendor/shader-compiling/fxc.exe [ShaderOptimizationLevel] .."
and finally:
filter "configurations:Debug"
ShaderOptimizationLevel = true
filter {}
Just wanted to poke on this and see if the suggestion does what you need it to, or if we should leave the issue open.