Skip to content

Commit

Permalink
SDL2: fix SDL2 custom target on ubuntu 20.04 for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood committed Jan 15, 2024
1 parent 54ba6cf commit b8e8752
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/dependencies/sdl2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ if(UNIX)
# Tested on ubuntu 20.04 / libsdl2-dev 2.0.10+dfsg1-3
if (NOT TARGET SDL2::SDL2)
# If we have a ${libdir} from the above find_package sdl2, use that.
if(${libdir})
if(libdir)
set(SDL2_LIBDIR ${libdir})
endif()
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()
endif()
elseif(WIN32)
# On windows, always download manually. There are issues with find_package and multi-config generators where a release library will be found, but no debug library, which can break things.
Expand Down

0 comments on commit b8e8752

Please sign in to comment.