Bug 1368948: [6/7] Build freetype when enabling SkiaPDF on Windows. r=glandium
authorBruce Sun <brsun@mozilla.com>
Thu, 29 Jun 2017 17:17:46 -0700
changeset 367057 31e471d5b2896cbbfddb0025fb872532cf841bc4
parent 367056 95400bc93b906e036eeb2357a9c9b05369c0fd99
child 367058 cd4549c335752aca80ac293015d0b85ada94c332
push id32117
push userphilringnalda@gmail.com
push dateSun, 02 Jul 2017 00:39:30 +0000
treeherdermozilla-central@4d3de12dcdc5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1368948
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368948: [6/7] Build freetype when enabling SkiaPDF on Windows. r=glandium Add the dependency between "MOZ_ENABLE_SKIA_PDF" and "MOZ_TREE_FREETYPE" on Windows: - let |tree_freetype| returns true if |skia_pdf| returns true on Windows, and - avoid defining "MOZ_ENABLE_CAIRO_FT" on Windows ("cairo-ft-font.c" includes <dlfcn.h>, which only exists on posix platforms) MozReview-Commit-ID: 6CWVwzIHL1Q
old-configure.in
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -3451,17 +3451,19 @@ for extension in $MOZ_EXTENSIONS; do
         AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
     fi
 done
 
 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
   AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
 fi
 
-if test -n "$MOZ_TREE_FREETYPE"; then
+# Avoid defining MOZ_ENABLE_CAIRO_FT on Windows platforms because
+# "cairo-ft-font.c" includes <dlfcn.h>, which only exists on posix platforms
+if test -n "$MOZ_TREE_FREETYPE" -a "$OS_TARGET" != WINNT; then
    MOZ_ENABLE_CAIRO_FT=1
    FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
    CAIRO_FT_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
    AC_SUBST_LIST(CAIRO_FT_CFLAGS)
 fi
 
 AC_CHECK_PROGS(WGET, wget, "")
 AC_SUBST(WGET)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -309,45 +309,16 @@ def freetype2_combined_info(fontconfig_i
     return namespace(
         cflags=freetype2_info.cflags + fontconfig_info.cflags,
         libs=freetype2_info.libs + fontconfig_info.libs,
     )
 
 add_old_configure_assignment('_HAVE_FREETYPE2',
                              depends_if(freetype2_info)(lambda _: True))
 
-# Build Freetype in the tree
-# ==============================================================
-@depends(target)
-def tree_freetype(target):
-    if target.os == 'Android':
-        return True
-
-set_define('MOZ_TREE_FREETYPE', tree_freetype)
-set_config('MOZ_TREE_FREETYPE', tree_freetype)
-add_old_configure_assignment('MOZ_TREE_FREETYPE', tree_freetype)
-
-set_define('HAVE_FT_BITMAP_SIZE_Y_PPEM', tree_freetype)
-set_define('HAVE_FT_GLYPHSLOT_EMBOLDEN', tree_freetype)
-set_define('HAVE_FT_LOAD_SFNT_TABLE', tree_freetype)
-
-@depends(freetype2_combined_info, tree_freetype, check_build_environment)
-def ft2_info(freetype2_combined_info, tree_freetype, build_env):
-    if tree_freetype:
-        return namespace(cflags=('-I%s/modules/freetype2/include' % build_env.topsrcdir,),
-                         libs=())
-    if freetype2_combined_info:
-        return freetype2_combined_info
-
-set_config('FT2_LIBS', ft2_info.libs)
-add_old_configure_assignment('FT2_LIBS',
-                             ft2_info.libs)
-add_old_configure_assignment('FT2_CFLAGS',
-                             ft2_info.cflags)
-
 # Apple platform decoder support
 # ==============================================================
 @depends(toolkit)
 def applemedia(toolkit):
     if toolkit in ('cocoa', 'uikit'):
         return True
 
 set_config('MOZ_APPLEMEDIA', applemedia)
@@ -1120,16 +1091,45 @@ def skia_includes(skia, skia_gpu):
             '/gfx/skia/skia/include/gpu',
             '/gfx/skia/skia/include/utils',
         ]
 
     return includes
 
 set_config('SKIA_INCLUDES', skia_includes)
 
+# Build Freetype in the tree
+# ==============================================================
+@depends(target, skia_pdf)
+def tree_freetype(target, skia_pdf):
+    if target.os == 'Android' or (skia_pdf and target.os == 'WINNT'):
+        return True
+
+set_define('MOZ_TREE_FREETYPE', tree_freetype)
+set_config('MOZ_TREE_FREETYPE', tree_freetype)
+add_old_configure_assignment('MOZ_TREE_FREETYPE', tree_freetype)
+
+set_define('HAVE_FT_BITMAP_SIZE_Y_PPEM', tree_freetype)
+set_define('HAVE_FT_GLYPHSLOT_EMBOLDEN', tree_freetype)
+set_define('HAVE_FT_LOAD_SFNT_TABLE', tree_freetype)
+
+@depends(freetype2_combined_info, tree_freetype, check_build_environment)
+def ft2_info(freetype2_combined_info, tree_freetype, build_env):
+    if tree_freetype:
+        return namespace(cflags=('-I%s/modules/freetype2/include' % build_env.topsrcdir,),
+                         libs=())
+    if freetype2_combined_info:
+        return freetype2_combined_info
+
+set_config('FT2_LIBS', ft2_info.libs)
+add_old_configure_assignment('FT2_LIBS',
+                             ft2_info.libs)
+add_old_configure_assignment('FT2_CFLAGS',
+                             ft2_info.cflags)
+
 # Mortar
 # ==============================================================
 option('--enable-mortar', help='Enable mortar extension')
 
 set_config('MOZ_MORTAR', True, when='--enable-mortar')
 
 # Marionette remote protocol
 # ==============================================================