summaryrefslogtreecommitdiff
path: root/build/smapi.targets
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-10-21 19:42:09 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-10-21 19:42:09 -0400
commitcb9efa4e8266b67ddb5c19a107af389cdedce49c (patch)
treea1704767e9a408d89d7471fc839655614978e907 /build/smapi.targets
parent137d795ab3d01bc132e99e19ba9567fd70f3cec3 (diff)
downloadSMAPI-cb9efa4e8266b67ddb5c19a107af389cdedce49c.tar.gz
SMAPI-cb9efa4e8266b67ddb5c19a107af389cdedce49c.tar.bz2
SMAPI-cb9efa4e8266b67ddb5c19a107af389cdedce49c.zip
add support for platform targeting
Diffstat (limited to 'build/smapi.targets')
-rw-r--r--build/smapi.targets31
1 files changed, 27 insertions, 4 deletions
diff --git a/build/smapi.targets b/build/smapi.targets
index 2c0ca5b7..074581b4 100644
--- a/build/smapi.targets
+++ b/build/smapi.targets
@@ -1,5 +1,23 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- find game install path -->
+ <!--######
+ ## select target OS
+ #######-->
+ <PropertyGroup>
+ <!-- from override -->
+ <GamePlatform Condition="$(GamePlatform) != 'Linux' AND $(GamePlatform) != 'Mac' AND $(GamePlatform) != 'Windows'"></GamePlatform>
+ <GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_LINUX'))">Linux</GamePlatform>
+ <GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_MAC'))">Mac</GamePlatform>
+ <GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_WINDOWS'))">Windows</GamePlatform>
+
+ <!-- from OS -->
+ <GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'Unix'">Linux</GamePlatform>
+ <GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'OSX'">Mac</GamePlatform>
+ <GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'Windows_NT'">Windows</GamePlatform>
+ </PropertyGroup>
+
+ <!--######
+ ## select game path
+ #######-->
<PropertyGroup>
<!-- injected by Silverplum -->
<GamePath Condition="!Exists('$(GamePath)')">$(STARDEWVALLEY_DIR)</GamePath>
@@ -16,9 +34,11 @@
<GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
</PropertyGroup>
- <!-- set up configuration -->
+ <!--######
+ ## set up configuration
+ #######-->
<Choose>
- <When Condition="$(OS) == 'Windows_NT'">
+ <When Condition="$(GamePlatform) == 'Windows'">
<!-- references -->
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
@@ -63,8 +83,11 @@
</Otherwise>
</Choose>
- <!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
+ <!--######
+ ## validate
+ #######-->
<Target Name="BeforeBuild">
+ <!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a &lt;GamePath&gt; setting with the full directory path containing the Stardew Valley executable." />
</Target>
</Project> \ No newline at end of file