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.cpp53
1 files changed, 18 insertions, 35 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 5918f1551..be88e9d8c 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -65,8 +65,6 @@ struct OptionsParser
Slang::EndToEndCompileRequest* requestImpl = nullptr;
- Slang::RefPtr<Slang::ConfigurableSharedLibraryLoader> sharedLibraryLoader;
-
// A "translation unit" represents one or more source files
// that are processed as a single entity when it comes to
// semantic checking.
@@ -182,15 +180,6 @@ struct OptionsParser
RawTarget defaultTarget;
- void addSharedLibraryPath(SharedLibraryType libType, const String& path)
- {
- if (!sharedLibraryLoader)
- {
- sharedLibraryLoader = new ConfigurableSharedLibraryLoader;
- }
- sharedLibraryLoader->addEntry(libType, ConfigurableSharedLibraryLoader::changePath, path);
- }
-
int addTranslationUnit(
SlangSourceLanguage language,
Stage impliedStage)
@@ -615,25 +604,6 @@ struct OptionsParser
spSetPassThrough(compileRequest, passThrough);
}
- else if (argStr == "-dxc-path")
- {
- String name;
- SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, name));
- addSharedLibraryPath(SharedLibraryType::Dxc, name);
- addSharedLibraryPath(SharedLibraryType::Dxil, name);
- }
- else if (argStr == "-glslang-path")
- {
- String name;
- SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, name));
- addSharedLibraryPath(SharedLibraryType::Glslang, name);
- }
- else if (argStr == "-fxc-path")
- {
- String name;
- SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, name));
- addSharedLibraryPath(SharedLibraryType::Fxc, name);
- }
else if (argStr.getLength() >= 2 && argStr[1] == 'D')
{
// The value to be defined might be part of the same option, as in:
@@ -836,6 +806,24 @@ struct OptionsParser
}
else
{
+ if (argStr.endsWith("-path"))
+ {
+ Index index = argStr.lastIndexOf('-');
+ if (index >= 0)
+ {
+ String name;
+ SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, name));
+
+ String slice = argStr.subString(1, index - 1);
+ SlangPassThrough passThrough = SLANG_PASS_THROUGH_NONE;
+ if (SLANG_SUCCEEDED(_parsePassThrough(slice.getUnownedSlice(), passThrough)))
+ {
+ session->setPassThroughPath(passThrough, name.getBuffer());
+ continue;
+ }
+ }
+ }
+
sink->diagnose(SourceLoc(), Diagnostics::unknownCommandLineOption, argStr);
// TODO: print a usage message
return SLANG_FAIL;
@@ -1352,11 +1340,6 @@ struct OptionsParser
}
}
- if (sharedLibraryLoader)
- {
- spSessionSetSharedLibraryLoader(session, sharedLibraryLoader);
- }
-
return (sink->GetErrorCount() == 0) ? SLANG_OK : SLANG_FAIL;
}
};