diff options
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index fb7ba79c6..ff7923771 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -437,6 +437,8 @@ struct OptionsParser // The default archive type is zip SlangArchiveType archiveType = SLANG_ARCHIVE_TYPE_ZIP; + bool compileStdLib = false; + slang::CompileStdLibFlags compileStdLibFlags = 0; bool hasLoadedRepro = false; char const* const* argCursor = &argv[0]; @@ -464,7 +466,7 @@ struct OptionsParser } else if (argStr == "-compile-stdlib") { - SLANG_RETURN_ON_FAIL(session->compileStdLib()); + compileStdLib = true; } else if (argStr == "-archive-type") { @@ -533,6 +535,10 @@ struct OptionsParser } else if (argStr == "-doc") { + // If compiling stdlib is enabled, will write out documentation + compileStdLibFlags |= slang::CompileStdLibFlag::WriteDocumentation; + + // Enable writing out documentation on the req requestImpl->getFrontEndReq()->shouldDocument = true; } else if (argStr == "-dump-repro") @@ -1109,6 +1115,11 @@ struct OptionsParser } } + if (compileStdLib) + { + SLANG_RETURN_ON_FAIL(session->compileStdLib(compileStdLibFlags)); + } + // TODO(JS): This is a restriction because of how setting of state works for load repro // If a repro has been loaded, then many of the following options will overwrite // what was set up. So for now they are ignored, and only parameters set as part |
