Title: [228998] releases/WebKitGTK/webkit-2.20
Revision
228998
Author
[email protected]
Date
2018-02-26 02:45:34 -0800 (Mon, 26 Feb 2018)

Log Message

Merge r228826 - [GTK][CMake] Support building with Enchant 2.x
https://bugs.webkit.org/show_bug.cgi?id=182933

Reviewed by Michael Catanzaro.

* Source/cmake/FindEnchant.cmake: Check for both the "enchant" and "enchant-2"
pkg-config components, picking the first available for which the headers and
library are usable.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/ChangeLog (228997 => 228998)


--- releases/WebKitGTK/webkit-2.20/ChangeLog	2018-02-26 10:45:28 UTC (rev 228997)
+++ releases/WebKitGTK/webkit-2.20/ChangeLog	2018-02-26 10:45:34 UTC (rev 228998)
@@ -1,3 +1,14 @@
+2018-02-20  Adrian Perez de Castro  <[email protected]>
+
+        [GTK][CMake] Support building with Enchant 2.x
+        https://bugs.webkit.org/show_bug.cgi?id=182933
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/FindEnchant.cmake: Check for both the "enchant" and "enchant-2"
+        pkg-config components, picking the first available for which the headers and
+        library are usable.
+
 2018-02-21  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.91 release.

Modified: releases/WebKitGTK/webkit-2.20/Source/cmake/FindEnchant.cmake (228997 => 228998)


--- releases/WebKitGTK/webkit-2.20/Source/cmake/FindEnchant.cmake	2018-02-26 10:45:28 UTC (rev 228997)
+++ releases/WebKitGTK/webkit-2.20/Source/cmake/FindEnchant.cmake	2018-02-26 10:45:34 UTC (rev 228998)
@@ -28,20 +28,33 @@
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 find_package(PkgConfig)
-pkg_check_modules(PC_ENCHANT enchant)
 
-find_path(ENCHANT_INCLUDE_DIRS
-    NAMES enchant.h
-    PATHS ${PC_ENCHANT_INCLUDEDIR}
-          ${PC_ENCHANT_INCLUDE_DIRS}
-)
+# TODO Remove the check for Enchant 1.x once all major LTS GNU/Linux
+#      distributions ship the 2.x series (probably around mid-2020).
 
-find_library(ENCHANT_LIBRARIES
-    NAMES enchant
-    PATHS ${PC_ENCHANT_LIBDIR}
-          ${PC_ENCHANT_LIBRARY_DIRS}
-)
+foreach (ENCHANT_NAME enchant-2 enchant)
+    pkg_check_modules(PC_ENCHANT ${ENCHANT_NAME})
 
+    find_path(ENCHANT_INCLUDE_DIRS
+        NAMES enchant.h
+        PATHS ${PC_ENCHANT_INCLUDEDIR}
+              ${PC_ENCHANT_INCLUDE_DIRS}
+    )
+
+    find_library(ENCHANT_LIBRARIES
+        NAMES ${ENCHANT_NAME}
+        PATHS ${PC_ENCHANT_LIBDIR}
+              ${PC_ENCHANT_LIBRARY_DIRS}
+    )
+
+    # Only stop searching if the three have been found. This covers for corner
+    # cases in which e.g. both versions of the library are installed, but the
+    # headers are usable/present for one of them.
+    if (PC_ENCHANT_FOUND AND ENCHANT_INCLUDE_DIRS AND ENCHANT_LIBRARIES)
+        break ()
+    endif ()
+endforeach (ENCHANT_NAME)
+
 mark_as_advanced(
     ENCHANT_INCLUDE_DIRS
     ENCHANT_LIBRARIES
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to