Skip to content

Unified csproj #2

Open
Open
@copyrat90

Description

@copyrat90

Currently, I have 8 different *.csproj files for each platform configurations:

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 vs GNS_SHARP_STEAMWORKS_SDK
    • Different native library dependencies between stand-alone GNS & Steamworks
  • GNS_SHARP_PLATFORM_WIN64 vs GNS_SHARP_PLATFORM_WIN32 vs GNS_SHARP_PLATFORM_POSIX64 vs GNS_SHARP_PLATFORM_POSIX32
    • Different native library names across platforms
      • steam_api64 vs steam_api vs libsteam_api
    • size_t differences between 64/32 bit 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions