Description
Currently, I have 8 different *.csproj
files for each platform configurations:
- GnsSharp.Gns.Win64.csproj
- GnsSharp.Gns.Win32.csproj
- GnsSharp.Gns.Posix64.csproj
- GnsSharp.Gns.Posix32.csproj
- GnsSharp.Steamworks.Win64.csproj
- GnsSharp.Steamworks.Win32.csproj
- GnsSharp.Steamworks.Posix64.csproj
- GnsSharp.Steamworks.Posix32.csproj
The only difference between the csproj files are the DefineConstants
:
<!-- `GnsSharp.Steamworks.Win64.csproj` for example -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>$(DefineConstants);GNS_SHARP_STEAMWORKS_SDK;GNS_SHARP_PLATFORM_WIN64</DefineConstants>
</PropertyGroup>
</Project>
This constants difference is required because:
GNS_SHARP_OPENSOURCE_GNS
vsGNS_SHARP_STEAMWORKS_SDK
- Different native library dependencies between stand-alone GNS & Steamworks
GNS_SHARP_PLATFORM_WIN64
vsGNS_SHARP_PLATFORM_WIN32
vsGNS_SHARP_PLATFORM_POSIX64
vsGNS_SHARP_PLATFORM_POSIX32
- Different native library names across platforms
steam_api64
vssteam_api
vslibsteam_api
size_t
differences between 64/32 bit platforms
- Different native library names across platforms
But, splitting csproj files is not ideal;
The library user need to deal with conditional compilation in their csproj at best, or split their csproj file because of this at worst.
I need to find a way to make this transparent, so that the user don't need to do this.
But it seems that the library user can't <DefineConstant>
on their csproj to change the behavior of the dependent csproj.
Probably I need to do this with .NET Runtime Identifier (RID), but...
- It needs a lot of manual work on the csproj side.
- Does it work with the Godot export? (The main reason I wrote GnsSharp)
Additionally, the Steamworks versions could include the native libraries built in.
But I'm rather hesitant about it, because including huge binaries inside of Git history is known to be not scalable.