diff options
Diffstat (limited to 'premake5.lua')
| -rw-r--r-- | premake5.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/premake5.lua b/premake5.lua index 93bbd0569..ec17bd267 100644 --- a/premake5.lua +++ b/premake5.lua @@ -92,11 +92,20 @@ newoption { allowed = { { "true", "True"}, { "false", "False" } } } +newoption { + trigger = "enable-profile", + description = "(Optional) If true will enable slang-profile tool - suitable for gprof usage on linux", + value = "bool", + default = "false", + allowed = { { "true", "True"}, { "false", "False" } } +} + buildLocation = _OPTIONS["build-location"] executeBinary = (_OPTIONS["execute-binary"] == "true") targetDetail = _OPTIONS["target-detail"] buildGlslang = (_OPTIONS["build-glslang"] == "true") enableCuda = (_OPTIONS["enable-cuda"] == "true") +enableProfile = (_OPTIONS["enable-profile"] == "true") -- cudaPath is only set if cuda is enabled, and CUDA_PATH enviromental variable is set cudaPath = nil @@ -734,6 +743,38 @@ standardProject "slang" buildinputs { "%{cfg.targetdir}/slang-generate" .. executableSuffix } end +if enableProfile then + tool "slang-profile" + uuid "375CC87D-F34A-4DF1-9607-C5C990FD6227" + + -- gprof needs symbols + symbols "On" + + dependson { "slang" } + + includedirs { "external/spirv-headers/include" } + + defines { "SLANG_STATIC" } + + -- The `standardProject` operation already added all the code in + -- `source/slang/*`, but we also want to incldue the umbrella + -- `slang.h` header in this prject, so we do that manually here. + files { "slang.h" } + + files { "source/core/core.natvis" } + + -- Add the slang source + addSourceDir "source/slang" + + includedirs { "." } + links { "core"} + + filter { "system:linux" } + linkoptions{ "-pg" } + buildoptions{ "-pg" } + +end + if buildGlslang then -- |
