Skip to content
Permalink
Browse files

[Build] Reorganized targets to more easily choose multiple graphics p…

…latforms at once.
  • Loading branch information
xen2 committed May 27, 2019
1 parent 5ebf081 commit 50bcd63e40d4df8112f06f51bc8e8dca9ef28662
Showing with 19 additions and 24 deletions.
  1. +2 −2 build/Xenko.PreSettings.Local.targets
  2. +17 −22 sources/targets/Xenko.GlobalSettings.targets
@@ -1,9 +1,9 @@
<!-- Build file pre-included by all Xenko projects -->
<!-- Build file pre-included by all Xenko projects -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<XenkoCommonPreSettingsName>Xenko</XenkoCommonPreSettingsName>
<XenkoPlatforms Condition="'$(XenkoPlatforms)' == ''">Windows</XenkoPlatforms>
<XenkoGraphicsApiDependentBuildAll Condition="'$(XenkoGraphicsApiDependentBuildAll)' == ''">false</XenkoGraphicsApiDependentBuildAll>
<XenkoGraphicsApis Condition="'$(XenkoGraphicsApis)' == ''">Direct3D11</XenkoGraphicsApis>
</PropertyGroup>
</Project>

@@ -24,29 +24,24 @@
<Import Project="$(MSBuildThisFileDirectory)..\targets\Xenko.Core.GlobalSettings.targets"/>

<!-- Include platform dependent assembly when specified -->
<PropertyGroup Condition="'$(XenkoGraphicsApiDependent)' == 'true' And '$(XenkoGraphicsApiDependentBuildAll)' != 'true'">
<RuntimeIdentifiers></RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And ('$(XenkoGraphicsApi)' == 'Direct3D11' Or '$(XenkoGraphicsApiOriginal)' == '')">$(RuntimeIdentifiers);win-d3d11</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And '$(XenkoGraphicsApi)' == 'Direct3D12'">$(RuntimeIdentifiers);win-d3d12</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And '$(XenkoGraphicsApi)' == 'OpenGL'">$(RuntimeIdentifiers);win-opengl</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And '$(XenkoGraphicsApi)' == 'OpenGLES'">$(RuntimeIdentifiers);win-opengles</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And '$(XenkoGraphicsApi)' == 'Vulkan'">$(RuntimeIdentifiers);win-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Linux;')) And '$(TargetFramework)' == 'netstandard2.0' And ('$(XenkoGraphicsApi)' == 'OpenGL' Or '$(XenkoGraphicsApiOriginal)' == '')">$(RuntimeIdentifiers);linux-opengl</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Linux;')) And '$(TargetFramework)' == 'netstandard2.0' And '$(XenkoGraphicsApi)' == 'Vulkan'">$(RuntimeIdentifiers);linux-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';macOS;')) And '$(TargetFramework)' == 'netstandard2.0' And ('$(XenkoGraphicsApi)' == 'Vulkan' Or '$(XenkoGraphicsApiOriginal)' == '')">$(RuntimeIdentifiers);osx-vulkan</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(XenkoGraphicsApiDependent)' == 'true' And '$(XenkoGraphicsApiDependentBuildAll)' == 'true'">
<!-- Cross-compilation (multiple platforms at once) -->
<RuntimeIdentifiers></RuntimeIdentifiers>
<RuntimeIdentifiers Condition="($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoPlatforms.Contains(';Windows;'))">win-d3d11;win-d3d12;win-opengl;win-opengles;win-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoPlatforms.Contains(';Linux;'))">$(RuntimeIdentifiers);linux-opengl;linux-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoPlatforms.Contains(';macOS;'))">$(RuntimeIdentifiers);osx-vulkan</RuntimeIdentifiers>
<!-- Override if building a specific platform -->
<RuntimeIdentifiers Condition="'$(XenkoPlatformOriginal)' == 'Windows'">win-d3d11;win-d3d12;win-opengl;win-opengles;win-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(XenkoPlatformOriginal)' == 'Linux'">linux-opengl;linux-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(XenkoPlatformOriginal)' == 'macOS'">osx-vulkan</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(XenkoGraphicsApiDependent)' == 'true'">
<!-- Build list of Graphics API -->
<XenkoGraphicsApis Condition="'$(XenkoGraphicsApis)' == '' And '$(XenkoGraphicsApiDependentBuildAll)' == 'true'">Direct3D11;Direct3D12;OpenGL;OpenGLES;Vulkan</XenkoGraphicsApis>
<XenkoGraphicsApis Condition="'$(XenkoGraphicsApis)' == '' And '$(XenkoGraphicsApiDependentBuildAll)' != 'true'">$(XenkoGraphicsApiOriginal)</XenkoGraphicsApis>

<_XenkoGraphicsApis Condition="'$(XenkoGraphicsApis)' != ''">;$(XenkoGraphicsApis);</_XenkoGraphicsApis>

<!-- Compute list of runtime identifiers based on platforms and graphics platforms -->
<RuntimeIdentifiers></RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And ($(_XenkoGraphicsApis.Contains(';Direct3D11;')) Or '$(_XenkoGraphicsApis)' == '')">$(RuntimeIdentifiers);win-d3d11</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoGraphicsApis.Contains(';Direct3D12;'))">$(RuntimeIdentifiers);win-d3d12</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoGraphicsApis.Contains(';OpenGL;'))">$(RuntimeIdentifiers);win-opengl</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoGraphicsApis.Contains(';OpenGLES;'))">$(RuntimeIdentifiers);win-opengles</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Windows;')) And ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(_XenkoGraphicsApis.Contains(';Vulkan;'))">$(RuntimeIdentifiers);win-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Linux;')) And '$(TargetFramework)' == 'netstandard2.0' And ($(_XenkoGraphicsApis.Contains(';OpenGL;')) Or '$(_XenkoGraphicsApis)' == '')">$(RuntimeIdentifiers);linux-opengl</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';Linux;')) And '$(TargetFramework)' == 'netstandard2.0' And $(_XenkoGraphicsApis.Contains(';Vulkan;'))">$(RuntimeIdentifiers);linux-vulkan</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$(_XenkoPlatforms.Contains(';macOS;')) And '$(TargetFramework)' == 'netstandard2.0' And ($(_XenkoGraphicsApis.Contains(';Vulkan;')) Or '$(_XenkoGraphicsApis)' == '')">$(RuntimeIdentifiers);osx-vulkan</RuntimeIdentifiers>

<RuntimeIdentifiers>$([MSBuild]::Unescape($(RuntimeIdentifiers.Trim(';'))))</RuntimeIdentifiers>
<!-- Default fallbacks -->
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'netstandard2.0' And '$(XenkoPlatform)' == 'Linux' And '$(RuntimeIdentifiers)' == ''">linux-opengl</RuntimeIdentifiers>

0 comments on commit 50bcd63

Please sign in to comment.
You can’t perform that action at this time.