Skip to content

Commit

Permalink
Always use clang from Visual Studio folder (#3867)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
  • Loading branch information
Alan-Jowett and Alan Jowett authored Sep 27, 2024
1 parent 292578e commit bc299eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<PropertyGroup Condition="'$(Fuzzer)'!='True' And '$(Configuration)'!='FuzzerDebug'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup>
<ClangExec>"$(VsInstallRoot)\VC\Tools\Llvm\bin\clang.exe"</ClangExec>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand Down
26 changes: 13 additions & 13 deletions tests/sample/sample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<CustomBuild Include="*.c">
<FileType>CppCode</FileType>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c %(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c %(Filename).c -o $(OutputPath)%(Filename).o
pushd $(OutDir)
powershell -NonInteractive -ExecutionPolicy Unrestricted .\Convert-BpfToNative.ps1 -FileName %(Filename) -IncludeDir $(SolutionDir)\include -Platform $(Platform) -Configuration $(KernelConfiguration) -KernelMode $true
powershell -NonInteractive -ExecutionPolicy Unrestricted .\Convert-BpfToNative.ps1 -FileName %(Filename) -IncludeDir $(SolutionDir)\include -Platform $(Platform) -Configuration $(Configuration) -KernelMode $false
Expand Down Expand Up @@ -203,7 +203,7 @@
<CustomBuild Include="undocked\*.c">
<FileType>CppCode</FileType>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -I. -I../../undocked/tests/sample/ext/inc -c undocked\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -I. -I../../undocked/tests/sample/ext/inc -c undocked\%(Filename).c -o $(OutputPath)%(Filename).o
pushd $(OutDir)
powershell -NonInteractive -ExecutionPolicy Unrestricted .\Convert-BpfToNative.ps1 -FileName %(Filename) -IncludeDir $(SolutionDir)\include -Platform $(Platform) -Configuration $(KernelConfiguration) -KernelMode $true
powershell -NonInteractive -ExecutionPolicy Unrestricted .\Convert-BpfToNative.ps1 -FileName %(Filename) -IncludeDir $(SolutionDir)\include -Platform $(Platform) -Configuration $(Configuration) -KernelMode $false
Expand All @@ -218,39 +218,39 @@
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<CustomBuild Include="unsafe\*.c">
<FileType>CppCode</FileType>
<Command>clang $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>$(ClangExec) $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
</Command>
<Outputs>$(OutputPath)%(Filename).o</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='NativeOnlyDebug'">
<CustomBuild Include="unsafe\*.c">
<FileType>CppCode</FileType>
<Command>clang $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>$(ClangExec) $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
</Command>
<Outputs>$(OutputPath)%(Filename).o</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FuzzerDebug'">
<CustomBuild Include="unsafe\*.c">
<FileType>CppCode</FileType>
<Command>clang $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>$(ClangExec) $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
</Command>
<Outputs>$(OutputPath)%(Filename).o</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Release'">
<CustomBuild Include="unsafe\*.c">
<FileType>CppCode</FileType>
<Command>clang $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>$(ClangExec) $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
</Command>
<Outputs>$(OutputPath)%(Filename).o</Outputs>
<BuildInParallel>true</BuildInParallel>
Expand All @@ -259,9 +259,9 @@
<ItemGroup Condition="'$(Configuration)'=='NativeOnlyRelease'">
<CustomBuild Include="unsafe\*.c">
<FileType>CppCode</FileType>
<Command>clang $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>$(ClangExec) $(ClangFlags) -c %(Filename).c -o $(OutputPath)%(Filename).o</Command>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c unsafe\%(Filename).c -o $(OutputPath)%(Filename).o
</Command>
<Outputs>$(OutputPath)%(Filename).o</Outputs>
<BuildInParallel>true</BuildInParallel>
Expand All @@ -272,7 +272,7 @@
<CustomBuild Include="custom_program_type\*.c">
<FileType>CppCode</FileType>
<Command>
clang $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c custom_program_type\%(Filename).c -o $(OutputPath)%(Filename).o
$(ClangExec) $(ClangFlags) -I../xdp -I../socket -I./ext/inc -I../../netebpfext -c custom_program_type\%(Filename).c -o $(OutputPath)%(Filename).o
pushd $(SolutionDir)\scripts
powershell -NonInteractive -ExecutionPolicy Unrestricted .\build_custom_sample_programs.ps1 -FileName %(Filename) -FilePath $(OutDir) -IncludePath $(SolutionDir)\include -Platform $(Platform) -Configuration $(Configuration) -KernelConfiguration $(KernelConfiguration)
popd
Expand Down

0 comments on commit bc299eb

Please sign in to comment.