Skip to content

Commit

Permalink
[sdl2] Fix improper replacement of -lSDL2main + remove IGNORE_FLAGS a…
Browse files Browse the repository at this point in the history
…nd SYSTEM_LIBRARIES (#15540)

* [sdl2] Proper replacement of -lSDL2main -> -lSDL2maind

* [sdl2] Add extra SYSTEM_LIBRARIES and IGNORE_FLAGS

* [sdl2] Remove SYSTEM_LIBRARIES and IGNORE_FLAGS

* update baseline

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
  • Loading branch information
longnguyen2004 and JackBoosY committed Jan 25, 2021
1 parent f60b947 commit 124f5d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
12 changes: 4 additions & 8 deletions ports/sdl2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME)

file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake)
foreach(SHARE_FILE ${SHARE_FILES})
file(READ "${SHARE_FILE}" _contents)
string(REPLACE "lib/SDL2main" "lib/manual-link/SDL2main" _contents "${_contents}")
file(WRITE "${SHARE_FILE}" "${_contents}")
vcpkg_replace_string("${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main")
endforeach()
endif()

Expand All @@ -89,10 +87,8 @@ string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBIL
string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}")

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2" "-lSDL2d")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ")
endif()

vcpkg_fixup_pkgconfig(
IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined" "-Wl,-undefined,error" "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}" "-Wl,-current_version,${DYLIB_CURRENT_VERSION}" "-Wl,-weak_framework,Metal" "-Wl,-weak_framework,QuartzCore"
SYSTEM_LIBRARIES dbus-1
)
vcpkg_fixup_pkgconfig()
1 change: 1 addition & 0 deletions ports/sdl2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "sdl2",
"version-string": "2.0.14",
"port-version": 1,
"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": {
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5202,7 +5202,7 @@
},
"sdl2": {
"baseline": "2.0.14",
"port-version": 0
"port-version": 1
},
"sdl2-gfx": {
"baseline": "1.0.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sdl2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8d5fa523a69780e41605b585788d212d688f3c71",
"version-string": "2.0.14",
"port-version": 1
},
{
"git-tree": "10ed256500fea4cd6cc5d3e6c6b5f2e9e364d78b",
"version-string": "2.0.14",
Expand Down

0 comments on commit 124f5d9

Please sign in to comment.