summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index f56395f5b..ab658fe18 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -1488,17 +1488,23 @@ struct OptionsParser
// Seeing as on all targets the baseName doesn't have an extension, and all library types do
// if the name doesn't have an extension we can assume there is no path to it.
- if (Path::getPathExt(path).getLength() > 0)
+ ComPtr<IFileArtifactRepresentation> fileRep;
+ if (Path::getPathExt(path).getLength() <= 0)
{
- // Set the path
- artifact->setPath(Artifact::PathType::Existing, path.getBuffer());
+ // If there is no extension *assume* it is the name of a system level library
+ fileRep = new FileArtifactRepresentation(IFileArtifactRepresentation::Kind::NameOnly, path, nullptr, nullptr);
}
+ else
+ {
+ fileRep = new FileArtifactRepresentation(IFileArtifactRepresentation::Kind::Reference, path, nullptr, nullptr);
+ if (!fileRep->exists())
+ {
+ sink->diagnose(referenceModuleName.loc, Diagnostics::libraryDoesNotExist, path);
+ return SLANG_FAIL;
+ }
+ }
+ artifact->addItem(fileRep);
- // TODO(JS): We might want to check if the artifact exists.
- // If the artifact is a CPU (or downstream compiler) library
- // it may be findable by some other mechanism, so we probably don't want to check existance and just let the
- // downstream compiler handle.
-
SLANG_RETURN_ON_FAIL(_addLibraryReference(requestImpl, artifact));
}
else if (argValue == "-v" || argValue == "-version")