2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-03 11:09:40 -04:00

Review bindings

- All raylib structs are now blittable.
- Fixing some incorrect functions(types, naming etc).
- Remove netfx.props.
This commit is contained in:
ChrisDill 2021-03-25 20:32:31 +00:00
parent fb37faaeec
commit e49ca5b92c
6 changed files with 64 additions and 108 deletions

View File

@ -13,7 +13,7 @@ namespace Physac_cs
} }
// Mat2 type (used for polygon shape rotation matrix) // Mat2 type (used for polygon shape rotation matrix)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Mat2 public struct Mat2
{ {
public float m00; public float m00;
@ -63,7 +63,7 @@ namespace Physac_cs
} }
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct PolygonData public struct PolygonData
{ {
public uint vertexCount; // Current used vertex and normals count public uint vertexCount; // Current used vertex and normals count
@ -71,7 +71,7 @@ namespace Physac_cs
public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct PhysicsShape public struct PhysicsShape
{ {
public PhysicsShapeType type; // Physics shape type (circle or polygon) public PhysicsShapeType type; // Physics shape type (circle or polygon)
@ -81,14 +81,11 @@ namespace Physac_cs
public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes) public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes)
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public partial struct PhysicsBodyData public struct PhysicsBodyData
{ {
public uint id; public uint id;
public byte enabled;
[MarshalAs(UnmanagedType.Bool)]
public bool enabled;
public Vector2 position; public Vector2 position;
public Vector2 velocity; public Vector2 velocity;
public Vector2 force; public Vector2 force;
@ -102,20 +99,13 @@ namespace Physac_cs
public float staticFriction; public float staticFriction;
public float dynamicFriction; public float dynamicFriction;
public float restitution; public float restitution;
public byte useGravity;
[MarshalAs(UnmanagedType.Bool)] public byte isGrounded;
public bool useGravity; public byte freezeOrient;
[MarshalAs(UnmanagedType.Bool)]
public bool isGrounded;
[MarshalAs(UnmanagedType.Bool)]
public bool freezeOrient;
public PhysicsShape shape; public PhysicsShape shape;
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct PhysicsManifoldData public struct PhysicsManifoldData
{ {
public uint id; // Reference unique identifier public uint id; // Reference unique identifier

View File

@ -8,7 +8,7 @@ using Raylib_cs;
namespace Raygui_cs namespace Raygui_cs
{ {
// Style property // Style property
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
struct GuiStyleProp struct GuiStyleProp
{ {
ushort controlId; ushort controlId;
@ -412,11 +412,11 @@ namespace Raygui_cs
// Color Bar Alpha control // Color Bar Alpha control
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiColorBarAlpha(Rectangle bounds, float alpha); public static extern float GuiColorBarAlpha(Rectangle bounds, float alpha);
// Color Bar Hue control // Color Bar Hue control
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiColorBarHue(Rectangle bounds, float value); public static extern float GuiColorBarHue(Rectangle bounds, float value);
// Styles loading functions // Styles loading functions

View File

@ -24,18 +24,18 @@ namespace Raylib_cs.Tests
Assert.True(BlittableHelper.IsBlittable<MaterialMap>()); Assert.True(BlittableHelper.IsBlittable<MaterialMap>());
Assert.True(BlittableHelper.IsBlittable<Material>()); Assert.True(BlittableHelper.IsBlittable<Material>());
Assert.True(BlittableHelper.IsBlittable<Transform>()); Assert.True(BlittableHelper.IsBlittable<Transform>());
// Assert.True(BlittableHelper.IsBlittable<BoneInfo>()); Assert.True(BlittableHelper.IsBlittable<BoneInfo>());
Assert.True(BlittableHelper.IsBlittable<Model>()); Assert.True(BlittableHelper.IsBlittable<Model>());
Assert.True(BlittableHelper.IsBlittable<Model>()); Assert.True(BlittableHelper.IsBlittable<Model>());
Assert.True(BlittableHelper.IsBlittable<ModelAnimation>()); Assert.True(BlittableHelper.IsBlittable<ModelAnimation>());
Assert.True(BlittableHelper.IsBlittable<Ray>()); Assert.True(BlittableHelper.IsBlittable<Ray>());
// Assert.True(BlittableHelper.IsBlittable<RayHitInfo>()); Assert.True(BlittableHelper.IsBlittable<RayHitInfo>());
Assert.True(BlittableHelper.IsBlittable<BoundingBox>()); Assert.True(BlittableHelper.IsBlittable<BoundingBox>());
Assert.True(BlittableHelper.IsBlittable<Wave>()); Assert.True(BlittableHelper.IsBlittable<Wave>());
Assert.True(BlittableHelper.IsBlittable<AudioStream>()); Assert.True(BlittableHelper.IsBlittable<AudioStream>());
Assert.True(BlittableHelper.IsBlittable<Sound>()); Assert.True(BlittableHelper.IsBlittable<Sound>());
// Assert.True(BlittableHelper.IsBlittable<Music>()); Assert.True(BlittableHelper.IsBlittable<Music>());
// Assert.True(BlittableHelper.IsBlittable<VrDeviceInfo>()); Assert.True(BlittableHelper.IsBlittable<VrDeviceInfo>());
} }
} }
} }

View File

@ -6,7 +6,7 @@ using System.Security;
namespace Raylib_cs namespace Raylib_cs
{ {
// Color type, RGBA (32bit) // Color type, RGBA (32bit)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Color public struct Color
{ {
public byte r; public byte r;
@ -66,7 +66,7 @@ namespace Raylib_cs
} }
// Rectangle type // Rectangle type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Rectangle public struct Rectangle
{ {
public float x; public float x;
@ -85,7 +85,7 @@ namespace Raylib_cs
// Image type, bpp always RGBA (32bit) // Image type, bpp always RGBA (32bit)
// NOTE: Data stored in CPU memory (RAM) // NOTE: Data stored in CPU memory (RAM)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Image public struct Image
{ {
public IntPtr data; // Image raw data (void *) public IntPtr data; // Image raw data (void *)
@ -97,7 +97,7 @@ namespace Raylib_cs
// Texture2D type // Texture2D type
// NOTE: Data stored in GPU memory // NOTE: Data stored in GPU memory
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Texture2D public struct Texture2D
{ {
public uint id; // OpenGL texture id public uint id; // OpenGL texture id
@ -108,7 +108,7 @@ namespace Raylib_cs
} }
// RenderTexture2D type, for texture rendering // RenderTexture2D type, for texture rendering
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct RenderTexture2D public struct RenderTexture2D
{ {
public uint id; // OpenGL Framebuffer Object (FBO) id public uint id; // OpenGL Framebuffer Object (FBO) id
@ -117,7 +117,7 @@ namespace Raylib_cs
} }
// N-Patch layout info // N-Patch layout info
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct NPatchInfo public struct NPatchInfo
{ {
public Rectangle sourceRec; // Region in the texture public Rectangle sourceRec; // Region in the texture
@ -129,7 +129,7 @@ namespace Raylib_cs
} }
// Font character info // Font character info
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct CharInfo public struct CharInfo
{ {
public int value; // Character value (Unicode) public int value; // Character value (Unicode)
@ -140,7 +140,7 @@ namespace Raylib_cs
} }
// Font type, includes texture and charSet array data // Font type, includes texture and charSet array data
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Font public struct Font
{ {
public int baseSize; // Base size (default chars height) public int baseSize; // Base size (default chars height)
@ -152,7 +152,7 @@ namespace Raylib_cs
} }
// Camera type, defines a camera position/orientation in 3d space // Camera type, defines a camera position/orientation in 3d space
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Camera3D public struct Camera3D
{ {
public Vector3 position; // Camera position public Vector3 position; // Camera position
@ -172,7 +172,7 @@ namespace Raylib_cs
} }
// Camera2D type, defines a 2d camera // Camera2D type, defines a 2d camera
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Camera2D public struct Camera2D
{ {
public Vector2 offset; // Camera offset (displacement from target) public Vector2 offset; // Camera offset (displacement from target)
@ -191,7 +191,7 @@ namespace Raylib_cs
// Vertex data definning a mesh // Vertex data definning a mesh
// NOTE: Data stored in CPU memory (and GPU) // NOTE: Data stored in CPU memory (and GPU)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Mesh public struct Mesh
{ {
public int vertexCount; // Number of vertices stored in arrays public int vertexCount; // Number of vertices stored in arrays
@ -218,7 +218,7 @@ namespace Raylib_cs
} }
// Shader type (generic) // Shader type (generic)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Shader public struct Shader
{ {
public uint id; // Shader program id public uint id; // Shader program id
@ -226,7 +226,7 @@ namespace Raylib_cs
} }
// Material texture map // Material texture map
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct MaterialMap public struct MaterialMap
{ {
public Texture2D texture; // Material map texture public Texture2D texture; // Material map texture
@ -235,7 +235,7 @@ namespace Raylib_cs
} }
// Material type (generic) // Material type (generic)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Material public struct Material
{ {
public Shader shader; // Material shader public Shader shader; // Material shader
@ -244,7 +244,7 @@ namespace Raylib_cs
} }
// Transformation properties // Transformation properties
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Transform public struct Transform
{ {
public Vector3 translation; // Translation public Vector3 translation; // Translation
@ -253,16 +253,15 @@ namespace Raylib_cs
} }
// Bone information // Bone information
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct BoneInfo public struct BoneInfo
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public IntPtr name; // Bone name (char[32])
public char[] name; // Bone name
public int parent; // Bone parent public int parent; // Bone parent
} }
// Model type // Model type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Model public struct Model
{ {
public Matrix4x4 transform; // Local transform matrix public Matrix4x4 transform; // Local transform matrix
@ -277,7 +276,7 @@ namespace Raylib_cs
} }
// Model animation // Model animation
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct ModelAnimation public struct ModelAnimation
{ {
public int boneCount; // Number of bones public int boneCount; // Number of bones
@ -287,7 +286,7 @@ namespace Raylib_cs
} }
// Ray type (useful for raycast) // Ray type (useful for raycast)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Ray public struct Ray
{ {
public Vector3 position; // Ray position (origin) public Vector3 position; // Ray position (origin)
@ -301,18 +300,17 @@ namespace Raylib_cs
} }
// Raycast hit information // Raycast hit information
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct RayHitInfo public struct RayHitInfo
{ {
[MarshalAs(UnmanagedType.I1)] public byte hit; // Did the ray hit something?
public bool hit; // Did the ray hit something?
public float distance; // Distance to nearest hit public float distance; // Distance to nearest hit
public Vector3 position; // Position of nearest hit public Vector3 position; // Position of nearest hit
public Vector3 normal; // Surface normal of hit public Vector3 normal; // Surface normal of hit
} }
// Bounding box type // Bounding box type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct BoundingBox public struct BoundingBox
{ {
public Vector3 min; // Minimum vertex box-corner public Vector3 min; // Minimum vertex box-corner
@ -326,7 +324,7 @@ namespace Raylib_cs
} }
// Wave type, defines audio wave data // Wave type, defines audio wave data
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Wave public struct Wave
{ {
public uint sampleCount; // Number of samples public uint sampleCount; // Number of samples
@ -338,7 +336,7 @@ namespace Raylib_cs
// Audio stream type // Audio stream type
// NOTE: Useful to create custom audio streams not bound to a specific file // NOTE: Useful to create custom audio streams not bound to a specific file
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct AudioStream public struct AudioStream
{ {
public IntPtr audioBuffer; // Pointer to internal data(rAudioBuffer *) used by the audio system public IntPtr audioBuffer; // Pointer to internal data(rAudioBuffer *) used by the audio system
@ -348,7 +346,7 @@ namespace Raylib_cs
} }
// Sound source type // Sound source type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Sound public struct Sound
{ {
public AudioStream stream; // Audio stream public AudioStream stream; // Audio stream
@ -357,20 +355,19 @@ namespace Raylib_cs
// Music stream type (audio file streaming from memory) // Music stream type (audio file streaming from memory)
// NOTE: Anything longer than ~10 seconds should be streamed // NOTE: Anything longer than ~10 seconds should be streamed
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct Music public struct Music
{ {
public AudioStream stream; // Audio stream public AudioStream stream; // Audio stream
public uint sampleCount; // Total number of samples public uint sampleCount; // Total number of samples
[MarshalAs(UnmanagedType.I1)] public byte looping; // Music looping enable
public bool looping; // Music looping enable
public int ctxType; // Type of music context (audio filetype) public int ctxType; // Type of music context (audio filetype)
public IntPtr ctxData; // Audio context data, depends on type (void *) public IntPtr ctxData; // Audio context data, depends on type (void *)
} }
// Head-Mounted-Display device parameters // Head-Mounted-Display device parameters
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential)]
public struct VrDeviceInfo public unsafe struct VrDeviceInfo
{ {
public int hResolution; // HMD horizontal resolution in pixels public int hResolution; // HMD horizontal resolution in pixels
public int vResolution; // HMD vertical resolution in pixels public int vResolution; // HMD vertical resolution in pixels
@ -380,12 +377,8 @@ namespace Raylib_cs
public float eyeToScreenDistance; // HMD distance between eye and display in meters public float eyeToScreenDistance; // HMD distance between eye and display in meters
public float lensSeparationDistance; // HMD lens separation distance in meters public float lensSeparationDistance; // HMD lens separation distance in meters
public float interpupillaryDistance; // HMD IPD (distance between pupils) in meters public float interpupillaryDistance; // HMD IPD (distance between pupils) in meters
public fixed float lensDistortionValues[4]; // HMD lens distortion constant parameters
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public fixed float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters
public float[] lensDistortionValues; // HMD lens distortion constant parameters
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public float[] chromaAbCorrection; // HMD chromatic aberration correction parameters
} }
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
@ -1196,7 +1189,8 @@ namespace Raylib_cs
// Save data to file from byte array (write) // Save data to file from byte array (write)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SaveFileData(string fileName, IntPtr data, int bytesToWrite); [return: MarshalAs(UnmanagedType.I1)]
public static extern bool SaveFileData(string fileName, IntPtr data, int bytesToWrite);
// Check file extension // Check file extension
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@ -1222,22 +1216,23 @@ namespace Raylib_cs
// Compress data (DEFLATE algorythm) // Compress data (DEFLATE algorythm)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern byte[] CompressData(ref byte[] data, int dataLength, ref int compDataLength); public static extern IntPtr CompressData(byte[] data, int dataLength, ref int compDataLength);
// Decompress data (DEFLATE algorythm) // Decompress data (DEFLATE algorythm)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern byte[] DecompressData(ref byte[] compData, int compDataLength, ref int dataLength); public static extern IntPtr DecompressData(byte[] compData, int compDataLength, ref int dataLength);
// Persistent storage management // Persistent storage management
// Save integer value to storage file (to defined position) // Save integer value to storage file (to defined position)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void StorageSaveValue(int position, int value); [return: MarshalAs(UnmanagedType.I1)]
public static extern bool SaveStorageValue(uint position, int value);
// Load integer value from storage file (from defined position) // Load integer value from storage file (from defined position)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int StorageLoadValue(int position); public static extern int LoadStorageValue(uint position);
// Open URL with default system browser (if available) // Open URL with default system browser (if available)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@ -2306,8 +2301,9 @@ namespace Raylib_cs
// Mesh loading/unloading functions // Mesh loading/unloading functions
// Load meshes from model file // Load meshes from model file
// IntPtr refers to a Mesh *
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh[] LoadMeshes(string fileName, ref int meshCount); public static extern IntPtr LoadMeshes(string fileName, ref int meshCount);
// Unload mesh from memory (RAM and/or VRAM) // Unload mesh from memory (RAM and/or VRAM)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@ -2321,8 +2317,9 @@ namespace Raylib_cs
// Material loading/unloading functions // Material loading/unloading functions
// Load materials from model file // Load materials from model file
// IntPtr refers to Material *
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Material[] LoadMaterials(string fileName, ref int materialCount); public static extern IntPtr LoadMaterials(string fileName, ref int materialCount);
// Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

View File

@ -5,16 +5,14 @@ using System.Security;
namespace Raylib_cs namespace Raylib_cs
{ {
// NOTE: Helper types to be used instead of array return types for *ToFloat functions // NOTE: Helper types to be used instead of array return types for *ToFloat functions
public struct float3 public unsafe struct float3
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public fixed float v[3];
public float[] v;
} }
public struct float16 public unsafe struct float16
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public fixed float v[16];
public float[] v;
} }
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]

View File

@ -1,29 +0,0 @@
<!-- https://stackoverflow.com/a/55818290/4505043 -->
<!-- https://www.cafe-encounter.net/p2312/multi-targetting-net-framework-and-net-core-in-a-single-project -->
<!-- https://github.com/dotnet/sdk/issues/335#issuecomment-368669050 -->
<Project>
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net45'">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net451'">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net452'">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net46'">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net461'">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net462'">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net47'">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net471'">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
</Project>