xamarin-macios/opentk
Rolf Bjarne Kvinge ad20f375c7
[src] Generate a define for each framework for every platform. (#10171)
* [src] Generate a define for each framework for every platform.

Take our list of frameworks per platform, and generate a list of conditional
compiler constants that states that a framework exists for a particular
platform.

Basically generate a list of `-d:HAS_<FRAMEWORK>` for each platform.

This makes it possible to do this:

   #if HAS_COREMEDIA
   using CoreMedia;
   #endif

instead of this:

   #if (PLATFORM1 || PLATFORM2) && !PLATFORM3 || PLATFORM4 || BUT_MAYBE_IF_ITS_FRIDAY
   using CoreMedia;
   #endif

Which makes it much easier when adding new platforms (say Mac Catalyst), or
when a framework is added to an already existing platform.

I've included a few examples of how it would end up looking. Changing all the
code to use these new defines is not the goal (nor is it that these defines
should always be used: sometimes they make most sense, sometimes they don't).

* Use the new defines when building OpenTK-1.0.dll as well.
2020-12-01 11:14:32 +01:00
..
Makefile.include [src] Generate a define for each framework for every platform. (#10171) 2020-12-01 11:14:32 +01:00
opentk.csproj Move System.Drawing types to Mono 2019-03-13 17:26:47 +01:00
opentk.sln Build the platform assemblies. 2016-04-24 14:47:26 -04:00