summaryrefslogtreecommitdiff
path: root/tools/slang-embed/slang-embed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/slang-embed/slang-embed.cpp')
-rw-r--r--tools/slang-embed/slang-embed.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/slang-embed/slang-embed.cpp b/tools/slang-embed/slang-embed.cpp
index 4a81c1b95..7fb865eee 100644
--- a/tools/slang-embed/slang-embed.cpp
+++ b/tools/slang-embed/slang-embed.cpp
@@ -18,7 +18,7 @@
#include "../../source/core/slang-string.h"
#include "../../source/core/slang-string-util.h"
#include "../../source/core/slang-io.h"
-
+#include "../../source/core/slang-dictionary.h"
// Utility to free pointers on scope exit
struct ScopedMemory
@@ -59,6 +59,7 @@ struct App
{
char const* appName = "slang-embed";
char const* inputPath = nullptr;
+ Slang::HashSet<Slang::String> includedFiles;
void parseOptions(int argc, char** argv)
{
@@ -89,6 +90,13 @@ struct App
{
using namespace Slang;
+ String canonicalPath;
+ if (SLANG_SUCCEEDED(Slang::Path::getCanonical(inputPath, canonicalPath)))
+ {
+ if (!includedFiles.Add(canonicalPath))
+ return;
+ }
+
// We open the input file in text mode because we are currently
// embedding textual source files. If/when this utility gets
// used for binary files another mode could be called for.