Skip to content

Commit 7867975

Browse files
committed
fix: only create SDL3 SONAME symlink on Linux, not macOS
- macOS dylib versioning doesn't use SONAME symlinks like Linux .so files. - Creating a symlink with the same source and target causes ELOOP error.
1 parent e25e4c5 commit 7867975

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

examples/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ add_custom_command(TARGET SimpleRoom POST_BUILD
6363
)
6464

6565
# Copy SDL3 shared library to SimpleRoom output directory
66-
# On Unix, we also need to create the SONAME symlink (libSDL3.so.0 -> libSDL3.so.0.x.x)
67-
if(UNIX)
66+
# On Linux, we also need to create the SONAME symlink (libSDL3.so.0 -> libSDL3.so.0.x.x)
67+
# macOS doesn't need SONAME symlink (dylib versioning works differently)
68+
if(UNIX AND NOT APPLE)
6869
add_custom_command(TARGET SimpleRoom POST_BUILD
6970
COMMAND ${CMAKE_COMMAND} -E copy_if_different
7071
"$<TARGET_FILE:SDL3::SDL3>"
@@ -76,6 +77,7 @@ if(UNIX)
7677
VERBATIM
7778
)
7879
else()
80+
# Windows and macOS: just copy the library file
7981
add_custom_command(TARGET SimpleRoom POST_BUILD
8082
COMMAND ${CMAKE_COMMAND} -E copy_if_different
8183
"$<TARGET_FILE:SDL3::SDL3>"

0 commit comments

Comments
 (0)