You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Propagate new CFamily compiler-related features automatically to.vcxproj projects.
Details:
We introduced a new subprocess SL mode. This mode moves most of the CFamily compilers/driver’s details to the CFamily side. This mode is used for CMake projects.
For .vcxproj we still use the old subprocess mode. This means:
A duplicate version of the driver is maintained on the SonarLint side: MsvcDriver.cs
The scanner protocol data is needlessly maintained on the SonarLint side: Protocol.cs. The data sent in this protocol, unlike with the subprocess SL mode, need to be continuously updated with fields irrelevant to SL.
Maintaining mapping of the compilation options to the command line equivalence: CFamilyHelper_Capture.cs
Supporting a new compiler or a compiler feature requires duplicating the work on the SonarLint side.
What
Use the subprocess SL mode for the .vcxproj.
Drop the no longer needed duplicated and hard-to-maintain CFamily specific code. How
Load all the information required by the subprocess SL mode from the .vcxproj project(pretty straightforward):
Compilation Database:
File: absolute path of the file to be analyzed
Directory: VS project Directory
Command:
vcFileSettings.GetEvaluatedPropertyValue("ClCompilerPath")
+
"All Options" field found here:
+
Additional options (already loaded - no change)
+
File full Path
Include env variables: vcFileSettings.GetEvaluatedPropertyValue("AdditionalIncludeDirectories"),
Preamble/Reproducer/Header file identification/Header language detection remain the same.
Use the Procol of the subprocess SL mode.
Drop the PortedFromJava Directory.
Drop most of the file config loading. Since we no longer have to load each option separately we just load "All Options": FileConfig.cs
Drop the mapping from VS option to command line: CFamilyHelper_Capture.cs
The text was updated successfully, but these errors were encountered:
Why
.vcxproj
projects..vcxproj
projects.Details:
We introduced a new subprocess SL mode. This mode moves most of the CFamily compilers/driver’s details to the CFamily side. This mode is used for CMake projects.
For
.vcxproj
we still use the old subprocess mode. This means:MsvcDriver.cs
Protocol.cs
. The data sent in this protocol, unlike with the subprocess SL mode, need to be continuously updated with fields irrelevant to SL.CFamilyHelper_Capture.cs
What
Use the subprocess SL mode for the
.vcxproj
.Drop the no longer needed duplicated and hard-to-maintain CFamily specific code.
How
Load all the information required by the subprocess SL mode from the
.vcxproj
project(pretty straightforward):Compilation Database:
vcFileSettings.GetEvaluatedPropertyValue("ClCompilerPath")
+
"All Options" field found here:
+
Additional options (already loaded - no change)
+
File full Path
Include env variables: vcFileSettings.GetEvaluatedPropertyValue("AdditionalIncludeDirectories"),
Preamble/Reproducer/Header file identification/Header language detection remain the same.
Use the Procol of the subprocess SL mode.
Drop the
PortedFromJava
Directory.Drop most of the file config loading. Since we no longer have to load each option separately we just load "All Options":
FileConfig.cs
Drop the mapping from VS option to command line:
CFamilyHelper_Capture.cs
The text was updated successfully, but these errors were encountered: