diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b86617f1f..1b8ae0d8f 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1031,9 +1031,19 @@ SLANG_NO_THROW slang::IModule* SLANG_MCALL Linkage::loadModuleFromSource( { return loadedModule; } + String pathStr = path; + auto pathInfo = PathInfo::makeFromString(pathStr); + if (File::exists(pathStr)) + { + String cannonicalPath; + if (SLANG_SUCCEEDED(Path::getCanonical(pathStr, cannonicalPath))) + { + pathInfo = PathInfo::makeNormal(pathStr, cannonicalPath); + } + } auto module = loadModule( name, - PathInfo::makeFromString(path), + pathInfo, source, SourceLoc(), &sink, |
