Skip to content

Commit aff3ab7

Browse files
committed
First commit
1 parent 0d92020 commit aff3ab7

File tree

188 files changed

+152285
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+152285
-0
lines changed

InstallTemplate.bat

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
@ECHO OFF
2+
SETLOCAL EnableExtensions EnableDelayedExpansion
3+
4+
SET "EXIT_ON_ERROR=%~1"
5+
SET SUCCESS=0
6+
7+
PUSHD %~dp0
8+
9+
SET VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
10+
11+
@rem Visual Studio 2015
12+
SET VCT_PATH=%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\v140\Platforms
13+
IF EXIST "%VCT_PATH%" CALL :SUB_VS2015
14+
SET VCT_PATH=%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\v140\Platforms
15+
IF EXIST "%VCT_PATH%" CALL :SUB_VS2015
16+
17+
@rem Visual Studio 2017
18+
FOR /f "delims=" %%A IN ('"%VSWHERE%" -property installationPath -prerelease -version [15.0^,16.0^)') DO (
19+
SET VCT_PATH=%%A\Common7\IDE\VC\VCTargets\Platforms
20+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!"
21+
)
22+
23+
@rem Visual Studio 2017 Build Tools
24+
FOR /f "delims=" %%A IN ('"%VSWHERE%" -products Microsoft.VisualStudio.Product.BuildTools -property installationPath -prerelease -version [15.0^,16.0^)') DO (
25+
SET VCT_PATH=%%A\Common7\IDE\VC\VCTargets\Platforms
26+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!"
27+
)
28+
29+
@rem Visual Studio 2019, 2022
30+
FOR /f "delims=" %%A IN ('"%VSWHERE%" -property installationPath -prerelease -version [16.0^,18.0^)') DO (
31+
@rem Visual C++ 2022 v143 toolset
32+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v170\Platforms
33+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2022 "!VCT_PATH!"
34+
@rem Visual C++ 2019 v142 toolset
35+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v160\Platforms
36+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2019 "!VCT_PATH!"
37+
@rem Visual C++ 2017 v141 toolset
38+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v150\Platforms
39+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!"
40+
)
41+
42+
@rem Visual Studio 2019, 2022 Build Tools
43+
FOR /f "delims=" %%A IN ('"%VSWHERE%" -products Microsoft.VisualStudio.Product.BuildTools -property installationPath -prerelease -version [16.0^,18.0^)') DO (
44+
@rem Visual C++ 2022 v143 toolset
45+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v170\Platforms
46+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2022 "!VCT_PATH!"
47+
@rem Visual C++ 2019 v142 toolset
48+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v160\Platforms
49+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2019 "!VCT_PATH!"
50+
@rem Visual C++ 2017 v141 toolset
51+
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v150\Platforms
52+
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!"
53+
)
54+
55+
IF %SUCCESS% == 0 (
56+
ECHO Visual C++ 2017, 2019 or 2022 NOT Installed.
57+
IF "%EXIT_ON_ERROR%" == "" EXIT /B
58+
)
59+
60+
POPD
61+
ENDLOCAL
62+
EXIT /B
63+
64+
65+
:SUB_VS2015
66+
ECHO VCTargetsPath for Visual Studio 2015: %VCT_PATH%
67+
XCOPY /Q /Y "LLVM-MSVC" "%VCT_PATH%\..\LLVM-MSVC\"
68+
XCOPY /Q /Y "LLVM-MSVC_v140" "%VCT_PATH%\x64\PlatformToolsets\LLVM-MSVC_v140\"
69+
XCOPY /Q /Y "LLVM-MSVC_v140_xp" "%VCT_PATH%\x64\PlatformToolsets\LLVM-MSVC_v140_xp\"
70+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\x64\PlatformToolsets\LLVM-MSVC_v140_KernelMode\"
71+
XCOPY /Q /Y "LLVM-MSVC_v140" "%VCT_PATH%\Win32\PlatformToolsets\LLVM-MSVC_v140\"
72+
XCOPY /Q /Y "LLVM-MSVC_v140_xp" "%VCT_PATH%\Win32\PlatformToolsets\LLVM-MSVC_v140_xp\"
73+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v140_KernelMode\"
74+
SET SUCCESS=1
75+
76+
77+
:SUB_VS2017
78+
ECHO VCTargetsPath for Visual Studio 2017: %~1
79+
XCOPY /Q /Y "LLVM-MSVC" "%~1\..\LLVM-MSVC\"
80+
XCOPY /Q /Y "LLVM-MSVC_v141" "%~1\x64\PlatformToolsets\LLVM-MSVC_v141\"
81+
XCOPY /Q /Y "LLVM-MSVC_v141_xp" "%~1\x64\PlatformToolsets\LLVM-MSVC_v141_xp\"
82+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\x64\PlatformToolsets\LLVM-MSVC_v141_KernelMode\"
83+
XCOPY /Q /Y "LLVM-MSVC_v141" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v141\"
84+
XCOPY /Q /Y "LLVM-MSVC_v141_xp" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v141_xp\"
85+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v141_KernelMode\"
86+
XCOPY /Q /Y "LLVM-MSVC_v141" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v141\"
87+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v141_KernelMode\"
88+
XCOPY /Q /Y "LLVM-MSVC_v141" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v141\"
89+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v141_KernelMode\"
90+
SET SUCCESS=1
91+
EXIT /B
92+
93+
:SUB_VS2019
94+
ECHO VCTargetsPath for Visual Studio 2019: %~1
95+
XCOPY /Q /Y "LLVM-MSVC" "%~1\..\LLVM-MSVC\"
96+
XCOPY /Q /Y "LLVM-MSVC_v142" "%~1\x64\PlatformToolsets\LLVM-MSVC_v142\"
97+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\x64\PlatformToolsets\LLVM-MSVC_v142_KernelMode\"
98+
XCOPY /Q /Y "LLVM-MSVC_v142" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v142\"
99+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v142_KernelMode\"
100+
XCOPY /Q /Y "LLVM-MSVC_v142" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v142\"
101+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v142_KernelMode\"
102+
XCOPY /Q /Y "LLVM-MSVC_v142" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v142\"
103+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v142_KernelMode\"
104+
SET SUCCESS=1
105+
XCOPY /Q /Y "ProjectTemplates" "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates\"
106+
EXIT /B
107+
108+
:SUB_VS2022
109+
ECHO VCTargetsPath for Visual Studio 2022: %~1
110+
XCOPY /Q /Y "LLVM-MSVC" "%~1\..\LLVM-MSVC\"
111+
XCOPY /Q /Y "LLVM-MSVC_v143" "%~1\x64\PlatformToolsets\LLVM-MSVC_v143\"
112+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\x64\PlatformToolsets\LLVM-MSVC_v143_KernelMode\"
113+
XCOPY /Q /Y "LLVM-MSVC_v143" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v143\"
114+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\Win32\PlatformToolsets\LLVM-MSVC_v143_KernelMode\"
115+
XCOPY /Q /Y "LLVM-MSVC_v143" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v143\"
116+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM64\PlatformToolsets\LLVM-MSVC_v143_KernelMode\"
117+
XCOPY /Q /Y "LLVM-MSVC_v143" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v143\"
118+
XCOPY /Q /Y "LLVM-MSVC_KernelMode" "%~1\ARM\PlatformToolsets\LLVM-MSVC_v143_KernelMode\"
119+
SET SUCCESS=1
120+
EXIT /B

