Open veosar opened 9 months ago
you need to modify the following files :
/codemp/rd-dedicated/qgl.h to
codemp/rd-rend2/qgl.h to
codemp\rd-rend2\G2_misc..cpp to
codemp\rd-rend2\CMakeLists.txt to
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/x86_64-w64-mingw32.cmake .. make
Reporting a bug? Please make sure you've given the following information - thanks!
Operating system and version:
Building inside docker on Ubuntu 22.04 with mingw (Dockerfile provided in my repo to reproduce), target is Windows x64 using OpenJK provided toolchain.
Is this for single player or multiplayer?
MP
Description of the bug (and if possible, steps to reproduce the bug):
Here is my fork with additional dockerfile added to show my setup and allow to reproduce in simplest way possible:
https://github.com/veosar/OpenJK-Fixes/tree/issues/rend2-mingw-crosscompile
You can clone the repo or just copy the Dockerfile-Rend2Issue to your local repo. After you do that, go into OpenJK main directory and run command
docker build -f Dockerfile-Rend2Issue
.. Firstly, it will fail with this issue:I think this is due to these lines of code:
Trying to include lowercase gl due to WIN32 flag that do not exist in Linux environment.
I will just change this
#include <gl/gl.h> to <GL/gl.h>
just to get through this quickly.After you bypass this issue and continue, you get this error:
Probably due to the previous _WIN32 flag (I don't know), compact_glsl seems to be building with .exe extension and therefore cmake can't find it.
I guess it could be fixed by using MINGW flag in if conditions in some capacity. I couldn't find a clean way myself though.
Of course the issue can be bypassed in numerous ways, but it's a fact that in current state it does not work OOTB.
What did you expect to happen instead?
Rend2 files and compact_glsl should recognize correctly that it's being built on Linux against Windows, not being built on Windows. In scenario provided it should build seamlessly, just like RD Vanilla.