fix building on CYGWIN#15457
Conversation
|
Building SDL with the cygwin UNIX layer is not officially supported. If you'd like it to be, please add a cygwin build configuration to the github actions and verify that all the automated tests pass. |
Hm... then what about unofficial support (currently)? |
Yes, fixing the building is great, but fixing functionality is even better. I know @madebr had a PR a while back to add cygwin CI, maybe he can contribute it to this PR? |
|
It seems to me that several months could easily pass before the build in CI is established, so I’ll probably once again suggest accepting PR as is now |
|
Let me know if I screwed something up. |
|
Thanks @madebr! CI is failing, FYI |
Yup, I assume TrueCat17 is in a better position to fix these errors as he probably has a local development setup. |
|
I did not include the |
|
Please look into the build failure. It looks very simple. |
|
Maybe something like this for _wcsdup? --- a/src/hidapi/windows/hid.c
+++ b/src/hidapi/windows/hid.c
@@ -48 +48 @@
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && !defined(HIDAPI_USING_SDL_RUNTIME)Don't know what's the thing about SDL_toupper. If only we had the |
|
It seems like everything has been fixed, but everything only works with disabled DirectX, the joystick subsystem (which depends on DirectX) and a few other things I also remind you that just because something has been compiled and even linked, this does not mean at all that it will work |
|
I think I did |
|
I'm using cygwin for |
|
I think it will be easier for you to solve the remaining problems related specifically to Maybe, at least until the build completes successfully, it would be logical to turn off |
|
Can you guys look at / test my branch: https://github.com/sezero/SDL/tree/cygwin Library build succeeds with everything possible enabled. Tests builds fail due to some python error: Details |
This script never runs for me at all (at least I didn’t find one in a text search in the build folder) The path looks very strange Somewhere there is a “fixing” (“canonization”?) of the path and it ruins everything By the way, the difference in behavior may also be due to the fact that I use |
Apart from the changes in there, there seems to be more work to be done: The following sources have
|
After adding python and perl installs to CI/cygwin, build fully succeeds. However, install/packaging fails because build seems to generate |
|
After applying madebr's lat patch: success. But: |
It looks like the exes cannot find the DLL. |
/cc @TrueCat17 |
|
I've done all ı could for now at https://github.com/sezero/SDL/tree/cygwin |
|
P.S.: Last (as of this writing) build artifact downloadable from https://github.com/sezero/SDL/actions/runs/25188142275 |
|
To understand what the problem is, we need to look at the specified file: Guess of @madebr is good, but it's better to know for sure rather than guess My |
|
One minor edit to tests/ cmake'ry for PATH, and tests now run. Failures, though: https://github.com/sezero/SDL/actions/runs/25257709310/job/74059843233 testsem, testprocess: Some command-line failure??? |
“No audio device” - a typical situation for a virtual machine
As expected, because this is a “manual” test for monitoring the rendering result in different modes, as far as I understand |
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4060,7 +4060,7 @@ if(SDL_SHARED)
SOVERSION "${SDL_SO_VERSION_MAJOR}"
)
else()
- if(WINDOWS OR CYGWIN)
+ if(WINDOWS)
set_target_properties(SDL3-shared PROPERTIES
PREFIX ""
)Fix for a code error it likely has no effect Tim S. |
/cc @madebr @TrueCat17 |
CTest runs all tests with dummy audio and video drivers.
No, |
I think naming the dll |
The does nothing because it never gets there the if branch above is taken because CYGWIN has UNIX true via cmake command. Tim S. |
sezero edited d3d12.h about 200 places to get more items to build. The above patch got the building to work without editing that generated header. |
Some ideas are likely from PR 15457 and sezero cygwin branch libsdl-org#15457 https://github.com/sezero/SDL/tree/cygwin Co-authored-by: TrueCat17 <truecat17@gmail.com> Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com> Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
|
Btw, the |
|
Here is the latest version of my patch, against current main branch: 0001-CYGWIN-support.patch Here is the CI job log for it: cygwin-ci-job-log.txt I deleted my own branch: Won't be messing with cygwin any further. |
|
I got CYGWIN CI tests to pass; but it failed on a later step of verify sdl3.pc. Edit: My branch is highly edited from this PR and doing the changes described below could fix the PR without the later failure. Edit2: For my MSYS branch it just seems to hide the failure for tests 2,23,24 and maybe others I did not see when I downloaded the log files. The comment of the commit that fixed it; no idea if it is a good fix or not, I started this work to learn a little on how to do CI. I am now going to be removing changes to see what is really needed for CI to pass. Tim S. |
|
This is obsolete since #15566 has been merged. |
Existing Issue(s)
Fix for issue #15360
Warning: the building will only work with Software and OpenGL renderers, others (including DirectX) have not been tested
Also I only tested building a static library, not a dynamic one