Do you mean the following?
swiftSettings: [
.unsafeFlags(["-Isdl/include"], .when(platforms: [.windows])),
.unsafeFlags(["-Xcc", "-DDECLSPEC=__declspec(dllimport)"], .when(platforms: [.windows])),
],
This does remove the linker warnings, however, for some reason I don't understand the additional flag seems to affect the previous -I flag, as I suddenly get errors stating the SDL header files (in sdl/include) cannot be found.
I've also tried adding a .define("DECLSPEC", to: "__declspec(dllimport)") setting to cSettings or cxxSettings, but that has the same result (headers not found anymore).
On the command line, I haven't had any success at all, with the following command:
swift build --build-tests -Xswiftc -I"sdl/include" -Xcc -DDECLSPEC=__declspec(dllimport) -Xlinker -L"sdl/lib"
This builds my project as usual, but the linker warnings are still there.
In PowerShell, this command doesn't work ("The term 'dllimport' is not recognized as a name of a cmdlet, function, script file, or executable program"). I've tried adding more quotes as follows:
swift build --build-tests -Xswiftc -I"sdl/include" -Xcc -D"DECLSPEC=__declspec(dllimport)" -Xlinker -L"sdl/lib"
But the result is the same as in Command Prompt (builds, but with linker warnings).