[sdl2] Don't propagate shared link options (#14992)

This commit is contained in:
Jesse Farebrother 2020-12-11 15:18:42 -07:00 committed by GitHub
parent c3e6d937e6
commit 1fca0cb761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7dfd35389..648218cc5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2062,7 +2062,7 @@ if(SDL_SHARED)
set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
endif()
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
- target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
+ target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/SDL2>)
if (NOT ANDROID)
set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")

View File

@ -18,6 +18,7 @@ vcpkg_extract_source_archive_ex(
0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch
0007-sdl2-skip-ibus-on-linux.patch
0008-fix-macos-metal-test.patch
no-propagate-shared-link-options.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)

View File

@ -1,7 +1,7 @@
{
"name": "sdl2",
"version-string": "2.0.12",
"port-version": 7,
"port-version": 8,
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
"homepage": "https://www.libsdl.org/download-2.0.php",
"features": {