diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-10-21 19:42:09 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-10-21 19:42:09 -0400 |
commit | cb9efa4e8266b67ddb5c19a107af389cdedce49c (patch) | |
tree | a1704767e9a408d89d7471fc839655614978e907 /build/smapi.targets | |
parent | 137d795ab3d01bc132e99e19ba9567fd70f3cec3 (diff) | |
download | SMAPI-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.targets | 31 |
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 <GamePath> setting with the full directory path containing the Stardew Valley executable." /> </Target> </Project>
\ No newline at end of file |