diff options
Diffstat (limited to 'source/slang/compiler.cpp')
| -rw-r--r-- | source/slang/compiler.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp index 19623a7aa..2f6204eb2 100644 --- a/source/slang/compiler.cpp +++ b/source/slang/compiler.cpp @@ -461,6 +461,10 @@ namespace Slang } break; + case CodeGenTarget::None: + // The user requested no output + break; + // Note(tfoley): We currently hit this case when compiling the stdlib case CodeGenTarget::Unknown: break; @@ -520,17 +524,9 @@ namespace Slang void generateOutput( CompileRequest* compileRequest) { - switch (compileRequest->Target) + // Allow for an "extra" target to verride things first. + switch (compileRequest->extraTarget) { - default: - // For most targets, we will do things per-translation-unit - for( auto translationUnit : compileRequest->translationUnits ) - { - TranslationUnitResult translationUnitResult = emitTranslationUnit(translationUnit.Ptr()); - translationUnit->result = translationUnitResult; - } - break; - case CodeGenTarget::ReflectionJSON: { String reflectionJSON = emitReflectionJSON(compileRequest->layout.Ptr()); @@ -538,8 +534,20 @@ namespace Slang // HACK(tfoley): just print it out since that is what people probably expect. // TODO: need a way to control where output gets routed across all possible targets. fprintf(stdout, "%s", reflectionJSON.begin()); + + return; } break; + + default: + break; + } + + // For most targets, we will do things per-translation-unit + for( auto translationUnit : compileRequest->translationUnits ) + { + TranslationUnitResult translationUnitResult = emitTranslationUnit(translationUnit.Ptr()); + translationUnit->result = translationUnitResult; } } } |
