mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Tracer support for invoking csc directly.
This commit is contained in:
@@ -74,7 +74,9 @@ namespace Semmle.Extraction.CSharp
|
||||
specifiedFramework = compilerDir;
|
||||
}
|
||||
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(SpecifiedCompiler);
|
||||
// If csc is specified as compiler name, then attempt to read the version information from csc.dll
|
||||
var compilerBinaryName = SpecifiedCompiler.EndsWith("csc") ? $"{SpecifiedCompiler}.dll" : SpecifiedCompiler;
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(compilerBinaryName);
|
||||
if (!knownCompilerNames.TryGetValue(versionInfo.OriginalFilename ?? string.Empty, out var vendor))
|
||||
{
|
||||
SkipExtractionBecause("the compiler name is not recognised");
|
||||
|
||||
@@ -226,6 +226,11 @@ function RegisterExtractorPack(id)
|
||||
prepend = { '--compiler', '"${compiler}"' },
|
||||
order = ORDER_BEFORE
|
||||
}),
|
||||
CreatePatternMatcher({ '^csc$' }, MatchCompilerName,
|
||||
extractor, {
|
||||
prepend = { '--compiler', '${compiler}' },
|
||||
order = ORDER_BEFORE
|
||||
}),
|
||||
MsBuildMatcher,
|
||||
function(compilerName, compilerPath, compilerArguments, _languageId)
|
||||
-- handle cases like `dotnet exec csc.dll <args>` and `mono(-sgen64) csc.exe <args>`
|
||||
|
||||
Reference in New Issue
Block a user