diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-07-10 09:49:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-10 09:49:46 -0700 |
| commit | 8abdf2dddd10feb9794c86cdf6b2159a2b6383e4 (patch) | |
| tree | df7d790f33f7e4c8adc1b9b747c7c908d8bab0d4 /source/slang/compiler.cpp | |
| parent | 68df74b58a56b0a1fb19b9ec4ff0282969cd6a12 (diff) | |
| parent | 5b7c254d24653fd1c19157e8d5ef68a7e787ff58 (diff) | |
Merge pull request #65 from tfoleyNV/falcor-work
Falcor work
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; } } } |
