Skip to content

Commit

Permalink
Compile VC++ from VS and cli
Browse files Browse the repository at this point in the history
  • Loading branch information
RussKie committed May 30, 2021
1 parent 8112766 commit 3eea466
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 33 deletions.
23 changes: 8 additions & 15 deletions GitExtSshAskPass/SshAskPass.vcxproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\scripts\tools\Settings.props" />

<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -21,11 +19,14 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{E8C01071-3B47-4A3F-9168-AA58A4635638}</ProjectGuid>
<RootNamespace>SshAskPass</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>GitExtSshAskPass</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<CLRSupport>false</CLRSupport>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -96,9 +97,7 @@
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
<SubSystem>Windows</SubSystem>
</Link>
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ClCompile />
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
</Manifest>
Expand All @@ -109,17 +108,13 @@
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ClCompile />
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ClCompile />
<Link>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -131,9 +126,7 @@
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ClCompile />
<Link>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand Down
9 changes: 6 additions & 3 deletions GitExtensions/Project.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,22 @@
</Target>

<!--
Disabled until we find a way to utilise it under .NET
============================================================
_BuildEasyHookDll
Builds EasyHook C++ project in x86 and x64 and copies the outputs to the app's target folder.
============================================================
-->
<Target Name="_BuildEasyHookDll" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.Default.props')" AfterTargets="AfterBuild">
<!-- Build x64 version -->
<!- - Build x64 version - ->
<MSBuild Projects="$(SolutionDir)\Externals\EasyHook\EasyHookDll\EasyHookDll.vcxproj" Properties="Configuration=Release;Platform=x64" />
<Copy SourceFiles="$(SolutionDir)\Externals\EasyHook\EasyHookDll\Build\Release\x64\EasyHook64.dll" DestinationFolder="$(TargetDir)" />
<!-- Build x86 version -->
<!- - Build x86 version - ->
<MSBuild Projects="$(SolutionDir)\Externals\EasyHook\EasyHookDll\EasyHookDll.vcxproj" Properties="Configuration=Release;Platform=Win32" />
<Copy SourceFiles="$(SolutionDir)\Externals\EasyHook\EasyHookDll\Build\Release\x86\EasyHook32.dll" DestinationFolder="$(TargetDir)" />
</Target>
-->

</Project>
7 changes: 5 additions & 2 deletions GitExtensions/Project.Publish.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
</Target>

<!--
Disabled until we find a way to utilise it under .NET
============================================================
_PublishExtraDependecies
Copies additional files (e.g. EasyHook dlls) to the publish directory.
============================================================
-->
<Target Name="_PublishExtraDependecies">
<Copy SourceFiles="$(SolutionDir)\Externals\EasyHook\EasyHookDll\Build\Release\x64\EasyHook64.dll" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="$(SolutionDir)\Externals\EasyHook\EasyHookDll\Build\Release\x86\EasyHook32.dll" DestinationFolder="$(PublishDir)" />
</Target>
-->

<!--
============================================================
Expand Down Expand Up @@ -78,7 +81,7 @@
<!-- Any errors in targets that executed as 'AfterTargets' don't break the build: https://github.com/microsoft/msbuild/issues/3345
A fix is going out in VS16.6p3, but it is way too long for us to wait.
-->
<Target Name="CreatePortable" BeforeTargets="Publish" DependsOnTargets="_RetrieveCurrentBuildVersion;_PublishTranslations;_PublishExtraDependecies;_DownloadPluginManager">
<Target Name="CreatePortable" BeforeTargets="Publish" DependsOnTargets="_RetrieveCurrentBuildVersion;_PublishTranslations;_DownloadPluginManager">
<PropertyGroup>
<_TargetAppConfig>@(AppConfigFileDestination)</_TargetAppConfig>

