-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathplatform.targets
35 lines (31 loc) · 1.35 KB
/
platform.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="utf-8" ?>
<!--
Include this file at the end of a csproj file (just before the
include of Microsoft.CSharp.targets) to add system-specific defines
for conditional compilation.
Example: libpalaso/SIL.Core.Tests/SIL.Core.Tests.csproj
These constants will be defined:
SYSTEM_UNIX - should be compiled on Linux and Mac
SYSTEM_MAC - should only be compiled on Mac (e.g. Unit Tests specific to Mac)
SYSTEM_LINUX - should only be compiled on Linux
In csproj file:
<Include Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Include Project="..\build\platform.targets" />
To use in C# code:
#if SYSTEM_MAC
/* code that should only be compiled on Mac */
#endif
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="UnixName" AssemblyFile="..\packages\SIL.BuildTasks.1.0.0\tools\SIL.BuildTasks.dll" />
<Target Name="BeforeBuild">
<UnixName>
<Output TaskParameter="Value" PropertyName="UNIX_NAME" />
</UnixName>
<PropertyGroup>
<DefineConstants Condition="'$(OS)' == 'Unix'">$(DefineConstants);SYSTEM_UNIX</DefineConstants>
<DefineConstants Condition="'$(UNIX_NAME)' == 'Darwin'">$(DefineConstants);SYSTEM_MAC</DefineConstants>
<DefineConstants Condition="'$(UNIX_NAME)' == 'Linux'">$(DefineConstants);SYSTEM_LINUX</DefineConstants>
</PropertyGroup>
</Target>
</Project>