Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdl2] Fix improper replacement of -lSDL2main + remove IGNORE_FLAGS and SYSTEM_LIBRARIES #15540

Merged
merged 4 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -5194,7 +5194,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