diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2023-01-27 20:53:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 11:53:57 -0800 |
| commit | 93a6b6119b6b65c4f6b00ca12d745e21b679c82f (patch) | |
| tree | 53bc1a3360d34ae6d15318eebf07245367387b9d /premake5.lua | |
| parent | 9f6b6fb9f1bdde8ef01640257544f0e3c9db9076 (diff) | |
Add ASAN support + fixes (#2614)
* Add ASAN support to premake
* Fix StringRepresentation when ASAN is enabled
* Fix deep recursion in slang-generate
* Fix hello-world example
* Fix gpu-printing example
* Linux fix
* Try fixing linux
* Add missing include
Diffstat (limited to 'premake5.lua')
| -rw-r--r-- | premake5.lua | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/premake5.lua b/premake5.lua index f3d48f07f..5dd724130 100644 --- a/premake5.lua +++ b/premake5.lua @@ -192,10 +192,18 @@ newoption { } newoption { - trigger = "full-debug-validation", + trigger = "full-debug-validation", description = "(Optional) If true will enable full IR validation in debug build. (SLOW!)", - value = "bool", - default = "false", + value = "bool", + default = "false", + allowed = { { "true", "True"}, { "false", "False" } } +} + +newoption { + trigger = "enable-asan", + description = "(Optional) If true will enable ASAN (address santizier).", + value = "bool", + default = "false", allowed = { { "true", "True"}, { "false", "False" } } } @@ -213,6 +221,7 @@ skipSourceGeneration = (_OPTIONS["skip-source-generation"] == "true") deployLLVM = (_OPTIONS["deploy-slang-llvm"] == "true") deployGLSLang = (_OPTIONS["deploy-slang-glslang"] == "true") fullDebugValidation = (_OPTIONS["full-debug-validation"] == "true") +enableAsan = (_OPTIONS["enable-asan"] == "true") -- If stdlib embedding is enabled, disable stdlib source embedding by default disableStdlibSource = enableEmbedStdLib @@ -571,6 +580,18 @@ function baseSlangProject(name, sourceDir) if not not sourceDir then addSourceDir(sourceDir) end + + -- + -- Enable ASAN (address sanitizer) if requested. + -- + + if enableAsan then + if (targetInfo.isWindows) then + buildoptions { "/fsanitize=address" } + flags { "NoIncrementalLink" } + end + end + end @@ -992,7 +1013,6 @@ tool "gfx" addSourceDir "tools/gfx/d3d" addSourceDir "tools/gfx/d3d11" addSourceDir "tools/gfx/d3d12" - flags { "FatalWarnings" } elseif targetInfo.os == "mingw" or targetInfo.os == "cygwin" then -- Don't support any render techs... elseif os.target() == "macosx" then |
