-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sdl2-ttf,tgui,sfml] Update sdl2-ttf to 2.20.0, revise dependencies i…
…mport and export (#26026) * [sdl2-ttf] update to 2.20.0 * update version * add license * update version * del unused function * overwrite version * Fix sdl2-tff * Increase version * version * Fix config export/import * version * Fix sdl2pp * Fix SDL2_ttf import * Fix sdl2pp * Try again * ... * shared * Fix patch * not win32 * revert * Fix import name * Fix tgui * version * CR * version * CR * version * license * version * update port version * version * Fix patch * version * Fix patch * version * Update patch * version * Fix tgui * add feature harfbuzz * version * Fix feature * version * Fix mingw * Trim patching * Explicit usage * [sfml] Fix OpenGL dependency * [sfml] Transform freetype patch and config fixup * [sfml] Transform stb patch * [tgui] Revise port * [tgui] Extend config patching, merge into dependencies patch * [tgui] Devendor stb * [tgui] Revise feature dependencies * [tgui] Omit pc files (too many inconsistencies) * [milerius-sfml-imgui] Fixup * Update versions Co-authored-by: FrankXie <v-frankxie@microsoft.com> Co-authored-by: Thomas1664 <46387399+Thomas1664@users.noreply.github.com>
- Loading branch information
1 parent
714722b
commit df806d3
Showing
26 changed files
with
355 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index a097d5c..ca2881f 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -325,7 +333,7 @@ if(SDL2TTF_INSTALL) | ||
COMPONENT devel | ||
) | ||
|
||
- if(SDL2TTF_BUILD_SHARED_LIBS) | ||
+ if(1) | ||
# Only create a .pc file for a shared SDL2_ttf | ||
set(prefix "${CMAKE_INSTALL_PREFIX}") | ||
set(exec_prefix "\${prefix}") | ||
@@ -352,7 +360,7 @@ if(SDL2TTF_INSTALL) | ||
\"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\" ONLY_IF_DIFFERENT) | ||
file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${PC_DESTDIR}\" | ||
TYPE FILE | ||
- FILES \"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\")" CONFIG Release) | ||
+ FILES \"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\")") | ||
endif() | ||
|
||
if(SDL2TTF_BUILD_SHARED_LIBS AND (APPLE OR (UNIX AND NOT ANDROID))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
set(VERSION 2.0.15) | ||
|
||
vcpkg_download_distfile(ARCHIVE | ||
URLS "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${VERSION}.tar.gz" | ||
FILENAME "SDL2_ttf-${VERSION}.tar.gz" | ||
SHA512 30d685932c3dd6f2c94e2778357a5c502f0421374293d7102a64d92f9c7861229bf36bedf51c1a698b296a58c858ca442d97afb908b7df1592fc8d4f8ae8ddfd | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO libsdl-org/SDL_ttf | ||
REF f5e4828ffc9d3a84f00011fede4446aecb4a685f #v2.20.0 | ||
SHA512 c0d2d6107e5427d9c1353e14cb4b0c3957d28391cfc772f1f972fe3aa8ba9e9dfdfcb64acd317a7836d46b3a50da9597b19a832f0baf5198654acb7b31ab1e6b | ||
HEAD_REF main | ||
PATCHES | ||
fix-pkgconfig.patch | ||
) | ||
|
||
vcpkg_extract_source_archive_ex( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
ARCHIVE ${ARCHIVE} | ||
REF ${VERSION} | ||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
harfbuzz SDL2TTF_HARFBUZZ | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DSDL2TTF_VENDORED=OFF | ||
-DSDL2TTF_SAMPLES=OFF | ||
${FEATURE_OPTIONS} | ||
) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS_DEBUG | ||
-DSDL_TTF_SKIP_HEADERS=ON) | ||
vcpkg_cmake_install() | ||
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake") | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_ttf CONFIG_PATH cmake) | ||
else() | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_ttf CONFIG_PATH lib/cmake/SDL2_ttf) | ||
endif() | ||
|
||
vcpkg_install_cmake() | ||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_cmake_targets() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/licenses") | ||
|
||
file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/copyright) | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sdl2-ttf provides CMake targets: | ||
|
||
find_package(SDL2_ttf CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
{ | ||
"name": "sdl2-ttf", | ||
"version-string": "2.0.15", | ||
"port-version": 5, | ||
"version": "2.20.0", | ||
"description": "A library for rendering TrueType fonts with SDL", | ||
"homepage": "https://www.libsdl.org/projects/SDL_ttf/", | ||
"license": "Zlib", | ||
"dependencies": [ | ||
"freetype", | ||
"sdl2" | ||
] | ||
"sdl2", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"harfbuzz": { | ||
"description": "Enable HarfBuzz support", | ||
"dependencies": [ | ||
"harfbuzz" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
diff --git a/cmake/SFMLConfig.cmake.in b/cmake/SFMLConfig.cmake.in | ||
index ce81953..bd2d330 100644 | ||
--- a/cmake/SFMLConfig.cmake.in | ||
+++ b/cmake/SFMLConfig.cmake.in | ||
@@ -1,3 +1,8 @@ | ||
+set(SFML_STATIC_LIBRARIES false) | ||
+if(NOT "@BUILD_SHARED_LIBS@") | ||
+ set(SFML_STATIC_LIBRARIES true) | ||
+endif() | ||
+include(CMakeFindDependencyMacro) | ||
# This script provides the SFML libraries as imported targets | ||
# ------------------------------------ | ||
# | ||
diff --git a/cmake/SFMLConfigDependencies.cmake.in b/cmake/SFMLConfigDependencies.cmake.in | ||
index 1028110..927d1a4 100644 | ||
--- a/cmake/SFMLConfigDependencies.cmake.in | ||
+++ b/cmake/SFMLConfigDependencies.cmake.in | ||
@@ -56,6 +56,9 @@ if(SFML_STATIC_LIBRARIES) | ||
if (FIND_SFML_OS_WINDOWS) | ||
set_property(TARGET OpenGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "OpenGL32") | ||
elseif(NOT FIND_SFML_OS_IOS) | ||
+ set(OpenGL_GL_PREFERENCE "@EXPORT_OpenGL_GL_PREFERENCE@") | ||
+ find_dependency(OpenGL) | ||
+ set(OpenGL_LIB OpenGL::GL) | ||
sfml_bind_dependency(TARGET OpenGL FRIENDLY_NAME "OpenGL" SEARCH_NAMES "OpenGL" "GL") | ||
endif() | ||
endif() | ||
@@ -63,6 +66,8 @@ if(SFML_STATIC_LIBRARIES) | ||
# sfml-graphics | ||
list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT_INDEX) | ||
if(FIND_SFML_GRAPHICS_COMPONENT_INDEX GREATER -1) | ||
+ find_dependency(Freetype) | ||
+ set(FreeType_LIB Freetype::Freetype) | ||
sfml_bind_dependency(TARGET Freetype FRIENDLY_NAME "FreeType" SEARCH_NAMES "freetype") | ||
endif() | ||
|
||
diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt | ||
index 883c758..402efbe 100644 | ||
--- a/src/SFML/Graphics/CMakeLists.txt | ||
+++ b/src/SFML/Graphics/CMakeLists.txt | ||
@@ -97,7 +97,8 @@ sfml_add_library(sfml-graphics | ||
target_link_libraries(sfml-graphics PUBLIC sfml-window) | ||
|
||
# stb_image sources | ||
-target_include_directories(sfml-graphics PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") | ||
+find_path(STB_INCLUDE_DIR stb_image.h REQUIRED) | ||
+target_include_directories(sfml-graphics PRIVATE "${STB_INCLUDE_DIR}") | ||
|
||
# let CMake know about our additional graphics libraries paths | ||
if(SFML_OS_WINDOWS) | ||
@@ -134,7 +134,8 @@ if(SFML_OS_ANDROID) | ||
target_link_libraries(sfml-graphics PRIVATE z EGL GLESv1_CM) | ||
endif() | ||
|
||
-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") | ||
+set(FreeType_LIB Freetype::Freetype) | ||
+sfml_find_package(Freetype LINK FreeType_LIB) | ||
target_link_libraries(sfml-graphics PRIVATE Freetype) | ||
|
||
# add preprocessor symbols | ||
diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt | ||
index 98ea439..0f1fb53 100644 | ||
--- a/src/SFML/Window/CMakeLists.txt | ||
+++ b/src/SFML/Window/CMakeLists.txt | ||
@@ -254,7 +254,9 @@ if(SFML_OPENGL_ES) | ||
target_link_libraries(sfml-window PRIVATE EGL GLESv1_CM) | ||
endif() | ||
else() | ||
- sfml_find_package(OpenGL INCLUDE "OPENGL_INCLUDE_DIR" LINK "OPENGL_LIBRARIES") | ||
+ set(EXPORT_OpenGL_GL_PREFERENCE "${OpenGL_GL_PREFERENCE}" CACHE INTERNAL "") | ||
+ set(OpenGL_LIB OpenGL::GL) | ||
+ sfml_find_package(OpenGL LINK OpenGL_LIB) | ||
target_link_libraries(sfml-window PRIVATE OpenGL) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.