Skip to content

Commit 7b70bc7

Browse files
committed
msvc: add msbuild support test
1 parent a5c6ab7 commit 7b70bc7

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

.github/workflows/integration-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,19 @@ jobs:
514514
$SCCACHE_EXE "$(where cl.exe)" -c "@args.rsp"
515515
$SCCACHE_EXE --show-stats
516516
517+
- name: Prepare - MSBuild support
518+
shell: bash
519+
working-directory: ./tests/msvc-msbuild
520+
# Force stop server to drop compiler cache - need to test showInclude prefix detection
521+
run: |
522+
$SCCACHE_EXE --stop-server
523+
mkdir -p compiler
524+
cp $SCCACHE_EXE compiler/cl.exe
525+
526+
- name: Compile - MSBuild support
527+
working-directory: ./tests/msvc-msbuild
528+
run: msbuild MsbuildCpp.vcxproj -property:Configuration=Release -property:Platform=x64 "-property:SolutionDir=${{ github.workspace }}/tests/msvc-msbuild/"
529+
517530
- name: Stop Server
518531
if: success() || failure()
519532
shell: bash

tests/msvc-msbuild/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!.gitignore
3+
!*.vcxproj
4+
!*.cpp
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Release|x64">
5+
<Configuration>Release</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
</ItemGroup>
9+
<PropertyGroup Label="Globals">
10+
<VCProjectVersion>17.0</VCProjectVersion>
11+
<Keyword>Win32Proj</Keyword>
12+
<ProjectGuid>{0e44c32e-bffa-4f4b-aac8-5db71447ce37}</ProjectGuid>
13+
<RootNamespace>MsbuildCpp</RootNamespace>
14+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
15+
<!-- Based on https://medium.com/@parakram.majumdar/ccache-with-msbuild-devenv-f286778e0be7 -->
16+
<TrackFileAccess>false</TrackFileAccess>
17+
<UseMultiToolTask>true</UseMultiToolTask>
18+
<CLToolExe>$(SolutionDir)/compiler/cl.exe</CLToolExe>
19+
</PropertyGroup>
20+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
22+
<ConfigurationType>StaticLibrary</ConfigurationType>
23+
<UseDebugLibraries>false</UseDebugLibraries>
24+
<PlatformToolset>v143</PlatformToolset>
25+
</PropertyGroup>
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
27+
<ImportGroup Label="ExtensionSettings">
28+
</ImportGroup>
29+
<ImportGroup Label="Shared">
30+
</ImportGroup>
31+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
32+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
33+
</ImportGroup>
34+
<PropertyGroup Label="UserMacros" />
35+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
36+
<ClCompile>
37+
<!-- Also mandatory: only /Z7 mode is supported -->
38+
<DebugInformationFormat>OldStyle</DebugInformationFormat>
39+
</ClCompile>
40+
<Link>
41+
<SubSystem>
42+
</SubSystem>
43+
<GenerateDebugInformation>true</GenerateDebugInformation>
44+
</Link>
45+
</ItemDefinitionGroup>
46+
<ItemGroup>
47+
<ClCompile Include="test.cpp" />
48+
</ItemGroup>
49+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
50+
<ImportGroup Label="ExtensionTargets">
51+
</ImportGroup>
52+
</Project>

tests/msvc-msbuild/test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int foo(int x) { return x; }

0 commit comments

Comments
 (0)