stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.65k stars 957 forks source link

Add back Windows specific CompilerApp to fix libraries with WPF references #2392

Closed Basewq closed 3 months ago

Basewq commented 4 months ago

PR Details

May be controversial to bring the windows specific CompilerApp back. Pinging @Jklawreszuk & @Kryptos-FR since they've spent a lot of time on the cross-platform transition side of things. This does not remove the cross-platform version, but rather includes the Windows specific version and use that over the cross-platform version.

Related Issue

Fixes #2244 The problem is referencing any Stride libraries that touch WPF code, the ModuleInitializer will try to load the WPF framework if it's not loaded, however WPF is Windows only, so it can't be loaded in any way except by having the Windows specific version.

Types of changes

Checklist

Kryptos-FR commented 3 months ago

I don't see any problem with double targeting for now.

That said what is the use case? Stride libraries beside the one used exclusively for the editor aren't supposed to have any dependencies with WPF. And the ones for the editor aren't expected to be used for Games.

Jklawreszuk commented 3 months ago

I've now tested on Fedora and this change doesn't break support for Linux so this as a temp solution LGTM 👌

Basewq commented 3 months ago

That said what is the use case?

I believe there were a few people in discord that attempted to host Stride in their own WPF application, or something like that (I'm not 100% sure).

My own example project tried to show a way to extend the editor, which requires referencing the editor specific libraries to access certain objects/methods. https://github.com/Basewq/XenkoProofOfConcepts/blob/046c2ce82300ad8ae7d5e9d965e620d442dc789c/LevelEditorExtensionExample/LevelEditorExtensionExample/Editor/LevelEditEditorProcessor.cs#L117 While I actually don't use this, it does show that it's possible to do, although it also shows how difficult it really is to try to extend the editor.

Eideren commented 3 months ago

Thanks !