Expand Down
9 changes: 5 additions & 4 deletions GitExtensionsShellEx/GitExtensionsShellEx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{BBE7B8AD-D175-4679-A614-38BFF28B0269}</ProjectGuid>
<RootNamespace>GitExtensionsShellEx</RootNamespace>
<Keyword>AtlProj</Keyword>
<ProjectName>GitExtensionsShellEx</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<CLRSupport>false</CLRSupport>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -93,7 +96,6 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
</PropertyGroup>
<Import Project="..\scripts\tools\Settings.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>$(ProjectName)32</TargetName>
</PropertyGroup>
Expand Down Expand Up @@ -142,14 +144,13 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<BrowseInformation>true</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>Async</ExceptionHandling>
</ClCompile>
<ResourceCompile />
Expand Down
11 changes: 2 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,11 @@ build_script:
}
# build
dotnet build .\scripts\native.proj -c Release --verbosity q --nologo /bl:.\artifacts\log\native.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
dotnet build -c Release --verbosity q --nologo /bl:.\artifacts\log\build.binlog /p:RunTranslationApp=true /p:ContinuousIntegrationBuild=true
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# if we have reset above, we need to restore the merge commit, otherwise the loc verification step will fail
# refer to https://github.com/gitextensions/gitextensions/issues/7979
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) {
git config user.email "gitextensions@github.com"
git config user.name "Git Extensions"
git commit -m "restore merge commit"
}
# to run your custom scripts instead of automatic tests
test_script:
- ps: |
Expand Down
68 changes: 68 additions & 0 deletions scripts/native.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<!-- Keep Sdk.targets happy -->
<TargetFrameworkIdentifier>net</TargetFrameworkIdentifier>
<TargetFrameworkVersion>5.0</TargetFrameworkVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="vswhere" Version="2.8.4" IsImplicitlyDefined="true" GeneratePathProperty="true" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<Target Name="Build">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<VSWherePath>$([MSBuild]::NormalizePath('$(Pkgvswhere)', 'tools'))</VSWherePath>
</PropertyGroup>

<!-- Work out VS installation path, so we can find MSBuild.exe -->
<Exec
Command="vswhere.exe -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild"
WorkingDirectory="$(VSWherePath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="_VSInstallPath" />
</Exec>

<PropertyGroup>
<_MSBuildCurrentPath>$([MSBuild]::NormalizePath('$(_VSInstallPath)', 'MSBuild', 'Current', 'Bin'))</_MSBuildCurrentPath>

<_GitExtSshAskPassPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'GitExtSshAskPass', 'GitExtSshAskPass.sln'))</_GitExtSshAskPassPath>
<_GitExtensionsShellExPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'GitExtensionsShellEx', 'GitExtensionsShellEx.sln'))</_GitExtensionsShellExPath>

<_ProjectArgs32> /p:Configuration=$(Configuration) /p:Platform=Win32</_ProjectArgs32>
<_ProjectArgs64> /p:Configuration=$(Configuration) /p:Platform=x64</_ProjectArgs64>
</PropertyGroup>

<!-- Build GitExtSshAskPass project, x86 -->
<Exec
Command="msbuild.exe $(_GitExtSshAskPassPath) $(_ProjectArgs32)"
WorkingDirectory="$(_MSBuildCurrentPath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="High">
</Exec>
<!-- Build GitExtensionsShellEx project, x86 -->
<Exec
Command="msbuild.exe $(_GitExtensionsShellExPath) $(_ProjectArgs32)"
WorkingDirectory="$(_MSBuildCurrentPath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="High">
</Exec>
<!-- Build GitExtensionsShellEx project, x64 -->
<Exec
Command="msbuild.exe $(_GitExtensionsShellExPath) $(_ProjectArgs64)"
WorkingDirectory="$(_MSBuildCurrentPath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="High">
</Exec>
</Target>

<!-- Stub out targets required by the Microsoft.NET.Sdk -->
<Target Name="CreateManifestResourceNames"></Target>
</Project>

0 comments on commit 3eea466

Please sign in to comment.