Hey, Swift noobie here. I want to create a wrapper for SDL3 since the ones that I found online don't support Windows yet. But the process is driving me insane. I have SDL3 downloaded and prebuilt it as a DLL + Lib and headers as follows:
-Dependencies
| \---SDL3
| | module.modulemap
| | SDL3.dll
| | SDL3.lib
| |
| \---SDL3
| SDL.h
| * rest of the SDL headers *
My module map is defined as follows:
module CSDL3 [system][extern_c] {
umbrella header "SDL3/SDL.h"
link "SDL3"
export *
}
And I have created a system library for SDL3 itself as well as a Swift target that depends on it that I intend to fill with SDL wrappers
// swift-tools-version:6.1
import PackageDescription
let package = Package(
name: "SwfitDL",
products: [
.library(name: "SwiftDL", targets: ["SwiftDL"])
],
targets: [
.systemLibrary(name: "CSDL3", path: "Dependencies/SDL3", pkgConfig: nil, providers: []),
.target(
name: "SwiftDL", dependencies: ["CSDL3"],
linkerSettings: [
.unsafeFlags(["-L", "./Dependencies/SDL3"]),
.unsafeFlags(["-I", "./Dependencies/SDL3"]),
.linkedLibrary("SDL3"),
]
),
]
)
But for the life of me I cannot get it to build. Instead I get the same error:
error: 'SDL3/SDL_stdinc.h' file not found
32 | #define SDL_h_
33 |
34 | #include <SDL3/SDL_stdinc.h>
| `- error: 'SDL3/SDL_stdinc.h' file not found
I have checked, that file is located in the SDL3 folder with all the other headers. All the other examples I have found online don't support Windows or they expect SDL3 to be available on the system path which also isn't the case here. Any help would be hugely appreciated