Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legac...
[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/ESLint/*.js
12         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
13         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/three.js/*.js
14         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
15         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
16         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
17         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
18         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
19         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
20         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
21         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
22         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.png
23         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.svg
24         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
25     )
26
27     file(GLOB InspectorFilesDependencies
28         ${InspectorFiles}
29     )
30
31     set(InspectorResourceScripts
32         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/combine-resources.pl
33         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
34         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/fix-worker-imports-for-optimized-builds.pl
35         ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/remove-console-asserts.pl
36         ${JavaScriptCore_SCRIPTS_DIR}/cssmin.py
37         ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
38     )
39
40     # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
41     # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
42     add_custom_command(
43         OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
44         DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
45         COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
46         VERBATIM
47     )
48
49     if (CMAKE_BUILD_TYPE STREQUAL "Debug")
50         set(COMBINE_INSPECTOR_RESOURCES NO)
51         set(COMBINE_TEST_RESOURCES YES)
52     elseif (DEVELOPER_MODE)
53         set(COMBINE_INSPECTOR_RESOURCES YES)
54         set(COMBINE_TEST_RESOURCES YES)
55     else ()
56         set(COMBINE_INSPECTOR_RESOURCES YES)
57         set(COMBINE_TEST_RESOURCES NO)
58     endif ()
59
60     add_custom_command(
61         OUTPUT ${CMAKE_BINARY_DIR}/inspector-resources.stamp
62         DEPENDS ${InspectorFilesDependencies}
63                 ${InspectorResourceScripts}
64                 ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
65         COMMAND cp ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts
66         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}" ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
67         COMMAND mkdir -p ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj
68         COMMAND cp ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
69         COMMAND touch ${CMAKE_BINARY_DIR}/inspector-resources.stamp
70         VERBATIM
71     )
72
73     add_custom_command(
74         OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.xml
75         DEPENDS ${CMAKE_BINARY_DIR}/inspector-resources.stamp
76                 ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py
77         COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py --input=${_derived_sources_dir}/InspectorResources --output=${_derived_sources_dir}/InspectorGResourceBundle.xml
78         VERBATIM
79     )
80
81     add_custom_command(
82         OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.c
83         DEPENDS ${_derived_sources_dir}/InspectorGResourceBundle.xml
84         COMMAND glib-compile-resources --generate --sourcedir=${_derived_sources_dir}/InspectorResources/WebInspectorUI --target=${_derived_sources_dir}/InspectorGResourceBundle.c ${_derived_sources_dir}/InspectorGResourceBundle.xml
85         VERBATIM
86     )
87 endmacro()