[HarfBuzz] harfbuzz: Branch 'master' - 4 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Apr 12 20:42:56 UTC 2017
CMakeLists.txt | 199 ++++++++++++++++++++++++++++++++-----------
src/hb-ot-layout.cc | 8 +
src/hb-ucdn/Makefile.sources | 5 -
win32/config-msvc.mak | 22 ++--
win32/detectenv-msvc.mak | 4
win32/info-msvc.mak | 12 +-
6 files changed, 186 insertions(+), 64 deletions(-)
New commits:
commit c04c1fe86ee4b9b58ad88dad5593239ade4c75b8
Author: jfkthame <jfkthame at gmail.com>
Date: Tue Apr 11 22:29:13 2017 +0100
Blacklist GDEF table in additional Tahoma versions. (#459)
There are more broken versions of Tahoma out there on various Windows releases,
so we need to add them to our blacklist to avoid broken rendering.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 for details.
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index f8a04a95..7f4e0184 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -101,10 +101,18 @@ _hb_ot_layout_create (hb_face_t *face)
|| (928 == gdef_len && 59332 == gpos_len && 23298 == gsub_len)
/* sha1sum:6d400781948517c3c0441ba42acb309584b73033 tahomabd.ttf from Windows 8.1 */
|| (940 == gdef_len && 60732 == gpos_len && 23310 == gsub_len)
+ /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+ || (964 == gdef_len && 60072 == gpos_len && 23836 == gsub_len)
+ /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+ || (976 == gdef_len && 61456 == gpos_len && 23832 == gsub_len)
/* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846 tahoma.ttf from Windows 10 */
|| (994 == gdef_len && 60336 == gpos_len && 24474 == gsub_len)
/* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343 tahomabd.ttf from Windows 10 */
|| (1006 == gdef_len && 61740 == gpos_len && 24470 == gsub_len)
+ /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+ || (1006 == gdef_len && 61346 == gpos_len && 24576 == gsub_len)
+ /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+ || (1018 == gdef_len && 62828 == gpos_len && 24572 == gsub_len)
/* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5 tahoma.ttf from Windows 10 AU */
|| (1006 == gdef_len && 61352 == gpos_len && 24576 == gsub_len)
/* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2 tahomabd.ttf from Windows 10 AU */
commit adfd4ae1cf6c4abe66aecf1eb0a05c7183a0f4e2
Author: ebraminio <ebrahim at gnu.org>
Date: Tue Apr 11 23:18:18 2017 +0430
[cmake] Improve third party libraries support (#461)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a473237..e373733c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,12 +17,14 @@ endif ()
##
## HarfBuzz build configurations
-option(HB_HAVE_FREETYPE "Use FreeType" OFF)
-option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper on Windows" OFF)
-option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper on Windows" OFF)
-option(HB_HAVE_CORETEXT "Enable CoreText shaper on macOS" ON)
+option(HB_HAVE_FREETYPE "Enable freetype interop helpers" OFF)
+option(HB_HAVE_GRAPHITE2 "Enable Graphite2 complementary shaper" OFF)
+option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF)
+option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper backend on Windows" OFF)
+option(HB_HAVE_CORETEXT "Enable CoreText shaper backend on macOS" ON)
option(HB_BUILTIN_UCDN "Use HarfBuzz provided UCDN" ON)
-option(HB_HAVE_GLIB "Use glib unicode functions" OFF)
+option(HB_HAVE_GLIB "Enable glib unicode functions" OFF)
+option(HB_HAVE_ICU "Enable icu unicode functions" OFF)
option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF)
if (HB_BUILD_UTILS)
set(HB_HAVE_GLIB ON)
@@ -65,12 +67,14 @@ function (prepend var prefix)
set(listVar "")
foreach (f ${ARGN})
list(APPEND listVar "${prefix}${f}")
- endforeach (f)
+ endforeach ()
set(${var} "${listVar}" PARENT_SCOPE)
endfunction ()
file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES)
file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES)
+file(READ ${PROJECT_SOURCE_DIR}/src/hb-ucdn/Makefile.sources UCDNSOURCES)
+
function (extract_make_variable variable file)
string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${file})
string(REGEX MATCHALL "[^ \n\t\\]+" list ${CMAKE_MATCH_1})
@@ -88,6 +92,8 @@ extract_make_variable(HB_VIEW_sources ${UTILSOURCES})
extract_make_variable(HB_SHAPE_sources ${UTILSOURCES})
extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES})
+extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES})
+
prepend(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_sources})
prepend(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_headers})
prepend(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_sources})
@@ -103,6 +109,8 @@ prepend(HB_VIEW_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_VIEW_sources})
prepend(HB_SHAPE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_SHAPE_sources})
prepend(HB_OT_SHAPE_CLOSURE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_OT_SHAPE_CLOSURE_sources})
+prepend(LIBHB_UCDN_sources "${PROJECT_SOURCE_DIR}/src/hb-ucdn/" ${LIBHB_UCDN_sources})
+
file(READ configure.ac CONFIGUREAC)
string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC})
set(HB_VERSION ${CMAKE_MATCH_1})
@@ -194,16 +202,27 @@ if (HB_HAVE_FREETYPE)
list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
endif ()
+if (HB_HAVE_GRAPHITE2)
+ add_definitions(-DHAVE_GRAPHITE2)
+
+ find_path(GRAPHITE2_INCLUDE_DIR graphite2/Font.h)
+ find_library(GRAPHITE2_LIBRARY graphite2)
+
+ include_directories(${GRAPHITE2_INCLUDE_DIR})
+
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-graphite2.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-graphite2.h)
+
+ list(APPEND THIRD_PARTY_LIBS ${GRAPHITE2_LIBRARY})
+endif ()
+
if (HB_BUILTIN_UCDN)
include_directories(src/hb-ucdn)
add_definitions(-DHAVE_UCDN)
- list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ucdn/ucdn.h)
-
list(APPEND project_sources
${PROJECT_SOURCE_DIR}/src/hb-ucdn.cc
- ${PROJECT_SOURCE_DIR}/src/hb-ucdn/ucdn.c
- ${PROJECT_SOURCE_DIR}/src/hb-ucdn/unicodedata_db.h)
+ ${LIBHB_UCDN_sources})
endif ()
if (HB_HAVE_GLIB)
@@ -225,6 +244,24 @@ if (HB_HAVE_GLIB)
list(APPEND THIRD_PARTY_LIBS ${GLIB_LIBRARIES})
endif ()
+if (HB_HAVE_ICU)
+ add_definitions(-DHAVE_ICU)
+
+ # https://github.com/WebKit/webkit/blob/master/Source/cmake/FindICU.cmake
+ find_package(PkgConfig)
+ pkg_check_modules(PC_ICU QUIET icu-uc)
+
+ find_path(ICU_INCLUDE_DIR NAMES unicode/utypes.h HINTS ${PC_ICU_INCLUDE_DIRS} ${PC_ICU_INCLUDEDIR})
+ find_library(ICU_LIBRARY NAMES libicuuc cygicuuc cygicuuc32 icuuc HINTS ${PC_ICU_LIBRARY_DIRS} ${PC_ICU_LIBDIR})
+
+ include_directories(${ICU_INCLUDE_DIR})
+
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-icu.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-icu.h)
+
+ list(APPEND THIRD_PARTY_LIBS ${ICU_LIBRARY})
+endif ()
+
if (APPLE AND HB_HAVE_CORETEXT)
# Apple Advanced Typography
add_definitions(-DHAVE_CORETEXT)
diff --git a/src/hb-ucdn/Makefile.sources b/src/hb-ucdn/Makefile.sources
index d5f87b28..52778d46 100644
--- a/src/hb-ucdn/Makefile.sources
+++ b/src/hb-ucdn/Makefile.sources
@@ -1,4 +1,7 @@
+NULL =
+
LIBHB_UCDN_sources = \
ucdn.h \
ucdn.c \
- unicodedata_db.h
+ unicodedata_db.h \
+ $(NULL)
commit 3a8bc572115a28741d5a80f3f1e28e6756b9abfa
Author: ebraminio <ebrahim at gnu.org>
Date: Tue Apr 11 21:32:14 2017 +0430
[cmake] Add utils build support (#460)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 111066c3..3a473237 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,12 @@ option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper on Windows" OFF)
option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper on Windows" OFF)
option(HB_HAVE_CORETEXT "Enable CoreText shaper on macOS" ON)
option(HB_BUILTIN_UCDN "Use HarfBuzz provided UCDN" ON)
+option(HB_HAVE_GLIB "Use glib unicode functions" OFF)
+option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF)
+if (HB_BUILD_UTILS)
+ set(HB_HAVE_GLIB ON)
+ set(HB_HAVE_FREETYPE ON)
+endif ()
include_directories(AFTER
${PROJECT_SOURCE_DIR}/src
@@ -53,30 +59,60 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/src/hb-version.h")
set(HB_VERSION_H "${PROJECT_SOURCE_DIR}/src/hb-version.h")
endif ()
-## Extract variables from src/Makefile.sources
-file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources MAKEFILESOURCES)
-function (extract_make_variable variable directory)
- string(REGEX MATCH "${variable} = ([^$]+)" temp ${MAKEFILESOURCES})
- string(REGEX REPLACE "\thb" "${directory}/hb" temp ${temp})
- string(REGEX MATCHALL "src/[^ ]+" temp ${temp})
- set(${variable} ${temp} PARENT_SCOPE)
+## Extract variables from Makefile files
+# http://stackoverflow.com/a/27630120/1414809
+function (prepend var prefix)
+ set(listVar "")
+ foreach (f ${ARGN})
+ list(APPEND listVar "${prefix}${f}")
+ endforeach (f)
+ set(${var} "${listVar}" PARENT_SCOPE)
+endfunction ()
+
+file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES)
+file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES)
+function (extract_make_variable variable file)
+ string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${file})
+ string(REGEX MATCHALL "[^ \n\t\\]+" list ${CMAKE_MATCH_1})
+ set(${variable} ${list} PARENT_SCOPE)
endfunction ()
-extract_make_variable(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src")
-extract_make_variable(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src")
-extract_make_variable(HB_OT_sources "${PROJECT_SOURCE_DIR}/src")
-extract_make_variable(HB_OT_headers "${PROJECT_SOURCE_DIR}/src")
+extract_make_variable(HB_BASE_sources ${SRCSOURCES})
+extract_make_variable(HB_BASE_headers ${SRCSOURCES})
+extract_make_variable(HB_OT_sources ${SRCSOURCES})
+extract_make_variable(HB_OT_headers ${SRCSOURCES})
+extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES})
+extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES})
+
+extract_make_variable(HB_VIEW_sources ${UTILSOURCES})
+extract_make_variable(HB_SHAPE_sources ${UTILSOURCES})
+extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES})
+
+prepend(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_sources})
+prepend(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_headers})
+prepend(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_sources})
+prepend(HB_OT_headers "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_headers})
if (IN_HB_DIST)
- extract_make_variable(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src")
- extract_make_variable(HB_OT_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src")
+ prepend(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_RAGEL_GENERATED_sources})
+ prepend(HB_OT_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_RAGEL_GENERATED_sources})
else ()
- extract_make_variable(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src")
- extract_make_variable(HB_OT_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src")
+ prepend(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/" ${HB_BASE_RAGEL_GENERATED_sources})
+ prepend(HB_OT_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/" ${HB_OT_RAGEL_GENERATED_sources})
endif ()
+prepend(HB_VIEW_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_VIEW_sources})
+prepend(HB_SHAPE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_SHAPE_sources})
+prepend(HB_OT_SHAPE_CLOSURE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_OT_SHAPE_CLOSURE_sources})
+
+file(READ configure.ac CONFIGUREAC)
+string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC})
+set(HB_VERSION ${CMAKE_MATCH_1})
+set(HB_VERSION_MAJOR ${CMAKE_MATCH_2})
+set(HB_VERSION_MINOR ${CMAKE_MATCH_3})
+set(HB_VERSION_MICRO ${CMAKE_MATCH_4})
##
if (NOT IN_HB_DIST)
- ## execute ragel tasks
+ ## Define ragel tasks
find_program(RAGEL "ragel")
if (RAGEL)
@@ -97,13 +133,6 @@ if (NOT IN_HB_DIST)
##
## Generate hb-version.h
- file(READ configure.ac CONFIGUREAC)
- string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC})
- set(HB_VERSION ${CMAKE_MATCH_1})
- set(HB_VERSION_MAJOR ${CMAKE_MATCH_2})
- set(HB_VERSION_MINOR ${CMAKE_MATCH_3})
- set(HB_VERSION_MICRO ${CMAKE_MATCH_4})
-
set(HB_VERSION_H_IN "${PROJECT_SOURCE_DIR}/src/hb-version.h.in")
set(HB_VERSION_H "${PROJECT_BINARY_DIR}/src/hb-version.h")
set_source_files_properties("${HB_VERSION_H}" PROPERTIES GENERATED true)
@@ -115,7 +144,7 @@ if (NOT IN_HB_DIST)
##
endif ()
-## Define source and headers of projects
+## Define sources and headers of the project
set(project_sources
${HB_BASE_sources}
${HB_BASE_RAGEL_GENERATED_sources}
@@ -157,60 +186,75 @@ if (HB_HAVE_FREETYPE)
endif ()
if (FREETYPE_INCLUDE_DIR AND FREETYPE_ACTUAL_LIBRARY)
- set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} ${FREETYPE_ACTUAL_LIBRARY})
+ list(APPEND THIRD_PARTY_LIBS ${FREETYPE_ACTUAL_LIBRARY})
add_definitions(-DHAVE_FREETYPE=1 -DHAVE_FT_FACE_GETCHARVARIANTINDEX=1)
endif ()
- set(project_sources ${project_sources} ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
- set(project_headers ${project_headers} ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
endif ()
if (HB_BUILTIN_UCDN)
include_directories(src/hb-ucdn)
add_definitions(-DHAVE_UCDN)
- set(project_headers ${project_headers} ${PROJECT_SOURCE_DIR}/src/hb-ucdn/ucdn.h)
-
- set(project_sources
- ${project_sources}
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ucdn/ucdn.h)
+ list(APPEND project_sources
${PROJECT_SOURCE_DIR}/src/hb-ucdn.cc
${PROJECT_SOURCE_DIR}/src/hb-ucdn/ucdn.c
${PROJECT_SOURCE_DIR}/src/hb-ucdn/unicodedata_db.h)
-else ()
- add_definitions(-DHB_NO_UNICODE_FUNCS)
+endif ()
+
+if (HB_HAVE_GLIB)
+ add_definitions(-DHAVE_GLIB)
+
+ # https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGLIB.cmake
+ find_package(PkgConfig)
+ pkg_check_modules(PC_GLIB QUIET glib-2.0)
+
+ find_library(GLIB_LIBRARIES NAMES glib-2.0 HINTS ${PC_GLIB_LIBDIR} ${PC_GLIB_LIBRARY_DIRS})
+ find_path(GLIBCONFIG_INCLUDE_DIR NAMES glibconfig.h HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/include)
+ find_path(GLIB_INCLUDE_DIR NAMES glib.h HINTS ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0)
+
+ include_directories(${GLIBCONFIG_INCLUDE_DIR} ${GLIB_INCLUDE_DIR})
+
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-glib.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-glib.h)
+
+ list(APPEND THIRD_PARTY_LIBS ${GLIB_LIBRARIES})
endif ()
if (APPLE AND HB_HAVE_CORETEXT)
# Apple Advanced Typography
add_definitions(-DHAVE_CORETEXT)
- set(project_sources ${project_sources} ${PROJECT_SOURCE_DIR}/src/hb-coretext.cc)
- set(project_headers ${project_headers} ${PROJECT_SOURCE_DIR}/src/hb-coretext.h)
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-coretext.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-coretext.h)
find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices)
mark_as_advanced(APPLICATION_SERVICES_FRAMEWORK)
if (APPLICATION_SERVICES_FRAMEWORK)
- set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} ${APPLICATION_SERVICES_FRAMEWORK})
+ list(APPEND THIRD_PARTY_LIBS ${APPLICATION_SERVICES_FRAMEWORK})
endif (APPLICATION_SERVICES_FRAMEWORK)
endif ()
if (WIN32 AND HB_HAVE_UNISCRIBE)
add_definitions(-DHAVE_UNISCRIBE)
- set(project_sources ${project_sources} ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.cc)
- set(project_headers ${project_headers} ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.h)
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.h)
- set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} usp10 gdi32 rpcrt4)
+ list(APPEND THIRD_PARTY_LIBS usp10 gdi32 rpcrt4)
endif ()
if (WIN32 AND HB_HAVE_DIRECTWRITE)
add_definitions(-DHAVE_DIRECTWRITE)
- set(project_sources ${project_sources} ${PROJECT_SOURCE_DIR}/src/hb-directwrite.cc)
- set(project_headers ${project_headers} ${PROJECT_SOURCE_DIR}/src/hb-directwrite.h)
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-directwrite.cc)
+ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-directwrite.h)
- set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} dwrite rpcrt4)
+ list(APPEND THIRD_PARTY_LIBS dwrite rpcrt4)
endif ()
set(project_sources ${project_sources} ${project_headers})
@@ -219,6 +263,28 @@ set(project_sources ${project_sources} ${project_headers})
add_library(harfbuzz ${project_sources})
target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS})
+if (HB_BUILD_UTILS)
+ # https://github.com/WebKit/webkit/blob/master/Source/cmake/FindCairo.cmake
+ find_package(PkgConfig)
+ pkg_check_modules(PC_CAIRO QUIET cairo)
+
+ find_path(CAIRO_INCLUDE_DIRS NAMES cairo.h HINTS ${PC_CAIRO_INCLUDEDIR} ${PC_CAIRO_INCLUDE_DIRS} PATH_SUFFIXES cairo)
+ find_library(CAIRO_LIBRARIESNAMES cairo HINTS ${PC_CAIRO_LIBDIR} ${PC_CAIRO_LIBRARY_DIRS})
+
+ add_definitions("-DPACKAGE_NAME=\"HarfBuzz\"")
+ add_definitions("-DPACKAGE_VERSION=\"${HB_VERSION}\"")
+ include_directories(${CAIRO_INCLUDE_DIRS})
+
+ add_executable(hb-view ${HB_VIEW_sources})
+ target_link_libraries(hb-view harfbuzz ${CAIRO_LIBRARIESNAMES})
+
+ add_executable(hb-shape ${HB_SHAPE_sources})
+ target_link_libraries(hb-shape harfbuzz)
+
+ add_executable(hb-ot-shape-closure ${HB_OT_SHAPE_CLOSURE_sources})
+ target_link_libraries(hb-ot-shape-closure harfbuzz)
+endif ()
+
## Install
if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES ${project_headers} DESTINATION include/harfbuzz)
commit bc1244e2395f844b2b41315cb1eef29570e46b29
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Thu Apr 6 18:44:28 2017 +0800
NMake Makefiles: Fix ICU builds
Fix the check conditions in config-msvc.mak and info-msvc.mak so that
the ICU items does indeed get built into the HarfBuzz main DLL, and that
the correct configuration info is displayed.
Also update the checks in detectenv-msvc.mak so that we can detect that
we are using Visual Studio 2017 (although the 2015-built binaries use
the same CRT DLL as the 2017 ones).
diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak
index d66bb2c0..6865bed6 100644
--- a/win32/config-msvc.mak
+++ b/win32/config-msvc.mak
@@ -42,6 +42,7 @@ HB_SOURCES = \
$(HB_OT_sources) \
$(HB_OT_RAGEL_GENERATED_sources)
+
HB_HEADERS = \
$(HB_BASE_headers) \
$(HB_NODIST_headers) \
@@ -177,6 +178,17 @@ HB_TESTS = \
$(CFG)\$(PLAT)\test-version.exe
!else
+
+# Define some of the macros in GLib's msvc_recommended_pragmas.h
+# to reduce some unneeded build-time warnings
+HB_CFLAGS = \
+ $(HB_CFLAGS) \
+ /wd4244 \
+ /D_CRT_SECURE_NO_WARNINGS \
+ /D_CRT_NONSTDC_NO_WARNINGS
+
+!endif
+
!if "$(ICU)" == "1"
# use ICU for Unicode functions
# and define some of the macros in GLib's msvc_recommended_pragmas.h
@@ -194,16 +206,6 @@ HB_HEADERS = $(HB_HEADERS) $(HB_ICU_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_ICU_DEP_LIBS)
!endif
-# Define some of the macros in GLib's msvc_recommended_pragmas.h
-# to reduce some unneeded build-time warnings
-HB_CFLAGS = \
- $(HB_CFLAGS) \
- /wd4244 \
- /D_CRT_SECURE_NO_WARNINGS \
- /D_CRT_NONSTDC_NO_WARNINGS
-
-!endif
-
!if "$(UNISCRIBE)" == "1"
HB_CFLAGS = $(HB_CFLAGS) /DHAVE_UNISCRIBE
HB_SOURCES = $(HB_SOURCES) $(HB_UNISCRIBE_sources)
diff --git a/win32/detectenv-msvc.mak b/win32/detectenv-msvc.mak
index ca09793c..d1080525 100644
--- a/win32/detectenv-msvc.mak
+++ b/win32/detectenv-msvc.mak
@@ -87,8 +87,10 @@ VSVER = 10
VSVER = 11
!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
VSVER = 12
-!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910
VSVER = 14
+!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 2000
+VSVER = 15
!else
VSVER = 0
!endif
diff --git a/win32/info-msvc.mak b/win32/info-msvc.mak
index 9b92e031..70daf762 100644
--- a/win32/info-msvc.mak
+++ b/win32/info-msvc.mak
@@ -6,17 +6,21 @@ BUILT_LIBRARIES = HarfBuzz
!if "$(NO_UCDN)" != "1"
UNICODE_IMPL = ucdn
-!else
-!if "$(GLIB)" == "1"
+!elseif "$(GLIB)" == "1"
UNICODE_IMPL = GLib
+!elseif "$(ICU)" == "1"
+UNICODE_IMPL = ICU
+!endif
+
+!if "$(GLIB)" == "1"
INC_FEATURES = $(INC_FEATURES) GLib
BUILT_TOOLS = hb-shape.exe hb-ot-shape-closure.exe
!if "$(CAIRO_FT)" == "1"
BUILT_TOOLS = hb-view.exe $(BUILT_TOOLS)
!endif
-!elseif "$(ICU)" == "1"
-UNICODE_IMPL = ICU
!endif
+!if "$(ICU)" == "1"
+INC_FEATURES = $(INC_FEATURES) ICU
!endif
!if "$(FREETYPE)" == "1"
More information about the HarfBuzz
mailing list