mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibTTF/LibGfx: Remove circular dependency by merging LibTTF into LibGfx
LibTTF has a concrete dependency on LibGfx for things like Gfx::Bitmap, and LibGfx has a concrete dependency in the TTF::Font class in Gfx::FontDatabase. This circular dependency works fine for Serenity and Lagom Linux builds of the two libraries. It also works fine for static library builds on Lagom macOS builds. However, future changes will make Lagom use shared libraries, and circular library dependencies are not tolerated in macOS.
This commit is contained in:
parent
08ddfb30d7
commit
af9be6e093
Notes:
sideshowbarker
2024-07-18 07:47:13 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/af9be6e093c Pull-request: https://github.com/SerenityOS/serenity/pull/9017 Issue: https://github.com/SerenityOS/serenity/issues/8846 Reviewed-by: https://github.com/gunnarbeutner Reviewed-by: https://github.com/linusg
|
@ -96,7 +96,7 @@ file(GLOB LIBCRYPTO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypt
|
|||
file(GLOB LIBCRYPTO_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*.cpp")
|
||||
file(GLOB LIBCRYPTO_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*/*.cpp")
|
||||
file(GLOB LIBTLS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTLS/*.cpp")
|
||||
file(GLOB LIBTTF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTTF/*.cpp")
|
||||
file(GLOB LIBGFX_TTF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/TrueTypeFont/*.cpp")
|
||||
file(GLOB LIBTEXTCODEC_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTextCodec/*.cpp")
|
||||
file(GLOB SHELL_SOURCES CONFIGURE_DEPENDS "../../Userland/Shell/*.cpp")
|
||||
file(GLOB SHELL_TESTS CONFIGURE_DEPENDS "../../Userland/Shell/Tests/*.sh")
|
||||
|
@ -118,7 +118,7 @@ file(GLOB LIBUNICODE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibUnicode/*.cp
|
|||
|
||||
set(LAGOM_REGEX_SOURCES ${LIBREGEX_LIBC_SOURCES} ${LIBREGEX_SOURCES})
|
||||
set(LAGOM_CORE_SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES})
|
||||
set(LAGOM_MORE_SOURCES ${LIBARCHIVE_SOURCES} ${LIBAUDIO_SOURCES} ${LIBELF_SOURCES} ${LIBIPC_SOURCES} ${LIBLINE_SOURCES} ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES} ${LIBX86_SOURCES} ${LIBCRYPTO_SOURCES} ${LIBCOMPRESS_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES} ${LIBTLS_SOURCES} ${LIBTTF_SOURCES} ${LIBTEXTCODEC_SOURCES} ${LIBMARKDOWN_SOURCES} ${LIBGEMINI_SOURCES} ${LIBGFX_SOURCES} ${LIBGUI_GML_SOURCES} ${LIBHTTP_SOURCES} ${LAGOM_REGEX_SOURCES} ${SHELL_SOURCES} ${LIBSQL_SOURCES} ${LIBWASM_SOURCES} ${LIBIMAP_SOURCES} ${LIBUNICODE_SOURCES})
|
||||
set(LAGOM_MORE_SOURCES ${LIBARCHIVE_SOURCES} ${LIBAUDIO_SOURCES} ${LIBELF_SOURCES} ${LIBIPC_SOURCES} ${LIBLINE_SOURCES} ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES} ${LIBX86_SOURCES} ${LIBCRYPTO_SOURCES} ${LIBCOMPRESS_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES} ${LIBTLS_SOURCES} ${LIBGFX_TTF_SOURCES} ${LIBTEXTCODEC_SOURCES} ${LIBMARKDOWN_SOURCES} ${LIBGEMINI_SOURCES} ${LIBGFX_SOURCES} ${LIBGUI_GML_SOURCES} ${LIBHTTP_SOURCES} ${LAGOM_REGEX_SOURCES} ${SHELL_SOURCES} ${LIBSQL_SOURCES} ${LIBWASM_SOURCES} ${LIBIMAP_SOURCES} ${LIBUNICODE_SOURCES})
|
||||
set(LAGOM_TEST_SOURCES ${LIBTEST_SOURCES})
|
||||
|
||||
# FIXME: This is a hack, because the lagom stuff can be build individually or
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTTF/Font.h>
|
||||
#include <LibGfx/TrueTypeFont/Font.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ add_subdirectory(LibTest)
|
|||
add_subdirectory(LibTextCodec)
|
||||
add_subdirectory(LibThreading)
|
||||
add_subdirectory(LibTLS)
|
||||
add_subdirectory(LibTTF)
|
||||
add_subdirectory(LibUnicode)
|
||||
add_subdirectory(LibUSBDB)
|
||||
add_subdirectory(LibVideo)
|
||||
|
|
|
@ -33,9 +33,12 @@ set(SOURCES
|
|||
TextDirection.cpp
|
||||
TextLayout.cpp
|
||||
Triangle.cpp
|
||||
TrueTypeFont/Font.cpp
|
||||
TrueTypeFont/Glyf.cpp
|
||||
TrueTypeFont/Cmap.cpp
|
||||
Typeface.cpp
|
||||
WindowTheme.cpp
|
||||
)
|
||||
|
||||
serenity_lib(LibGfx gfx)
|
||||
target_link_libraries(LibGfx LibM LibCompress LibCore LibTTF)
|
||||
target_link_libraries(LibGfx LibM LibCompress LibCore LibTextCodec)
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include <LibCore/DirIterator.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/TrueTypeFont/Font.h>
|
||||
#include <LibGfx/Typeface.h>
|
||||
#include <LibTTF/Font.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <LibTTF/Cmap.h>
|
||||
#include <LibGfx/TrueTypeFont/Cmap.h>
|
||||
|
||||
namespace TTF {
|
||||
|
|
@ -11,10 +11,10 @@
|
|||
#include <AK/Utf8View.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibTTF/Cmap.h>
|
||||
#include <LibTTF/Font.h>
|
||||
#include <LibTTF/Glyf.h>
|
||||
#include <LibTTF/Tables.h>
|
||||
#include <LibGfx/TrueTypeFont/Cmap.h>
|
||||
#include <LibGfx/TrueTypeFont/Font.h>
|
||||
#include <LibGfx/TrueTypeFont/Glyf.h>
|
||||
#include <LibGfx/TrueTypeFont/Tables.h>
|
||||
#include <LibTextCodec/Decoder.h>
|
||||
#include <math.h>
|
||||
#include <sys/mman.h>
|
|
@ -13,9 +13,9 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/Size.h>
|
||||
#include <LibTTF/Cmap.h>
|
||||
#include <LibTTF/Glyf.h>
|
||||
#include <LibTTF/Tables.h>
|
||||
#include <LibGfx/TrueTypeFont/Cmap.h>
|
||||
#include <LibGfx/TrueTypeFont/Glyf.h>
|
||||
#include <LibGfx/TrueTypeFont/Tables.h>
|
||||
|
||||
#define POINTS_PER_INCH 72.0f
|
||||
#define DEFAULT_DPI 96
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <LibGfx/Path.h>
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibTTF/Glyf.h>
|
||||
#include <LibGfx/TrueTypeFont/Glyf.h>
|
||||
|
||||
namespace TTF {
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/AffineTransform.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibTTF/Tables.h>
|
||||
#include <LibGfx/TrueTypeFont/Tables.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace TTF {
|
|
@ -12,7 +12,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/BitmapFont.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibTTF/Font.h>
|
||||
#include <LibGfx/TrueTypeFont/Font.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
set(SOURCES
|
||||
Cmap.cpp
|
||||
Font.cpp
|
||||
Glyf.cpp
|
||||
)
|
||||
|
||||
serenity_lib(LibTTF ttf)
|
||||
target_link_libraries(LibTTF LibM LibCore LibTextCodec)
|
Loading…
Reference in a new issue