summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorlujinwangnv <143145775+lujinwangnv@users.noreply.github.com>2025-05-19 21:38:53 -0700
committerGitHub <noreply@github.com>2025-05-20 00:38:53 -0400
commit1750db9a7d4a3988c182a78f7cc62397792dc06a (patch)
tree63157c05d835fcd6165febc8d093eee216249347 /tools
parent634e3960c2bc322bbd51fccc7ff395d9f24e35dc (diff)
Update build to allow setting external lua path (#7167)
* Update build to allow setting external lua path Update the build to allow setting user-specific path for the external module lua. * T * Fix an include path
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt18
-rw-r--r--tools/slang-fiddle/slang-fiddle-lua.cpp2
2 files changed, 18 insertions, 2 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index d871f91f2..aad87e21d 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -45,7 +45,23 @@ function(generator dir)
endif()
endfunction()
-generator(slang-fiddle LINK_WITH_PRIVATE compiler-core)
+if(NOT SLANG_OVERRIDE_LUA_PATH)
+ generator(
+ slang-fiddle
+ LINK_WITH_PRIVATE
+ compiler-core
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${slang_SOURCE_DIR}/external/lua
+ )
+else()
+ generator(
+ slang-fiddle
+ LINK_WITH_PRIVATE
+ compiler-core
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${SLANG_OVERRIDE_LUA_PATH}
+ )
+endif()
generator(slang-embed)
generator(slang-generate USE_FEWER_WARNINGS)
generator(slang-lookup-generator LINK_WITH_PRIVATE compiler-core)
diff --git a/tools/slang-fiddle/slang-fiddle-lua.cpp b/tools/slang-fiddle/slang-fiddle-lua.cpp
index f6ba36357..0d5f04eca 100644
--- a/tools/slang-fiddle/slang-fiddle-lua.cpp
+++ b/tools/slang-fiddle/slang-fiddle-lua.cpp
@@ -2,4 +2,4 @@
#define MAKE_LIB 1
-#include "../external/lua/onelua.c"
+#include "onelua.c"