fix duplicate source inclusion - #30
Conversation
|
Did you try it the other way too - leaving the file in |
|
I didn't try it initially but I have now. It doesn't seem to make a difference. The most recent commit removed it from generic and left it in cocoa. |
|
Since the CI for 0.16.0 passes even on the main branch, how were you encountering / reproducing the problem this PR aims to fix? |
|
When you use SDL as a dependency in a project on Mac that is using zig-compile-commands, building the compilation database shows this message: alorans@alorans:~/code/projects/sdl_test/ > zig build cdb
warning: Found duplicate source file in a single compile step: "/Users/alorans/code/projects/sdl_test/zig-pkg/N-V-__8AAAHL9wLH-k89zUdJesNpvVC3lHMzF3jnhXfuclqx/src/joystick/darwin/SDL_iokitjoystick.c", ignoring repeated instance
warning: Found duplicate source file in a single compile step: "/Users/alorans/code/projects/sdl_test/zig-pkg/N-V-__8AAAHL9wLH-k89zUdJesNpvVC3lHMzF3jnhXfuclqx/src/joystick/darwin/SDL_iokitjoystick.c", ignoring repeated instance
warning: Found duplicate source file in a single compile step: "/Users/alorans/code/projects/sdl_test/zig-pkg/N-V-__8AAAHL9wLH-k89zUdJesNpvVC3lHMzF3jnhXfuclqx/src/joystick/darwin/SDL_iokitjoystick.c", ignoring repeated instanceIt shows the message 3 times because I was using |
|
This issue doesn't really affect the usability of the library in general, but any tooling that introspects the zig build graph can theoretically stumble on this. |
|
Thanks for the PR! I'm surprised this wasn't breaking the build, regardless each implementation file is only intended to be included once so the change is welcome. (I went ahead and moved this one to "generic" before merging since SDL wraps it with the proper ifdefs to allow this.) |
SDL_iokitjoystick.cis included in both the generic and cocoa source list. This can cause issues on Mac, especially with zig-compile-commands.