[WPE][GTK] Improve dependency tracking of PDF.js files (and other GResources)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 May 2022 20:57:08 +0000 (20:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 May 2022 20:57:08 +0000 (20:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=240535

Patch by Michael Catanzaro <mcatanzaro@redhat.com> on 2022-05-19
Reviewed by Adrian Perez de Castro.

This commit does two things. First, for each use of
glib-compile-resources, it adds the --dependency-file argument in order
to make the build command depend on the files included in the GResource
manifest, to ensure the resource is automatically recompiled whenever
any of its source files change. Second, for PDF.js only, it replaces the
GLOB_RECURSE command with a list of source files. The
generate-pdfjs-gresource-manifest.py script is adapted to create CMake
file lists in addition to GResource manifests, and renamed from
-gresource-manifest.py to -resource-manifest.py. The web inspector
GResource would benefit from similar work, but that will be a problem
for another day.

* Tools/TestWebKitAPI/glib/CMakeLists.txt:
* Tools/glib/generate-pdfjs-resource-manifest.py: Renamed from Tools/glib/generate-pdfjs-gresource-manifest.py.
(get_filenames):
(get_filenames.resource_name):
(is_compressible):
(write_cmake_file):
(write_gresource_manifest):
* Source/ThirdParty/pdfjs/PdfJSFiles.cmake: Added.
* Source/ThirdParty/pdfjs/README.webkit:
* Source/WebKit/InspectorGResources.cmake:
* Source/WebKit/PdfJSGResources.cmake:
* Source/WebKit/PlatformGTK.cmake:
* Source/WebKit/PlatformWPE.cmake:
* CMakeLists.txt:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

link: https://commits.webkit.org/250761@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294504 268f45cc-cd09-0410-ab3c-d52691b4dbfc

CMakeLists.txt
Source/ThirdParty/pdfjs/PdfJSFiles.cmake [new file with mode: 0644]
Source/ThirdParty/pdfjs/README.webkit
Source/WebKit/InspectorGResources.cmake
Source/WebKit/PdfJSGResources.cmake
Source/WebKit/PlatformGTK.cmake
Source/WebKit/PlatformWPE.cmake
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsWPE.cmake
Tools/TestWebKitAPI/glib/CMakeLists.txt
Tools/glib/generate-pdfjs-resource-manifest.py [moved from Tools/glib/generate-pdfjs-gresource-manifest.py with 72% similarity]

index 8cff2bf04d9cabd62e7fafd9bbb0f6ee04f3054e..8bb7d65fb87f10166241a622be20c390f7ca133c 100644 (file)
 cmake_minimum_required(VERSION 3.12)
 project(WebKit)
 
+# Remove this cmake_policy() after upgrading cmake_minimum_required() to 3.20.
+if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20")
+    cmake_policy(SET CMP0116 OLD)
+endif ()
+
 # -----------------------------------------------------------------------------
 # Common configuration
 #------------------------------------------------------------------------------
diff --git a/Source/ThirdParty/pdfjs/PdfJSFiles.cmake b/Source/ThirdParty/pdfjs/PdfJSFiles.cmake
new file mode 100644 (file)
index 0000000..d7ce28c
--- /dev/null
@@ -0,0 +1,356 @@
+# This file was generated by Tools/glib/generate-pdfjs-resource-manifest.py. Do not modify manually.
+set(PDFJSFiles
+    ${THIRDPARTY_DIR}/pdfjs/build/pdf.js
+    ${THIRDPARTY_DIR}/pdfjs/build/pdf.sandbox.js
+    ${THIRDPARTY_DIR}/pdfjs/build/pdf.worker.js
+    ${THIRDPARTY_DIR}/pdfjs/web/debugger.css
+    ${THIRDPARTY_DIR}/pdfjs/web/debugger.js
+    ${THIRDPARTY_DIR}/pdfjs/web/viewer.css
+    ${THIRDPARTY_DIR}/pdfjs/web/viewer.html
+    ${THIRDPARTY_DIR}/pdfjs/web/viewer.js
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78ms-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/78ms-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/83pv-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90ms-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90ms-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90msp-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90msp-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90pv-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/90pv-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Add-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Add-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Add-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Add-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-0.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-1.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-3.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-4.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-5.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-6.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-CNS1-UCS2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-0.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-1.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-3.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-4.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-5.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-GB1-UCS2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-0.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-1.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-3.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-4.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-5.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-6.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Japan1-UCS2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Korea1-0.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Korea1-1.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Korea1-2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Adobe-Korea1-UCS2.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/B5pc-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/B5pc-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS1-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS1-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS2-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/CNS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETHK-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETHK-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETen-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETen-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETenms-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/ETenms-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Ext-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Ext-RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Ext-RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Ext-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GB-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GB-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GB-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GB-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBK-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBK-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBK2K-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBK2K-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBKp-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBKp-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBT-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBT-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBT-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBT-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBTpc-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBTpc-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBpc-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/GBpc-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKdla-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKdla-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKdlb-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKdlb-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKgccs-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKgccs-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKm314-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKm314-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKm471-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKm471-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKscs-B5-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/HKscs-B5-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Hankaku.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Hiragana.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-Johab-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-Johab-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCms-UHC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCms-UHC-HW-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCms-UHC-HW-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCms-UHC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCpc-EUC-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/KSCpc-EUC-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Katakana.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/NWP-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/NWP-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/RKSJ-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/RKSJ-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/Roman.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UCS2-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UCS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF16-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF16-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF8-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniCNS-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UCS2-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UCS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF16-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF16-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF8-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniGB-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UCS2-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UCS2-HW-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UCS2-HW-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UCS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF16-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF16-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF8-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF16-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF16-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF8-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJIS2004-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISPro-UCS2-HW-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISPro-UCS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISPro-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISX0213-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISX0213-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISX02132004-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniJISX02132004-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UCS2-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UCS2-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF16-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF16-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF32-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF32-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF8-H.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/UniKS-UTF8-V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/V.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/cmaps/WP-Symbol.bcmap
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-check.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-comment.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-help.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-insert.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-key.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-newparagraph.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-noicon.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-note.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/annotation-paragraph.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/findbarButton-next.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/findbarButton-previous.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/loading-dark.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/loading-icon.gif
+    ${THIRDPARTY_DIR}/pdfjs/web/images/loading.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-firstPage.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-handTool.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-lastPage.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-selectTool.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/shadow.png
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-bookmark.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-currentOutlineItem.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-download.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-menuArrow.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-openFile.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-pageDown.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-pageUp.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-presentationMode.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-print.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-search.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-sidebarToggle.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-viewAttachments.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-viewLayers.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-viewOutline.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-viewThumbnail.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-zoomIn.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/toolbarButton-zoomOut.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/treeitem-collapsed.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/images/treeitem-expanded.svg
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/locale.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ach/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/af/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/an/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ar/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ast/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/az/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/be/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/bg/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/bn/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/bo/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/br/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/brx/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/bs/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ca/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/cak/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ckb/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/cs/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/cy/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/da/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/de/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/dsb/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/el/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/en-CA/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/en-GB/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/en-US/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/eo/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/es-AR/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/es-CL/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/es-ES/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/es-MX/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/et/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/eu/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/fa/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ff/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/fi/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/fr/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/fy-NL/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ga-IE/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/gd/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/gl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/gn/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/gu-IN/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/he/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hi-IN/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hr/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hsb/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hu/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hy-AM/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/hye/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ia/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/id/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/is/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/it/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ja/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ka/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/kab/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/kk/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/km/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/kn/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ko/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/lij/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/lo/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/lt/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ltg/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/lv/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/meh/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/mk/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/mr/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ms/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/my/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/nb-NO/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ne-NP/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/nl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/nn-NO/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/oc/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/pa-IN/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/pl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/pt-BR/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/pt-PT/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/rm/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ro/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ru/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sat/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sc/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/scn/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sco/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/si/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sk/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/son/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sq/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sr/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/sv-SE/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/szl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ta/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/te/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/tg/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/th/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/tl/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/tr/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/trs/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/uk/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/ur/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/uz/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/vi/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/wo/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/xh/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/zh-CN/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/locale/zh-TW/viewer.properties
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitDingbats.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitFixed.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitFixedBold.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSans.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSansBold.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSansBoldItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSansItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSerif.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSerifBold.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/FoxitSymbol.pfb
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf
+    ${THIRDPARTY_DIR}/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf
+)
\ No newline at end of file
index 86511c8b3bcc8312aacca89e728f2d5e63e2100a..72e23a596e6be386fe0ab9ae5c58f0298d325781 100644 (file)
@@ -6,4 +6,6 @@ To update to a newer version:
 2. Grab a new official release (*-dist.zip, modern browsers version) distributed at GitHub and extract everything into this directory.
 3. Delete the sourcemap (.js.map) files (currently viewer.js.map, pdf.js.map, pdf.worker.js.map, and pdf.sandbox.js.map).
 4. Delete the example PDF file, compressed.tracemonkey-pldi-09.pdf.
-5. Sanity-check the result by loading https://www.irs.gov/pub/irs-pdf/i1040gi.pdf (big PDF) and https://www.irs.gov/pub/irs-pdf/f1040.pdf (PDF with forms)
+5. From top source dir, run: 'Tools/glib/generate-pdfjs-resource-manifest.py --cmake --input=Source/ThirdParty/pdfjs --output=Source/ThirdParty/pdfjs/PdfJSFiles.cmake'
+6. Build WebKit, your favorite port will do
+7. Sanity-check by loading https://www.irs.gov/pub/irs-pdf/i1040gi.pdf (big PDF) and https://www.irs.gov/pub/irs-pdf/f1040.pdf (PDF with forms)
index 77eee9914a6266f274d878b36d6d91aedb778286..b8be58ac4073ed94e3a599c06355f0191c6b475c 100644 (file)
@@ -9,9 +9,10 @@ macro(WEBKIT_BUILD_INSPECTOR_GRESOURCES _derived_sources_dir)
     )
 
     add_custom_command(
-        OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.c
+        OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.c ${_derived_sources_dir}/InspectorGResourceBundle.deps
         DEPENDS ${_derived_sources_dir}/InspectorGResourceBundle.xml
-        COMMAND glib-compile-resources --generate --sourcedir=${_derived_sources_dir}/InspectorResources/WebInspectorUI --target=${_derived_sources_dir}/InspectorGResourceBundle.c ${_derived_sources_dir}/InspectorGResourceBundle.xml
+        DEPFILE {_derived_sources_dir}/InspectorGResourceBundle.deps
+        COMMAND glib-compile-resources --generate --sourcedir=${_derived_sources_dir}/InspectorResources/WebInspectorUI --target=${_derived_sources_dir}/InspectorGResourceBundle.c --dependency-file=${_derived_sources_dir}/InspectorGResourceBundle.deps ${_derived_sources_dir}/InspectorGResourceBundle.xml
         VERBATIM
     )
 endmacro()
index 3a484b83c70202c0b5869a4332b46fa4cd592776..f1c5b9fa0141e126ebce82b9d9ffc0c393b0c7c9 100644 (file)
@@ -1,4 +1,4 @@
-file(GLOB_RECURSE PdfJSFiles CONFIGURE_DEPENDS ${THIRDPARTY_DIR}/pdfjs/*)
+include(../ThirdParty/pdfjs/PdfJSFiles.cmake)
 
 set(PdfJSExtraFiles
     ${WEBCORE_DIR}/Modules/pdfjs-extras/content-script.js
@@ -7,29 +7,28 @@ set(PdfJSExtraFiles
 macro(WEBKIT_BUILD_PDFJS_GRESOURCES _derived_sources_dir)
     add_custom_command(
         OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundle.xml
-        DEPENDS ${TOOLS_DIR}/glib/generate-pdfjs-gresource-manifest.py
-                ${PdfJSFiles}
-        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-pdfjs-gresource-manifest.py --input=${THIRDPARTY_DIR}/pdfjs --output=${_derived_sources_dir}/PdfJSGResourceBundle.xml
+        DEPENDS ${TOOLS_DIR}/glib/generate-pdfjs-resource-manifest.py ${PdfJSFiles}
+        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-pdfjs-resource-manifest.py --gresource --input=${THIRDPARTY_DIR}/pdfjs --output=${_derived_sources_dir}/PdfJSGResourceBundle.xml
         VERBATIM
     )
 
     add_custom_command(
-        OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundle.c
+        OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundle.c ${_derived_sources_dir}/PdfJSGResourceBundle.deps
         DEPENDS ${_derived_sources_dir}/PdfJSGResourceBundle.xml
-        COMMAND glib-compile-resources --generate --sourcedir=${THIRDPARTY_DIR}/pdfjs --target=${_derived_sources_dir}/PdfJSGResourceBundle.c ${_derived_sources_dir}/PdfJSGResourceBundle.xml
+        DEPFILE ${_derived_sources_dir}/PdfJSGResourceBundle.deps
+        COMMAND glib-compile-resources --generate --sourcedir=${THIRDPARTY_DIR}/pdfjs --target=${_derived_sources_dir}/PdfJSGResourceBundle.c --dependency-file=${_derived_sources_dir}/PdfJSGResourceBundle.deps ${_derived_sources_dir}/PdfJSGResourceBundle.xml
         VERBATIM
     )
 
     add_custom_command(
         OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundleExtras.xml
-        DEPENDS ${TOOLS_DIR}/glib/generate-pdfjs-gresource-manifest.py
-                ${PdfJSExtraFiles}
-        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-pdfjs-gresource-manifest.py --input=${WEBCORE_DIR}/Modules/pdfjs-extras --output=${_derived_sources_dir}/PdfJSGResourceBundleExtras.xml
+        DEPENDS ${TOOLS_DIR}/glib/generate-pdfjs-resource-manifest.py ${PdfJSExtraFiles}
+        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-pdfjs-resource-manifest.py --gresource --input=${WEBCORE_DIR}/Modules/pdfjs-extras --output=${_derived_sources_dir}/PdfJSGResourceBundleExtras.xml
         VERBATIM
     )
 
     add_custom_command(
-        OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundleExtras.c
+        OUTPUT ${_derived_sources_dir}/PdfJSGResourceBundleExtras.c ${_derived_sources_dir}/PdfJSGResourceBundleExtras.deps
         DEPENDS ${_derived_sources_dir}/PdfJSGResourceBundleExtras.xml
         COMMAND glib-compile-resources --generate --sourcedir=${WEBCORE_DIR}/Modules/pdfjs-extras --target=${_derived_sources_dir}/PdfJSGResourceBundleExtras.c ${_derived_sources_dir}/PdfJSGResourceBundleExtras.xml
         VERBATIM
index 505c95d1310f142dd311d8151468d02ac71a73ed..701de727c8ca19283d4da10529f2d50b370d9757 100644 (file)
@@ -597,9 +597,10 @@ file(WRITE ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
 )
 
 add_custom_command(
-    OUTPUT ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c
+    OUTPUT ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps
     DEPENDS ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
-    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebKit/Resources/gtk --target=${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
+    DEPFILE ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps
+    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebKit/Resources/gtk --target=${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c --dependency-file=${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
     VERBATIM
 )
 
index 993c21ea9de13862f3f3657d6b5284a21c3fe06e..f98868ac12819bd7914165b69b3ddce0af63fa34 100644 (file)
@@ -280,9 +280,10 @@ file(WRITE ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
 )
 
 add_custom_command(
-    OUTPUT ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c
+    OUTPUT ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps
     DEPENDS ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
-    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --target=${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
+    DEPFILE ${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps
+    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --target=${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.c --dependency-file=${WebKit2Gtk_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.deps ${WebKit_DERIVED_SOURCES_DIR}/WebKitResourcesGResourceBundle.xml
     VERBATIM
 )
 
index 41d7f6550d4e81157724a53e8758e14b5098cfa2..8dc57e7d0395edee5667eceada38bd3b56668151 100644 (file)
@@ -5,6 +5,11 @@ WEBKIT_OPTION_BEGIN()
 
 SET_PROJECT_VERSION(2 37 0)
 
+# This is required because we use the DEPFILE argument to add_custom_command().
+# Remove after upgrading cmake_minimum_required() to 3.20.
+if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ninja")
+    message(FATAL_ERROR "Building with Makefiles requires CMake 3.20 or newer. Either enable Ninja by passing -GNinja, or upgrade CMake.")
+endif ()
 
 set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
 
index f51b75f1f4d7df78dd7aec630728f78668a9e7a3..9cae317e38d9725896a5c42c4fbbcf09954248a3 100644 (file)
@@ -3,6 +3,12 @@ include(VersioningUtils)
 
 SET_PROJECT_VERSION(2 35 1)
 
+# This is required because we use the DEPFILE argument to add_custom_command().
+# Remove after upgrading cmake_minimum_required() to 3.20.
+if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ninja")
+    message(FATAL_ERROR "Building with Makefiles requires CMake 3.20 or newer. Either enable Ninja by passing -GNinja, or upgrade CMake.")
+endif ()
+
 set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
 
 find_package(Cairo 1.14.0 REQUIRED)
index fed01ffaa61aa0bb9dd52bd33aaab75416784166..35558ad5d58d958f2fa3b578b46c54c133c5d3db 100644 (file)
@@ -119,13 +119,16 @@ if (COMPILER_IS_GCC_OR_CLANG)
 endif ()
 
 add_custom_command(
-    OUTPUT ${TEST_RESOURCES_DIR}/webkitglib-tests-resources.gresource
+    OUTPUT ${TEST_RESOURCES_DIR}/webkitglib-tests-resources.gresource ${TEST_RESOURCES_DIR}/webkitglib-tests-resources.deps
     DEPENDS ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/resources/webkitglib-tests.gresource.xml
             ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/resources/link-title.js
+    DEPFILE ${TEST_RESOURCES_DIR}/webkitglib-tests-resources.deps
     COMMAND glib-compile-resources
             --target=${TEST_RESOURCES_DIR}/webkitglib-tests-resources.gresource
             --sourcedir=${CMAKE_SOURCE_DIR}
+            --dependency-file=${TEST_RESOURCES_DIR}/webkitglib-tests-resources.deps
             ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/resources/webkitglib-tests.gresource.xml
+    VERBATIM
 )
 
 add_custom_target(test-gresource-bundle
similarity index 72%
rename from Tools/glib/generate-pdfjs-gresource-manifest.py
rename to Tools/glib/generate-pdfjs-resource-manifest.py
index d2a3032bfb60db7da27a6bace4a5e4af3617dfd2..937e0a7f5fc16d31051e721f889c2f9a3aac9588 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python3
 # Copyright (C) 2022 Igalia S.L.
+# Copyright (C) 2022 Red Hat Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -24,6 +25,7 @@ COMPRESSIBLE_EXTENSIONS = {'.html', '.js', '.css', '.svg', '.properties'}
 BASE_DIRS = {'pdfjs/', 'pdfjs-extras/'}
 
 IGNORE = {'LICENSE',
+          'PdfJSFiles.cmake',
           'README.webkit',
           'web/cmaps/LICENSE',
           'web/standard_fonts/LICENSE_FOXIT',
@@ -44,6 +46,8 @@ def get_filenames(directory):
         dirs.sort()
         files.sort()
         for file in files:
+            # FIXME: Find a more sophisticated way to ignore unwanted
+            # port-specific files, so this will work for Cocoa ports too.
             if os.path.basename(root) == 'cocoa':
                 continue
             filename = os.path.join(root, file)
@@ -57,7 +61,7 @@ def get_filenames(directory):
                 name = name.replace(os.sep, '/')
             if name not in IGNORE:
                 if os.path.splitext(name)[1] not in VALID_EXTENSIONS:
-                    print('Unexpected file %s, please teach generate-pdfjs-gresource-manifest.py how to handle it' % filename, file=sys.stderr)
+                    print('Unexpected file %s, please teach generate-pdfjs-resource-manifest.py how to handle it' % filename, file=sys.stderr)
                     sys.exit(1)
                 filenames.append(name)
 
@@ -68,15 +72,15 @@ def is_compressible(filename):
     return os.path.splitext(filename)[1] in COMPRESSIBLE_EXTENSIONS
 
 
-if __name__ == "__main__":
-    parser = argparse.ArgumentParser(description='Generate a GResources file for pdfjs.')
-    parser.add_argument('--input', type=str,
-                        help='the input directory')
-    parser.add_argument('--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
-                        help='the output file')
+def write_cmake_file(args):
+    args.output.write("# This file was generated by Tools/glib/generate-pdfjs-resource-manifest.py. Do not modify manually.\n")
+    args.output.write('set(PDFJSFiles\n')
+    for filename in get_filenames(args.input):
+        args.output.write('    ${THIRDPARTY_DIR}/pdfjs/%s\n' % filename)
+    args.output.write(')')
 
-    args = parser.parse_args(sys.argv[1:])
 
+def write_gresource_manifest(args):
     args.output.write("""<?xml version=1.0 encoding=UTF-8?>
 <gresources>
     <gresource prefix="/org/webkit/pdfjs">
@@ -96,3 +100,28 @@ if __name__ == "__main__":
     args.output.write("""    </gresource>
 </gresources>
 """)
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(description='Generate a GResources file for pdfjs.')
+    parser.add_argument('--input', type=str,
+                        help='the input directory')
+    parser.add_argument('--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
+                        help='the output file')
+    parser.add_argument('--cmake', action='store_true',
+                        help='generate CMake file list')
+    parser.add_argument('--gresource', action='store_true',
+                        help='generate GResource manifest')
+
+    args = parser.parse_args(sys.argv[1:])
+
+    if args.cmake and args.gresource:
+        print('Cannot pass both --cmake and --gresource at the same time', file=sys.stderr)
+        sys.exit(1)
+    elif args.cmake:
+        write_cmake_file(args)
+    elif args.gresource:
+        write_gresource_manifest(args)
+    else:
+        print('Must pass either --cmake or --gresource', file=sys.stderr)
+        sys.exit(1)