[Simple line layout] Turn off inline boxtree generation for multiline content
[WebKit-https.git] / Source / WebKit / InspectorGResources.cmake
1 macro(WEBKIT_BUILD_INSPECTOR_GRESOURCES _derived_sources_dir)
2     set(InspectorFiles
3         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
4         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
5         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
6         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
7         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
8         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
9         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
10         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
11         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
12         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/three.js/*.js
13         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
14         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
15         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
16         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
17         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
18         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
19         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
20         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
21         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.png
22         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.svg
23         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
24     )
25
26     file(GLOB InspectorFilesDependencies
27         ${InspectorFiles}
28     )
29
30     set(InspectorResourceScripts
31         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/combine-resources.pl
32         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
33         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/fix-worker-imports-for-optimized-builds.pl
34         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/remove-console-asserts.pl
35         ${JavaScriptCore_SCRIPTS_DIR}/cssmin.py
36         ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
37     )
38
39     # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
40     # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
41     add_custom_command(
42         OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
43         DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
44         COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
45         VERBATIM
46     )
47
48     if (CMAKE_BUILD_TYPE STREQUAL "Debug")
49         set(COMBINE_INSPECTOR_RESOURCES NO)
50         set(COMBINE_TEST_RESOURCES YES)
51     elseif (DEVELOPER_MODE)
52         set(COMBINE_INSPECTOR_RESOURCES YES)
53         set(COMBINE_TEST_RESOURCES YES)
54     else ()
55         set(COMBINE_INSPECTOR_RESOURCES YES)
56         set(COMBINE_TEST_RESOURCES NO)
57     endif ()
58
59     add_custom_command(
60         OUTPUT ${CMAKE_BINARY_DIR}/inspector-resources.stamp
61         DEPENDS ${InspectorFilesDependencies}
62                 ${InspectorResourceScripts}
63                 ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
64         COMMAND cp ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts
65         COMMAND ${CMAKE_COMMAND} -E env "DERIVED_SOURCES_DIR=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}" "SRCROOT=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI" "JAVASCRIPTCORE_PRIVATE_HEADERS_DIR=${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts" "TARGET_BUILD_DIR=${_derived_sources_dir}/InspectorResources" "UNLOCALIZED_RESOURCES_FOLDER_PATH=WebInspectorUI" "COMBINE_INSPECTOR_RESOURCES=${COMBINE_INSPECTOR_RESOURCES}" "COMBINE_TEST_RESOURCES=${COMBINE_TEST_RESOURCES}" PYTHON=${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
66         COMMAND mkdir -p ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj
67         COMMAND cp ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
68         COMMAND touch ${CMAKE_BINARY_DIR}/inspector-resources.stamp
69         VERBATIM
70     )
71
72     add_custom_command(
73         OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.xml
74         DEPENDS ${CMAKE_BINARY_DIR}/inspector-resources.stamp
75                 ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py
76         COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py --input=${_derived_sources_dir}/InspectorResources --output=${_derived_sources_dir}/InspectorGResourceBundle.xml
77         VERBATIM
78     )
79
80     add_custom_command(
81         OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.c
82         DEPENDS ${_derived_sources_dir}/InspectorGResourceBundle.xml
83         COMMAND glib-compile-resources --generate --sourcedir=${_derived_sources_dir}/InspectorResources/WebInspectorUI --target=${_derived_sources_dir}/InspectorGResourceBundle.c ${_derived_sources_dir}/InspectorGResourceBundle.xml
84         VERBATIM
85     )
86 endmacro()