yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
1.9 KiB64 linesraw
1#ifndef SLANG_VISUAL_STUDIO_COMPILER_UTIL_H
2#define SLANG_VISUAL_STUDIO_COMPILER_UTIL_H
3
4#include "slang-downstream-compiler-util.h"
5
6namespace Slang
7{
8
9
10struct VisualStudioCompilerUtil : public DownstreamCompilerUtilBase
11{
12    /// Calculate Visual Studio family compilers cmdLine arguments from options
13    static SlangResult calcArgs(const CompileOptions& options, CommandLine& cmdLine);
14    /// Parse Visual Studio exeRes into CPPCompiler::Output
15    static SlangResult parseOutput(const ExecuteResult& exeRes, IArtifactDiagnostics* outOutput);
16
17    static SlangResult calcCompileProducts(
18        const CompileOptions& options,
19        ProductFlags flags,
20        IOSFileArtifactRepresentation* lockFile,
21        List<ComPtr<IArtifact>>& outArtifacts);
22
23    static SlangResult locateCompilers(
24        const String& path,
25        ISlangSharedLibraryLoader* loader,
26        DownstreamCompilerSet* set);
27};
28
29class VisualStudioDownstreamCompiler : public CommandLineDownstreamCompiler
30{
31public:
32    typedef CommandLineDownstreamCompiler Super;
33    typedef VisualStudioCompilerUtil Util;
34
35    // CommandLineDownstreamCompiler impl  - just forwards to the Util
36    virtual SlangResult calcArgs(const CompileOptions& options, CommandLine& cmdLine) SLANG_OVERRIDE
37    {
38        return Util::calcArgs(options, cmdLine);
39    }
40    virtual SlangResult parseOutput(
41        const ExecuteResult& exeResult,
42        IArtifactDiagnostics* diagnostics) SLANG_OVERRIDE
43    {
44        return Util::parseOutput(exeResult, diagnostics);
45    }
46    virtual SlangResult calcCompileProducts(
47        const CompileOptions& options,
48        DownstreamProductFlags productFlags,
49        IOSFileArtifactRepresentation* lockFile,
50        List<ComPtr<IArtifact>>& outArtifacts) SLANG_OVERRIDE
51    {
52        return Util::calcCompileProducts(options, productFlags, lockFile, outArtifacts);
53    }
54
55    VisualStudioDownstreamCompiler(const Desc& desc)
56        : Super(desc)
57    {
58    }
59};
60
61
62} // namespace Slang
63
64#endif