Commit 707239a
fix: avoid SDL3 target conflict when a system SDL3 is installed (#22)
find_package(SDL3) was followed by a check of INTERFACE_INCLUDE_DIRECTORIES
on SDL3::SDL3 to decide whether the found package is usable. In the standard
SDL3 package layout, SDL3::SDL3 is an alias of SDL3::SDL3-shared, which gets
its include dirs transitively via SDL3::Headers instead of carrying them
itself. The check therefore came back empty on e.g. Homebrew installs, SDL3
was fetched from source anyway, and its add_library(SDL3::Headers ALIAS ...)
collided with the already-imported target:
CMake Error: add_library cannot create ALIAS target "SDL3::Headers"
because another target with the same name already exists.
Trust the find_package result instead: fetch only when no SDL3::SDL3 target
exists.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 7e76bea commit 707239a
1 file changed
Lines changed: 1 addition & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 13 | + | |
22 | 14 | | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
26 | 18 | | |
27 | 19 | | |
28 | | - | |
29 | | - | |
30 | | - | |
0 commit comments