krpc / krpc2

Remote Procedure Calls for Kerbal Space Program 2
Other
46 stars 3 forks source link

Support for Windows - Latest in Visual Studio #1

Closed GaryDeco closed 1 year ago

GaryDeco commented 1 year ago
djungelorm commented 1 year ago

Worked fine for me on Visual Studio 2022.

Did you find a problem?

GaryDeco commented 1 year ago

The references do not work out the box. At least for windows. I realize that you can just copy over dlls. By adding a conditional reference to check in default game location it is more build and go. Unless we add .bat/.sh to copy them over. Seemed the reference change would have lower cost.

djungelorm commented 1 year ago

Right. It was just a quick first attempt to get something functional.

Let's leave it as is for now. Once the Windows build scripts for krpc1 are more finalized, we can use the same for this repo.

djungelorm commented 1 year ago

I've updated the repository to use Bazel as its build system. It uses the new (to me) rules_dotnet. So it works on Windows and Linux :) See the readme for details.

I've also added a KRPC2.csproj file that should also work with Visual Studio. However, you do first need to run bazel to fetch dependencies.

djungelorm commented 1 year ago

Note: I am working on this as part of the project restructure.

The approach will be to copy the KSP2 DLLs to lib/ksp2 then build using the .csproj or .sln files. I think this is the simplest cross-platform way to do it.

djungelorm commented 1 year ago

This is done. Instructions for building on Windows can be found in the README.

To summarise, you need to put a copy of KSP2 in lib/ksp2, use bazel to generate some things (a couple of generated .cs files and some DLLs that aren't available via nuget), then load up KRPC2.sln in Visual Studio, and use nuget to fetch the rest of the dependencies.