From 4f14efc9752d9ebc8538a2e29ed154a00dc99682 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 1 Jun 2022 20:37:43 -0400 Subject: Disable stdlib source via premake (#2259) * #include an absolute path didn't work - because paths were taken to always be relative. * Added ability to compile slang without stdlib source. It's not requried if stdlib is available if embedded, or is a binary on the file system. Co-authored-by: Yong He --- premake5.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index a1661e611..8b4348cfa 100644 --- a/premake5.lua +++ b/premake5.lua @@ -150,15 +150,23 @@ newoption { value = "bool", default = "true", allowed = { { "true", "True"}, { "false", "False" } } - } + } - newoption { + newoption { trigger = "enable-experimental-projects", description = "(Optional) If true include experimental projects in build.", value = "bool", default = "false", allowed = { { "true", "True"}, { "false", "False" } } - } + } + + newoption { + trigger = "disable-stdlib-source", + description = "(Optional) If true stdlib source will not be included in binary.", + value = "bool", + default = "false", + allowed = { { "true", "True"}, { "false", "False" } } + } buildLocation = _OPTIONS["build-location"] executeBinary = (_OPTIONS["execute-binary"] == "true") @@ -171,6 +179,8 @@ newoption { enableEmbedStdLib = (_OPTIONS["enable-embed-stdlib"] == "true") enableXlib = (_OPTIONS["enable-xlib"] == "true") enableExperimental = (_OPTIONS["enable-experimental-projects"] == "true") + disableStdlibSource = (_OPTIONS["disable-stdlib-source"] == "true") + -- Determine the target info targetInfo = slangUtil.getTargetInfo() @@ -1304,6 +1314,10 @@ tool "slangd" -- defines { "SLANG_DYNAMIC_EXPORT" } + if disableStdlibSource then + defines { "SLANG_DISABLE_STDLIB_SOURCE" } + end + if enableEmbedStdLib then -- We only have this dependency if we are embedding stdlib dependson { "embed-stdlib-generator" } -- cgit v1.2.3