Skip to content

Commit

Permalink
[drape] Fix harfbuzz build error on Mac
Browse files Browse the repository at this point in the history
All system libraries found via cmake's find_library should be included using aliases

Signed-off-by: Alexander Borsuk <me@alex.bio>
  • Loading branch information
biodranik committed May 27, 2024
1 parent f589797 commit 6210144
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
2 changes: 2 additions & 0 deletions 3party/harfbuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ target_compile_definitions(${PROJECT_NAME}
)

target_link_libraries(${PROJECT_NAME} Freetype::Freetype)

add_library(harfbuzz::harfbuzz ALIAS harfbuzz)
2 changes: 1 addition & 1 deletion drape/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ target_link_libraries(${PROJECT_NAME}
Freetype::Freetype
vulkan_wrapper
stb_image
harfbuzz
harfbuzz::harfbuzz
ICU::i18n
expat::expat
$<$<BOOL:${PLATFORM_MAC}>:-framework\ OpenGL>
Expand Down
6 changes: 3 additions & 3 deletions drape/drape_tests/glyph_mng_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

#include <QtGui/QPainter>

#include <ft2build.h>
#include <functional>
#include <iostream>
#include <vector>

#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_MODULE_H
#include <harfbuzz/hb-ft.h>
#include <harfbuzz/hb.h>
#include <hb-ft.h>

namespace glyph_mng_tests
{
Expand Down
7 changes: 0 additions & 7 deletions drape/glyph_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@
#include "base/stl_helpers.hpp"
#include "base/string_utils.hpp"

#include "std/target_os.hpp"

#include <ft2build.h>
// A system dependency is used on these platforms. TODO(AB): There should be a way to build everything from sources.
#if defined(OMIM_OS_LINUX) || defined(OMIM_OS_WINDOWS)
#include <harfbuzz/hb-ft.h>
#else
#include <hb-ft.h>
#endif

#include <limits>
#include <sstream>
Expand Down
6 changes: 0 additions & 6 deletions drape/harfbuzz_shaping.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#pragma once

#include "std/target_os.hpp"

#include <string>
#include <vector>

#if defined(OMIM_OS_LINUX) || defined(OMIM_OS_WINDOWS)
#include <harfbuzz/hb.h>
#else
#include <hb.h>
#endif

namespace harfbuzz_shaping
{
Expand Down

0 comments on commit 6210144

Please sign in to comment.