-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[ftgl] Download instead of bundle and bump from 2.1.2 to 2.4, and use CMake target #21898
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
Open
ferdymercury
wants to merge
2
commits into
root-project:master
Choose a base branch
from
ferdymercury:bftgl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
25 changes: 25 additions & 0 deletions
25
builtins/ftgl/0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch
This file contains hidden or 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,25 @@ | ||
| From b043877060efafcfa00f1d07c264d69e32e5d3a9 Mon Sep 17 00:00:00 2001 | ||
| From: Frank Heckenbach <f.heckenbach@fh-soft.de> | ||
| Date: Tue, 21 May 2019 23:09:18 +0200 | ||
| Subject: [PATCH] src/CMakeLists.txt: remove FTLibrary.h from | ||
| libftgl_la_SOURCES (it's only in ftgl_headers) | ||
|
|
||
| --- | ||
| src/CMakeLists.txt | 1 - | ||
| 1 file changed, 1 deletion(-) | ||
|
|
||
| diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| index 693e49f..b0f26f6 100644 | ||
| --- a/src/CMakeLists.txt | ||
| +++ b/src/CMakeLists.txt | ||
| @@ -26,7 +26,6 @@ SET(libftgl_la_SOURCES | ||
| FTGlyphContainer.h | ||
| FTInternals.h | ||
| FTLibrary.cpp | ||
| - FTLibrary.h | ||
| FTList.h | ||
| FTPoint.cpp | ||
| FTSize.cpp | ||
| -- | ||
| 2.34.1 | ||
|
|
This file contains hidden or 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,39 @@ | ||
| diff --git a/src/FTContour.cpp b/src/FTContour.cpp | ||
| index c668d32..ef13576 100644 | ||
| --- a/src/FTContour.cpp | ||
| +++ b/src/FTContour.cpp | ||
| @@ -174,7 +174,7 @@ void FTContour::SetParity(int parity) | ||
| } | ||
|
|
||
|
|
||
| -FTContour::FTContour(FT_Vector* contour, char* tags, unsigned int n) | ||
| +FTContour::FTContour(FT_Vector* contour, unsigned char* tags, unsigned int n) | ||
| { | ||
| FTPoint prev, cur(contour[(n - 1) % n]), next(contour[0]); | ||
| double olddir, dir = atan2((next - cur).Y(), (next - cur).X()); | ||
| diff --git a/src/FTContour.h b/src/FTContour.h | ||
| index d2d187c..dc64e3a 100644 | ||
| --- a/src/FTContour.h | ||
| +++ b/src/FTContour.h | ||
| @@ -52,7 +52,7 @@ class FTContour | ||
| * @param pointTags | ||
| * @param numberOfPoints | ||
| */ | ||
| - FTContour(FT_Vector* contour, char* pointTags, unsigned int numberOfPoints); | ||
| + FTContour(FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints); | ||
|
|
||
| /** | ||
| * Destructor | ||
| diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp | ||
| index 26e7da8..53d738e 100644 | ||
| --- a/src/FTVectoriser.cpp | ||
| +++ b/src/FTVectoriser.cpp | ||
| @@ -168,7 +168,7 @@ void FTVectoriser::ProcessContours() | ||
| for(int i = 0; i < ftContourCount; ++i) | ||
| { | ||
| FT_Vector* pointList = &outline.points[startIndex]; | ||
| - char* tagList = &outline.tags[startIndex]; | ||
| + unsigned char* tagList = (unsigned char*)&outline.tags[startIndex]; | ||
|
|
||
| endIndex = outline.contours[i]; | ||
| contourLength = (endIndex - startIndex) + 1; | ||
This file contains hidden or 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,85 @@ | ||
| # Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. | ||
| # All rights reserved. | ||
| # | ||
| # For the licensing terms see $ROOTSYS/LICENSE. | ||
| # For the list of contributors see $ROOTSYS/README/CREDITS. | ||
|
|
||
| # **PLEASE UPDATE ALSO THE FOLLOWING LINE WHEN UPDATING THE VERSION** | ||
| # 7 Feb 2019, https://github.com/frankheckenbach/ftgl/releases/tag/v2.4.0 | ||
| set(ROOT_FTGL_VERSION 2.4.0) | ||
| set(ROOT_FTGL_HASH "aa97da1c3442a8fd3941037655df18016d70b5266381c81d81e8b5335f196ea8") | ||
| # Cherry-pick https://github.com/frankheckenbach/ftgl/commit/835f2ba7911a6c15a1a314d5e3267fa089b5a319 : | ||
| set(ROOT_FTGL_PATCH_FILE_1 "${CMAKE_CURRENT_SOURCE_DIR}/0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch") | ||
| # From https://github.com/frankheckenbach/ftgl/issues/22, see also https://github.com/xmake-io/xmake-repo/pull/9040/changes and https://github.com/root-project/root/commit/a028d13255f0c2d0c84f2e1b99ccb6a112598e0c | ||
| set(ROOT_FTGL_PATCH_FILE_2 "${CMAKE_CURRENT_SOURCE_DIR}/0002-fix-type-error.patch") | ||
| set(ROOT_FTGL_PREFIX ${CMAKE_BINARY_DIR}/builtins/FTGL-prefix) | ||
| set(ROOT_FTGL_LIBRARY ${ROOT_FTGL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ftgl${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
|
|
||
| include(ExternalProject) | ||
|
|
||
| # Clear cache variables set by find_package(FTGL) | ||
| # to ensure that we use the builtin version | ||
| foreach(var FTGL_LIBRARIES FTGL_LIBRARY FTGL_LIBRARY_DEBUG FTGL_LIBRARY_RELEASE FTGL_FOUND FTGL_VERSION FTGL_INCLUDE_DIR FTGL_LIBRARY FTGL_LIBRARIES) | ||
| unset(${var}) | ||
| unset(${var} CACHE) | ||
| endforeach() | ||
|
|
||
| if(WIN32 AND NOT CMAKE_GENERATOR MATCHES Ninja) | ||
| if(winrtdebug) | ||
| set(ROOT_FTGL_BUILD_COMMAND_FLAGS "--config Debug") | ||
| else() | ||
| set(ROOT_FTGL_BUILD_COMMAND_FLAGS "--config $<IF:$<CONFIG:Debug,RelWithDebInfo>,RelWithDebInfo,Release>") | ||
| endif() | ||
| endif() | ||
|
|
||
| ExternalProject_Add(BUILTIN_FTGL | ||
| PREFIX ${ROOT_FTGL_PREFIX} | ||
| URL ${lcgpackages}/ftgl-${ROOT_FTGL_VERSION}.tar.gz | ||
| URL_HASH SHA256=${ROOT_FTGL_HASH} | ||
| PATCH_COMMAND git apply ${ROOT_FTGL_PATCH_FILE_1} ${ROOT_FTGL_PATCH_FILE_2} | ||
|
|
||
| LOG_DOWNLOAD TRUE | ||
| LOG_CONFIGURE TRUE | ||
| LOG_BUILD TRUE | ||
| LOG_INSTALL TRUE | ||
| LOG_OUTPUT_ON_FAILURE TRUE | ||
|
|
||
| CMAKE_ARGS -G ${CMAKE_GENERATOR} | ||
| -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> | ||
| -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | ||
| -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} | ||
| -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} | ||
| -DBUILD_SHARED_LIBS:BOOL=FALSE | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | ||
| -DFREETYPE_LIBRARY=${FREETYPE_LIBRARY} # Seems to be needed for Win32 (CMake 3.30 Freetype.cmake) | ||
| -DFREETYPE_INCLUDE_DIRS=${FREETYPE_INCLUDE_DIRS} # Seems to be needed for Win32 (CMake 3.30 Freetype.cmake) | ||
| -DFREETYPE_DIR=${FREETYPE_INCLUDE_DIRS}/../ # Seems to be needed for Win32 (CMake 3.30 Freetype.cmake) | ||
| BUILD_COMMAND ${CMAKE_COMMAND} --build . ${ROOT_FTGL_BUILD_COMMAND_FLAGS} | ||
| INSTALL_COMMAND ${CMAKE_COMMAND} --build . ${ROOT_FTGL_BUILD_COMMAND_FLAGS} --target install | ||
| BUILD_BYPRODUCTS | ||
| ${ROOT_FTGL_LIBRARY} | ||
| TIMEOUT 600 | ||
| ) | ||
|
|
||
| file(MAKE_DIRECTORY ${ROOT_FTGL_PREFIX}/include) | ||
| add_library(FTGL::FTGL IMPORTED STATIC GLOBAL) | ||
| add_dependencies(FTGL::FTGL BUILTIN_FTGL) | ||
| set_target_properties(FTGL::FTGL PROPERTIES | ||
| IMPORTED_LOCATION ${ROOT_FTGL_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${ROOT_FTGL_PREFIX}/include) | ||
| target_compile_definitions(FTGL::FTGL INTERFACE FTGL_LIBRARY_STATIC) # needed for Win32 since public flag is not correctly propagated to parent scope (BUILD_SHARED_LIBS works fine for building but when installing, flag info is lost) | ||
| if(builtin_freetype) | ||
| add_dependencies(BUILTIN_FTGL BUILTIN_FREETYPE) | ||
| endif() | ||
| if(builin_zlib) | ||
| add_dependencies(BUILTIN_FTGL BUILTIN_ZLIB) | ||
| endif() | ||
| target_link_libraries(FTGL::FTGL INTERFACE Freetype::Freetype) # private: OpenGL::GL OpenGL::GLU ZLIB::ZLIB | ||
|
|
||
| # Set the canonical output of find_package according to | ||
| # https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names | ||
| set(FTGL_INCLUDE_DIRS ${ROOT_FTGL_PREFIX}/include PARENT_SCOPE) | ||
| set(FTGL_LIBRARIES ${ROOT_FTGL_LIBRARY} PARENT_SCOPE) | ||
| set(FTGL_FOUND TRUE PARENT_SCOPE) | ||
| set(FTGL_VERSION ${ROOT_FTGL_VERSION} PARENT_SCOPE) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silverweed I got this patch from https://github.com/luadebug/xmake-repo/blob/66321835cb5e940f5997c10de515d50e91aaac47/packages/f/ftgl/patches/2.4.0/fix-type-error.patch
maybe you know of a good way to tune it to include your probably more accurate fixes from a028d13