SDL
SDL copied to clipboard
Add support for building SDL with Watcom compilers using CMake
This pr ports Makefile.w32
and Makefile.os2
to the cmake build script.
When targeting windows with watcom, __cdecl
gets in the way and needs
handling properly: Our current solution is defining DECLSPEC
as an empty
macro and using an exports file. See lines 36 and 252 of Makefile.w32 if
you haven't handled that already.
Does cmake automatically add -bd
to compiler switches when building a dll?
When targeting windows with watcom,
__cdecl
gets in the way and needs handling properly: Our current solution is definingDECLSPEC
as an empty macro and using an exports file. See lines 36 and 252 of Makefile.w32 if you haven't handled that already.
I saw those lines, but forgot to port these as I didn't see any link errors when using/testing the DLL. I'll add those lines.
Does cmake automatically add
-bd
to compiler switches when building a dll?
Yes, it's added automatically.
When targeting windows with watcom,
__cdecl
gets in the way and needs handling properly: Our current solution is definingDECLSPEC
as an empty macro and using an exports file. See lines 36 and 252 of Makefile.w32 if you haven't handled that already.I saw those lines, but forgot to port these as I didn't see any link errors when using/testing the DLL
The issue is, if you don't do that the dll will only work exes built with watcom against a watcom-generated import library. This way you can replace the mingw- or msvc-built dll with a watcom-built one and the corresponding exe will still work correctly.
Thanks for explaining to me, I fixed it in the latest commit.
If anybody wants to test this on their local Windows machine, make sure to use the latest nightly open watcom 2.0 build because older versions cannot handle response files that are too big.
Is this something that someone asked for? It seems like Makefile.os2 has been around and does what we need for that platform.
The cost of supporting Watcom in the cmake script is low. There were already some references to OS2 in the cmake script, but they were not used (until now). Adding CMake support allows our users to keep using their cmake based build system when targeting these legacy operating systems.
There were already some references to OS2 in the cmake script, but they were not used (until now).
They were there for emx (gcc-based toolchain targeting os/2 but native-only, no cross-solutions at all.)
@sezero, you just removed the custom Watcom Makefiles, is this something you still want?
@sezero, you just removed the custom Watcom Makefiles, is this something you still want?
No, we don't want this anymore