Skip to content

Commit

Permalink
Change build config to support the Core build system (for #1415)
Browse files Browse the repository at this point in the history
squashed PR #1702
  • Loading branch information
YoshiRulz authored Dec 3, 2019
1 parent 5e73c7c commit fcc0bc1
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 3 deletions.
2 changes: 2 additions & 0 deletions BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<Import Project="..\DotNetBuild.Resources.targets" Condition="'$(MSBuildRuntimeType)' == 'Core'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\output\dll\</OutputPath>
Expand Down
1 change: 1 addition & 0 deletions BizHawk.Client.Common/BizHawk.Client.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
2 changes: 2 additions & 0 deletions BizHawk.Client.DBMan/BizHawk.Client.DBMan.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<Import Project="..\DotNetBuild.Resources.targets" Condition="'$(MSBuildRuntimeType)' == 'Core'" />
<PropertyGroup>
<StartupObject />
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
Expand Down
2 changes: 2 additions & 0 deletions BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<Import Project="..\DotNetBuild.Resources.targets" Condition="'$(MSBuildRuntimeType)' == 'Core'" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
2 changes: 2 additions & 0 deletions BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<Import Project="..\DotNetBuild.Resources.targets" Condition="'$(MSBuildRuntimeType)' == 'Core'" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
1 change: 1 addition & 0 deletions BizHawk.Common/BizHawk.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
1 change: 1 addition & 0 deletions BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\output\dll\</OutputPath>
Expand Down
1 change: 1 addition & 0 deletions BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\output\dll\</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down
2 changes: 2 additions & 0 deletions Build/standin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
cd "$(dirname "$0")/../Version" && printf "static class SubWCRev\n{\n\tpublic const string SVN_REV = \"%s\";\n\tpublic const string GIT_BRANCH = \"%s\";\n\tpublic const string GIT_SHORTHASH = \"%s\";\n}" "$(git rev-list HEAD --count)" "$(git rev-parse --abbrev-ref HEAD)" "$(git log -1 --format="%h")" >svnrev.cs
2 changes: 1 addition & 1 deletion Dist/BuildDebug.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
cd "$(dirname "$0")/.." && nuget restore BizHawk.sln && msbuild /p:Configuration=Debug BizHawk.sln
cd "$(dirname "$0")/.." && dotnet build BizHawk.sln
2 changes: 1 addition & 1 deletion Dist/BuildRelease.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
cd "$(dirname "$0")/.." && nuget restore BizHawk.sln && msbuild /p:Configuration=Release BizHawk.sln
cd "$(dirname "$0")/.." && dotnet build BizHawk.sln -c Release
5 changes: 5 additions & 0 deletions DotNetBuild.Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
</ItemGroup>
</Project>
24 changes: 24 additions & 0 deletions DotNetBuild.Resources.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<GenerateResourceMSBuildArchitecture Condition=" '$(GenerateResourceMSBuildArchitecture)' == '' ">CurrentArchitecture</GenerateResourceMSBuildArchitecture>
<GenerateResourceMSBuildRuntime Condition=" '$(GenerateResourceMSBuildRuntime)' == '' ">CurrentRuntime</GenerateResourceMSBuildRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Buffers">
<HintPath>..\References\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Memory">
<HintPath>..\References\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics.Vectors">
<HintPath>..\References\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Resources.Extensions">
<HintPath>..\References\System.Resources.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>..\References\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
Binary file added References/System.Buffers.dll
Binary file not shown.
Binary file added References/System.Memory.dll
Binary file not shown.
Binary file added References/System.Numerics.Vectors.dll
Binary file not shown.
Binary file added References/System.Resources.Extensions.dll
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion Version/Version.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\DotNetBuild.Common.targets" Condition=" '$(OS)' != 'Windows_NT' " />
<Target Name="Build">
<Exec WorkingDirectory="$(MSBuildProjectDirectory)" Command="&quot;$(MSBuildProjectDirectory)\subwcrev.bat&quot; $(MSBuildProjectDirectory)" />
</Target>
Expand Down Expand Up @@ -42,7 +43,8 @@
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)..\Build\BizHawk.Build.Tool.exe" GIT_REV --wc "$(ProjectDir).." --template "$(ProjectDir)svnrev_template" --out "$(ProjectDir)svnrev.cs"</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">"$(ProjectDir)..\Build\BizHawk.Build.Tool.exe" GIT_REV --wc "$(ProjectDir).." --template "$(ProjectDir)svnrev_template" --out "$(ProjectDir)svnrev.cs"</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">"$(ProjectDir)../Build/standin.sh"</PreBuildEvent>
</PropertyGroup>
<ItemGroup>
<Compile Include="dummy.cs" />
Expand Down

4 comments on commit fcc0bc1

@InfamousKnight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! So does this mean it will be easier to port cores on platforms other than windows?

@YoshiRulz
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, remaining cores need waterbox

@InfamousKnight
Copy link

@InfamousKnight InfamousKnight commented on fcc0bc1 Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does that mean cores that are already waterboxed can now work on linux? Like picodrive?

@YoshiRulz
Copy link
Member Author

@YoshiRulz YoshiRulz commented on fcc0bc1 Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Core" here is capitalised because I'm referring to .NET Core, as opposed to .NET Framework which the code is written for. It has nothing to do with waterboxed or non-waterboxed cores.

Please sign in to comment.