mirror of https://github.com/OpenRCT2/OpenRCT2.git
Automatically download googletest
This commit is contained in:
parent
872976bff4
commit
d26e1df21e
|
@ -65,6 +65,8 @@
|
|||
<LibsUrl>https://github.com/OpenRCT2/Dependencies/releases/download/v$(TargetLibsVersion)/openrct2-libs-vs2015.zip</LibsUrl>
|
||||
<LibsPath>$(RootDir)lib\</LibsPath>
|
||||
<LibsVersionPath>$(LibsPath)libversion</LibsVersionPath>
|
||||
<GtestVersion>1.8.0</GtestVersion>
|
||||
<GtestUrl>https://github.com/google/googletest/archive/release-$(GtestVersion).zip</GtestUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -122,6 +124,7 @@
|
|||
<Target Name="DownloadLibs">
|
||||
<PropertyGroup>
|
||||
<LibsZipPath>$(LibsPath)openrct2-libs-vs2015.zip</LibsZipPath>
|
||||
<GtestZipPath>$(LibsPath)gtest.zip</GtestZipPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Clean libs directory -->
|
||||
|
@ -129,10 +132,18 @@
|
|||
<MakeDir Directories="$(LibsPath)" />
|
||||
|
||||
<Message Text="Downloading libraries..." Importance="normal" />
|
||||
<!-- prebuilt libs -->
|
||||
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest '$(LibsUrl)' -OutFile '$(LibsZipPath)'"" StandardOutputImportance="low" />
|
||||
<Unzip Input="$(LibsZipPath)" OutputDirectory="$(LibsPath)" />
|
||||
<Delete Files="$(LibsZipPath)" ContinueOnError="true" />
|
||||
|
||||
<!-- googletest -->
|
||||
<Message Text="Downloading googletest..." Importance="normal" />
|
||||
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest '$(GtestUrl)' -OutFile '$(GtestZipPath)'"" StandardOutputImportance="low" />
|
||||
<Unzip Input="$(GtestZipPath)" OutputDirectory="$(LibsPath)" />
|
||||
<Delete Files="$(GtestZipPath)" ContinueOnError="true" />
|
||||
<Exec Command="cmd /c move "$(LibsPath)googletest-release-$(GtestVersion)" "$(LibsPath)googletest"" />
|
||||
|
||||
<!-- Update libversion file -->
|
||||
<WriteLinesToFile Lines="$(TargetLibsVersion)" File="$(LibsVersionPath)" Overwrite="true" />
|
||||
</Target>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir>
|
||||
<GtestDir Condition="'$(GtestDir)'==''">$(SolutionDir)lib\googletest\googletest</GtestDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugTests|Win32">
|
||||
|
@ -32,7 +33,7 @@
|
|||
<Import Project="..\..\openrct2.common.props" />
|
||||
<PropertyGroup>
|
||||
<OutDir>$(SolutionDir)bin\tests\</OutDir>
|
||||
<IncludePath>$(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(GtestDir);$(GtestDir)\include;$(SolutionDir)src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
|
@ -48,7 +49,7 @@
|
|||
<ItemGroup>
|
||||
<ClCompile Include="LanguagePackTest.cpp" />
|
||||
<ClCompile Include="sawyercoding_test.cpp" />
|
||||
<ClCompile Include="$(GTestDir)\googletest\src\gtest-all.cc" />
|
||||
<ClCompile Include="$(GtestDir)\src\gtest-all.cc" />
|
||||
<ClCompile Include="tests.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
Loading…
Reference in New Issue