diff options
| author | Yong He <yonghe@outlook.com> | 2020-06-18 15:06:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-18 15:06:14 -0700 |
| commit | 515d8eb0cd719ae31db2f6e03751011a123bc0ba (patch) | |
| tree | 3e78893a74af856fb29158078bed7099a567f5dd /source/core/slang-test-tool-util.cpp | |
| parent | e2d21026d115dc61296b47dcc990534f1844bc7f (diff) | |
| parent | aa6aca498cd1f7fbbdb143e72dd48b1d714c8fbb (diff) | |
Merge branch 'master' into feature/prelude-fix
Diffstat (limited to 'source/core/slang-test-tool-util.cpp')
| -rw-r--r-- | source/core/slang-test-tool-util.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/source/core/slang-test-tool-util.cpp b/source/core/slang-test-tool-util.cpp index 3b89321a1..f8e163758 100644 --- a/source/core/slang-test-tool-util.cpp +++ b/source/core/slang-test-tool-util.cpp @@ -59,19 +59,9 @@ static SlangResult _addCPPPrelude(const String& parentPath, slang::IGlobalSessio { String includePath; SLANG_RETURN_ON_FAIL(_calcIncludePath(parentPath, "../../../prelude/slang-cpp-prelude.h", includePath)); - StringBuilder prelude; prelude << "#include \"" << includePath << "\"\n\n"; - const SlangPassThrough downstreamCompilers[] = { - SLANG_PASS_THROUGH_CLANG, ///< Clang C/C++ compiler - SLANG_PASS_THROUGH_VISUAL_STUDIO, ///< Visual studio C/C++ compiler - SLANG_PASS_THROUGH_GCC, ///< GCC C/C++ compiler - SLANG_PASS_THROUGH_GENERIC_C_CPP, - }; - for (auto downstreamCompiler : downstreamCompilers) - { - session->setDownstreamCompilerPrelude(downstreamCompiler, prelude.getBuffer()); - } + session->setLanguagePrelude(SLANG_SOURCE_LANGUAGE_CPP, prelude.getBuffer()); return SLANG_OK; } @@ -79,16 +69,9 @@ static SlangResult _addCUDAPrelude(const String& parentPath, slang::IGlobalSessi { String includePath; SLANG_RETURN_ON_FAIL(_calcIncludePath(parentPath, "../../../prelude/slang-cuda-prelude.h", includePath)); - StringBuilder prelude; prelude << "#include \"" << includePath << "\"\n\n"; - const SlangPassThrough downstreamCompilers[] = { - SLANG_PASS_THROUGH_NVRTC, ///< nvrtc CUDA compiler - }; - for (auto downstreamCompiler : downstreamCompilers) - { - session->setDownstreamCompilerPrelude(downstreamCompiler, prelude.getBuffer()); - } + session->setLanguagePrelude(SLANG_SOURCE_LANGUAGE_CUDA, prelude.getBuffer()); return SLANG_OK; } |
