so i compiled SDL3 into a local folder in my home. unfortunately i cant install it system wide and i also dont want to have inside my swift project.
my project structure (sorry the formatting i cant figure out how you guys do it in your posts):
-- Project
---- Sources
------ Csdl3
-------- include
---------- header.h
------ ProjectName
-------- main.swift
header.h just contains:
#pragma once
#include <SDL3/SDL.h>
my package.swift:
targets: [
.target(
name: "Csdl3",
cSettings: [
.unsafeFlags([
"-I/Users/somewhere/Developer/SDL/build/install/include",
])
],
linkerSettings: [
.unsafeFlags([
"-L/Users/somewhere/Developer/SDL/build/install/lib,
"-Xlinker", "-rpath", "-Xlinker", "/Users/somewhere/Developer/SDL/build/install/lib",
"-lSDL3",
])
]
),
.executableTarget(name: "project", dependencies: ["Csdl3"]),
when compiling i get:
2 | #pragma once
3 |
4 | #include "SDL3/SDL.h"
| `- error: 'SDL3/SDL.h' file not found
and when i check the build flags using --verbose, the includes and linker settings are not there!
what its annoying to me is that i had this working before with swift 5.9, but i decided to delete the project and re-do in swift 6 and i must be missing something..
already tried with .headerSearchPath
instead of unsafeFlags
and the publicHeadersPath
argument for target but still doesnt work, always the same file not found error.
any tips or help please?
thanks in advanced.