LLVM-MSVC setup.iss

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#dim Version[4]
2+
#expr ParseVersion("bin\clang-cl.exe", Version[0], Version[1], Version[2], Version[3])
3+
#define MyAppVersion Str(Version[0]) + "." + Str(Version[1]) + "." + Str(Version[2]) + "." + Str(Version[3])
4+
#define MyAppName "llvm-msvc"
5+
#define MyAppExeName "llvm-msvc_X86_64.exe"
6+
7+
[Setup]
8+
AppName={#MyAppName}
9+
AppVersion={#MyAppVersion}
10+
AppId={#MyAppName}
11+
DefaultDirName="{src}\llvm-msvc_X86_64"
12+
Compression=lzma2
13+
SolidCompression=yes
14+
DisableReadyPage=no
15+
DisableReadyMemo=no
16+
DisableStartupPrompt=yes
17+
DisableFinishedPage=yes
18+
Uninstallable=yes
19+
OutputDir=Output\
20+
OutputBaseFilename=llvm-msvc_X86_64
21+
PrivilegesRequired=admin
22+
23+
24+
25+
[Files]
26+
27+
;bin
28+
Source: "bin\*.*"; DestDir: "{app}\bin\"; Flags: ignoreversion
29+
30+
;lib
31+
Source: "lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs
32+
33+
;doc
34+
Source: "doc\*"; DestDir: "{app}\doc"; Flags: ignoreversion recursesubdirs
35+
36+
37+
38+
;template
39+
Source: "InstallTemplate.bat"; DestDir: "{app}\template\"; Flags: ignoreversion
40+
Source: "UnInstallTemplate.bat"; DestDir: "{app}\template\"; Flags: ignoreversion
41+
Source: "LLVM-MSVC\*"; DestDir: "{app}\template\LLVM-MSVC"; Flags: ignoreversion recursesubdirs
42+
Source: "LLVM-MSVC_v140\*"; DestDir: "{app}\template\LLVM-MSVC_v140"; Flags: ignoreversion recursesubdirs
43+
Source: "LLVM-MSVC_v140_xp\*"; DestDir: "{app}\template\LLVM-MSVC_v140_xp"; Flags: ignoreversion recursesubdirs
44+
Source: "LLVM-MSVC_v141\*"; DestDir: "{app}\template\LLVM-MSVC_v141"; Flags: ignoreversion recursesubdirs
45+
Source: "LLVM-MSVC_v141_xp\*"; DestDir: "{app}\template\LLVM-MSVC_v141_xp"; Flags: ignoreversion recursesubdirs
46+
Source: "LLVM-MSVC_v142\*"; DestDir: "{app}\template\LLVM-MSVC_v142"; Flags: ignoreversion recursesubdirs
47+
Source: "LLVM-MSVC_v143\*"; DestDir: "{app}\template\LLVM-MSVC_v143"; Flags: ignoreversion recursesubdirs
48+
Source: "LLVM-MSVC_KernelMode\*"; DestDir: "{app}\template\LLVM-MSVC_KernelMode"; Flags: ignoreversion recursesubdirs
49+
50+
[Languages]
51+
Name: "en"; MessagesFile: "compiler:Default.isl"
52+
Name: "tc"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"
53+
Name: "jp"; MessagesFile: "compiler:Languages\Japanese.isl"
54+
Name: "de"; MessagesFile: "compiler:Languages\German.isl"
55+
56+
[Registry]
57+
Root: HKLM; Subkey: "SOFTWARE\LLVM\LLVM-MSVC"; ValueType: "string"; ValueData: "{app}"
58+
59+
[Run]
60+
Filename: {app}\template\InstallTemplate.bat; Flags: shellexec runhidden nowait;
61+
62+
[Code]
63+
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
64+
var
65+
ReturnCode: Integer;
66+
begin
67+
if CurUninstallStep = usUninstall then begin
68+
Exec(ExpandConstant('{app}\template\UnInstallTemplate.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, ReturnCode);
69+
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'Software\LLVM\LLVM-MSVC');
70+
71+
DelTree(ExpandConstant('{app}\bin'), True, True, True);
72+
DelTree(ExpandConstant('{app}\lib'), True, True, True);
73+
DelTree(ExpandConstant('{app}\doc'), True, True, True);
74+
75+
end;
76+
end;
77+
78+
function InitializeSetup(): Boolean;
79+
begin
80+
81+
Result := true;
82+
end;

LLVM-MSVC/LLVM.Common.props

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="$(MSBuildThisFileDirectory)ImportBefore\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportBefore')" />
3+
<PropertyGroup>
4+
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM-MSVC)</LLVMInstallDir>
5+
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM-MSVC)</LLVMInstallDir>
6+
<LLVMInstallDir Condition="'$(LLVMInstallDir)' != ''">$(LLVMInstallDir)\</LLVMInstallDir>
7+
<ClangClExecutable>$(LLVMInstallDir)bin\clang-cl.exe</ClangClExecutable>
8+
<LldLinkExecutable>$(LLVMInstallDir)bin\lld-link.exe</LldLinkExecutable>
9+
10+
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
11+
<!-- Disable clang-tidy -->
12+
<EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis>
13+
14+
<UseClangCl>true</UseClangCl>
15+
<UseLldLink>true</UseLldLink>
16+
17+
<IncludePath>$(LLVMInstallDir)lib\sdk;$(IncludePath)</IncludePath>
18+
19+
</PropertyGroup>
20+
<Import Project="$(MSBuildThisFileDirectory)ImportAfter\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportAfter')" />
21+
</Project>

LLVM-MSVC/LLVM.Common.targets

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="$(MSBuildThisFileDirectory)ImportBefore\*.targets" Condition="Exists('$(MSBuildThisFileDirectory)ImportBefore')" />
3+
<PropertyGroup>
4+
<!-- Set the path to clang-cl executable based on the value of the project-
5+
level setting. This has to be done in the .targets file since values
6+
selected via the settings UI appear in the vcxproj (which is imported
7+
before the targets file but after the props file) and we need the path
8+
that the user may have overridden in the UI. -->
9+
<CLToolExe Condition="$(UseClangCl)">$(ClangClExecutable)</CLToolExe>
10+
<LinkToolExe Condition="'$(Platform)' == 'Win32'">$(LldLinkExecutable)</LinkToolExe>
11+
<LinkToolExe Condition="'$(Platform)' == 'x64'">$(LldLinkExecutable)</LinkToolExe>
12+
13+
</PropertyGroup>
14+
15+
<!-- Take any clang-specific options that the user wants to pass and stick them onto the
16+
general purpose list of command line flags. -->
17+
<ItemDefinitionGroup Condition="$(UseClangCl)">
18+
<ClCompile>
19+
<!-- Set this to "Default" (which means not passing any /RTC option) so that any other value will
20+
be treated as having been overridden by the user. This Serves as a hint to the user that
21+
Default is the value we support, and other values will generate a warning. It also means
22+
that if the user simply creates a new project in MSVC (which uses /RTCu by default), then
23+
switches the toolset to Clang, we will still treat the value as default (which for us is to
24+
not pass the option). Only if the user explicitly overrode this setting in a project to use
25+
/RTCu would we see the warning. -->
26+
<!-- Force define PSAPI_VERSION=1-->
27+
<PreprocessorDefinitions>PSAPI_VERSION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
28+
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
29+
<AdditionalOptions Condition="'$(Platform)' == 'Win32'">--target=i686-pc-windows-msvc $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
30+
<AdditionalOptions Condition="'$(Platform)' == 'x64'">--target=x86_64-pc-windows-msvc $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
31+
<AdditionalOptions Condition="'$(Platform)' == 'ARM64'">--target=aarch64-pc-windows-msvc $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
32+
<AdditionalOptions Condition="'$(Platform)' == 'ARM'">--target=arm-pc-windows-msvc $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
33+
</ClCompile>
34+
</ItemDefinitionGroup>
35+
36+
<ItemDefinitionGroup Condition="$(UseLldLink)">
37+
<Link>
38+
<!-- Map /DEBUG and /DEBUG:FASTLINK to /DEBUG:FULL.
39+
<GenerateDebugInformation Condition="'%(Link.GenerateDebugInformation)' == 'true'">DebugFull</GenerateDebugInformation>
40+
<GenerateDebugInformation Condition="'%(Link.GenerateDebugInformation)' == 'DebugFastLink'">DebugFull</GenerateDebugInformation> -->
41+
<AdditionalOptions>$(LldLinkAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
42+
</Link>
43+
</ItemDefinitionGroup>
44+
45+
46+
<!-- We hook up a target to run every time ClCompile is about to run, the
47+
purpose of which is to sanitize the command line before it gets passed to
48+
the compiler. Some options we silently discard, other options we warn on
49+
and then discard, and other options we generate a hard error.
50+
51+
We try to keep hard errors to a minimum and reserve it for cases where
52+
the option implies fundamentally different assumptions about the way code
53+
should be compiled. This code would probably generate an error anyway,
54+
but at least this way we give the user a more useful message about what
55+
the actual problem is, rather than relying on some obscure compilation
56+
error.
57+
58+
For any options that clang-cl discards, we would prefer to not even pass
59+
them in on the command line. So if a user starts with a cl projects and
60+
changes the toolset to clang, they could have set options such as /Gm
61+
(minimal rebuild), /sdl (Security Checks), etc. The ClCompile task would
62+
then notice this and pass these through to clang-cl.exe. Clang would of
63+
course ignore them, but in some cases (such as /Gm), they would generate
64+
-Wunused-command-line-argument warnings, so it's better if we can just
65+
strip them from the command line entirely. This also has the side
66+
benefit of making command lines shorter which is always nice when trying
67+
to look at the tool output.
68+
-->
69+
<Target Name="BeforeClCompile" BeforeTargets="ClCompile" Condition="$(UseClangCl)">
70+
<!-- Error if they're trying to compile this file as managed code. -->
71+
<Error Condition="('%(ClCompile.CompileAsManaged)' != 'false') and ('%(ClCompile.CompileAsManaged)' != '')"
72+
File="@(ClCompile)(0,0)"
73+
Text="clang-cl does not support compiling managed code (/clr). This file cannot be compiled."/>
74+
75+
<!-- Error if WinRT is being used. -->
76+
<Error Condition="('%(ClCompile.CompileAsWinRT)' == 'true') or ('%(ClCompile.WinRTNoStdLib)' == 'true')"
77+
File="@(ClCompile)(0,0)"
78+
Text="clang-cl does not support Windows Runtime Language Extensions (/ZW, /ZW:nostdlib). This file cannot be compiled."/>
79+
80+
<!-- Error if OpenMP language extensions are enabled. -->
81+
<Error Condition="'%(ClCompile.OpenMPSupport)' == 'true'"
82+
File="@(ClCompile)(0,0)"
83+
Text="clang-cl does not support OpenMP (/openmp). This file cannot be compiled."/>
84+
85+
<!-- Error if C++ Modules are enabled. Clang has its own notion of modules that are not compatible. -->
86+
<Error Condition="'%(ClCompile.EnableModules)' == 'true'"
87+
File="@(ClCompile)(0,0)"
88+
Text="clang-cl does not support MSVC Modules (/experimental:module). This file cannot be compiled."/>
89+
90+
<ItemGroup>
91+
<ClCompile>
92+
<!-- Map /ZI and /Zi to /Z7. Clang internally does this, so if we were
93+
to just pass the option through, clang would work. The problem is
94+
that MSBuild would not. MSBuild detects /ZI and /Zi and then
95+
assumes (rightly) that there will be a compiler-generated PDB (e.g.
96+
vc141.pdb). Since clang-cl will not emit this, MSBuild will always
97+
think that the compiler-generated PDB needs to be re-generated from
98+
scratch and trigger a full build. The way to avoid this is to
99+
always give MSBuild accurate information about how we plan to
100+
generate debug info (which is to always using /Z7 semantics).
101+
-->
102+
<DebugInformationFormat Condition="'%(ClCompile.DebugInformationFormat)' == 'ProgramDatabase'">OldStyle</DebugInformationFormat>
103+
<DebugInformationFormat Condition="'%(ClCompile.DebugInformationFormat)' == 'EditAndContinue'">OldStyle</DebugInformationFormat>
104+
105+
<!-- Unset any options that we either silently ignore or warn about due to compatibility.
106+
Generally when an option is set to no value, that means "Don't pass an option to the
107+
compiler at all."
108+
-->
109+
<WholeProgramOptimization/>
110+
<EnableFiberSafeOptimizations/>
111+
<IgnoreStandardIncludePath/>
112+
<EnableParallelCodeGeneration/>
113+
<ForceConformanceInForLoopScope/>
114+
<TreatWChar_tAsBuiltInType/>
115+
<SDLCheck/>
116+
<GenerateXMLDocumentationFiles/>
117+
<BrowseInformation/>
118+
<EnablePREfast/>
119+
<MinimalRebuild/>
120+
<StringPooling/>
121+
<ExpandAttributedSource/>
122+
<EnforceTypeConversionRules/>
123+
<ErrorReporting/>
124+
<DisableLanguageExtensions/>
125+
<ProgramDataBaseFileName/>
126+
<DisableSpecificWarnings/>
127+
<TreatSpecificWarningsAsErrors/>
128+
<ForcedUsingFiles/>
129+
<PREfastLog/>
130+
<PREfastAdditionalOptions/>
131+
<PREfastAdditionalPlugins/>
132+
<MultiProcessorCompilation/>
133+
<UseFullPaths/>
134+
<RemoveUnreferencedCodeData/>
135+
<SupportJustMyCode/>
136+
<!-- Ignore C++ Language Standard for C -->
137+
<LanguageStandard Condition="('%(ClCompile.CompileAs)' == 'CompileAsC') or ('%(ClCompile.CompileAs)' == 'Default' and '%(ClCompile.Extension)' == '.c')"/>
138+
139+
<!-- We can't just unset BasicRuntimeChecks, as that will pass /RTCu to the compiler.
140+
We have to explicitly set it to 'Default' to avoid passing anything. -->
141+
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
142+
</ClCompile>
143+
</ItemGroup>
144+
</Target>
145+
<Import Project="$(MSBuildThisFileDirectory)ImportAfter\*.targets" Condition="Exists('$(MSBuildThisFileDirectory)ImportAfter')" />
146+
</Project>

LLVM-MSVC_KernelMode/Toolset.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\WindowsKernelModeDriver10.0\Toolset.props"/>
3+
<Import Project="$(VCTargetsPath)\LLVM-MSVC\LLVM.Common.props"/>
4+
</Project>

LLVM-MSVC_KernelMode/Toolset.targets

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<ItemDefinitionGroup>
3+
<ClCompile>
4+
<!-- Disable inherit parent -->
5+
<AdditionalOptions />
6+
<PreprocessorDefinitions>_KERNEL_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
7+
</ClCompile>
8+
</ItemDefinitionGroup>
9+
10+
<PropertyGroup>
11+
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM-MSVC)</LLVMInstallDir>
12+
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM-MSVC)</LLVMInstallDir>
13+
<LLVMInstallDir Condition="'$(LLVMInstallDir)' != ''">$(LLVMInstallDir)\</LLVMInstallDir>
14+
<IncludePath>$(LLVMInstallDir)lib\sdk;$(IncludePath)</IncludePath>
15+
</PropertyGroup>
16+
17+
<Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\WindowsKernelModeDriver10.0\Toolset.targets"/>
18+
<Import Project="$(VCTargetsPath)\LLVM-MSVC\LLVM.Common.targets"/>
19+
</Project>

0 commit comments

Comments
 (0)