diff options
-rw-r--r-- | cmake/Functions.cmake | 161 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 701 | ||||
-rw-r--r-- | src/core/api/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/generator.cmake | 271 | ||||
-rw-r--r-- | src/gn/CMakeLists.txt | 15 | ||||
-rw-r--r-- | src/process/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/httpserver/httpserver.cmake | 3 | ||||
-rw-r--r-- | tests/auto/widgets/proxypac/CMakeLists.txt | 3 |
9 files changed, 714 insertions, 455 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 6f69bb792..b63b96ed1 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -66,18 +66,18 @@ endfunction() function(make_config_for_gn target configFileName) if(NOT DEFINED WEBENGINE_REPO_BUILD) file(GENERATE - OUTPUT ${configFileName}.cxx.cmake + OUTPUT $<CONFIG>/${configFileName}.cxx.cmake CONTENT [[ - set(GN_INCLUDES_IN $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>) - set(GN_DEFINES_IN $<TARGET_PROPERTY:COMPILE_DEFINITIONS>) - set(GN_LIBS_IN $<TARGET_PROPERTY:LINK_LIBRARIES>) - set(GN_LINK_OPTIONS_IN $<TARGET_PROPERTY:LINK_OPTIONS>) - set(GN_CXX_COMPILE_OPTIONS_IN $<TARGET_PROPERTY:COMPILE_OPTIONS>)]] + set(GN_INCLUDES $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>) + set(GN_DEFINES $<TARGET_PROPERTY:COMPILE_DEFINITIONS>) + set(GN_LIBS $<TARGET_PROPERTY:LINK_LIBRARIES>) + set(GN_LINK_OPTIONS $<TARGET_PROPERTY:LINK_OPTIONS>) + set(GN_CXX_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)]] CONDITION $<COMPILE_LANGUAGE:CXX> TARGET ${target}) file(GENERATE - OUTPUT ${configFileName}.c.cmake - CONTENT [[ set(GN_C_COMPILE_OPTIONS_IN $<TARGET_PROPERTY:COMPILE_OPTIONS>)]] + OUTPUT $<CONFIG>/${configFileName}.c.cmake + CONTENT [[ set(GN_C_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)]] CONDITION $<COMPILE_LANGUAGE:C> TARGET ${target}) endif() @@ -89,6 +89,151 @@ function(make_install_only target) endif() endfunction() +function(add_gn_target target) + add_custom_target(${target}) + list(REMOVE_ITEM ARGN ${target}) + set_target_properties(${target} PROPERTIES + ELEMENTS "${ARGN}" + PREFIX "GN") +endfunction() + +function(read_gn_target target filePath) + include(${filePath}) + applyToGnTarget(${target}) +endfunction() + +macro(applyToGnTarget target) + get_target_property(elementList ${target} ELEMENTS) + get_target_property(prefix ${target} PREFIX) + foreach(element IN LISTS elementList) + if(${prefix}_${element}) + message(DEBUG "${prefix}_${element} = ${${prefix}_${element}}") + set_property(TARGET ${target} APPEND PROPERTY ${prefix}_${element} ${${prefix}_${element}}) + endif() + endforeach() +endmacro() + +function(extend_gn_target target) + get_target_property(elements ${target} ELEMENTS) + qt_parse_all_arguments(GN "extend_gn_target" "" "" "CONDITION;${elements}" "${ARGN}") + if ("x${GN_CONDITION}" STREQUAL x) + set(GN_CONDITION ON) + endif() + qt_evaluate_config_expression(result ${GN_CONDITION}) + if(${result}) + message(DEBUG "extend_gn_target(${target} CONDITION ${GN_CONDITION} ...): Evaluated") + applyToGnTarget(${target}) + endif() +endfunction() + +function(extend_gn_list outList) + qt_parse_all_arguments(GN "extend_gn_list" "" "" "ARGS;CONDITION" "${ARGN}") + if ("x${GN_CONDITION}" STREQUAL x) + set(GN_CONDITION ON) + endif() + qt_evaluate_config_expression(result ${GN_CONDITION}) + if(${result}) + set(value "true") + else() + set(value "false") + endif() + message(DEBUG "extend_gn_list(${outList} ${GN_ARGS} CONDITION ${GN_CONDITION} ...): Evaluated to ${value}") + foreach(gnArg ${GN_ARGS}) + set(${outList} "${${outList}}" "${gnArg}=${value}") + endforeach() + set(${outList} "${${outList}}" PARENT_SCOPE) +endfunction() + +function(configure_gn_target target configType inFilePath outFilePath) + + # GN_CONFIG + string(TOUPPER ${configType} GN_CONFIG) + + # GN_SOURCES GN_HEADERS + get_target_property(gnSources ${target} GN_SOURCES) + foreach(gnSourceFile ${gnSources}) + get_filename_component(gnSourcePath ${gnSourceFile} REALPATH) + list(APPEND sourceList \"${gnSourcePath}\") + endforeach() + set(GN_HEADERS ${sourceList}) + set(GN_SOURCES ${sourceList}) + list(FILTER GN_HEADERS INCLUDE REGEX "^.+\\.h\"$") + list(FILTER GN_SOURCES EXCLUDE REGEX "^.+\\.h\"$") + string(REPLACE ";" ",\n " GN_HEADERS "${GN_HEADERS}") + string(REPLACE ";" ",\n " GN_SOURCES "${GN_SOURCES}") + + # GN_DEFINES + get_target_property(gnDefines ${target} GN_DEFINES) + list(REMOVE_DUPLICATES gnDefines) + foreach(gnDefine ${gnDefines}) + list(APPEND GN_ARGS_DEFINES \"-D${gnDefine}\") + list(APPEND GN_DEFINES \"${gnDefine}\") + endforeach() + string(REPLACE ";" ",\n " GN_ARGS_DEFINES "${GN_ARGS_DEFINES}") + string(REPLACE ";" ",\n " GN_DEFINES "${GN_DEFINES}") + + # GN_INCLUDES + get_target_property(gnIncludes ${target} GN_INCLUDES) + list(REMOVE_DUPLICATES gnIncludes) + foreach(gnInclude ${gnIncludes}) + get_filename_component(gnInclude ${gnInclude} REALPATH) + list(APPEND GN_ARGS_INCLUDES \"-I${gnInclude}\") + list(APPEND GN_INCLUDE_DIRS \"${gnInclude}\") + endforeach() + string(REPLACE ";" ",\n " GN_ARGS_INCLUDES "${GN_ARGS_INCLUDES}") + string(REPLACE ";" ",\n " GN_INCLUDE_DIRS "${GN_INCLUDE_DIRS}") + + # MOC + get_target_property(GN_MOC_BIN_IN Qt6::moc IMPORTED_LOCATION) + set(GN_ARGS_MOC_BIN \"${GN_MOC_BIN_IN}\") + + # GN_CFLAGS_CC + get_target_property(gnCxxCompileOptions ${target} GN_CXX_COMPILE_OPTIONS) + foreach(gnCxxCompileOption ${gnCxxCompileOptions}) + list(APPEND GN_CFLAGS_CC \"${gnCxxCompileOption}\") + endforeach() + list(REMOVE_DUPLICATES GN_CFLAGS_CC) + string(REPLACE ";" ",\n " GN_CFLAGS_CC "${GN_CFLAGS_CC}") + + # GN_CFLAGS_C + get_target_property(gnCCompileOptions ${target} GN_C_COMPILE_OPTIONS) + foreach(gnCCompileOption ${gnCCompileOptions}) + list(APPEND GN_CFLAGS_C \"${gnCCompileOption}\") + endforeach() + list(REMOVE_DUPLICATES GN_CFLAGS_C) + string(REPLACE ";" ",\n " GN_CFLAGS_C "${GN_CFLAGS_C}") + configure_file(${inFilePath} ${outFilePath} @ONLY) +endfunction() + +# we had no qtsync on headers during configure, so take current interface from expression +# generator from our WebEngieCore target so we can apply it for our buildGn target +function(resolve_target_includes resultVar target) + get_target_property(includeDirs ${target} INCLUDE_DIRECTORIES) + foreach(includeDir ${includeDirs}) + if (includeDir MATCHES "\\$<BUILD_INTERFACE:([^,>]+)>") + list(APPEND includeDirList ${CMAKE_MATCH_1}) + endif() + endforeach() + set(${resultVar} ${includeDirList} PARENT_SCOPE) +endfunction() + +function(get_install_config result) + if(DEFINED CMAKE_BUILD_TYPE) + set(${result} ${CMAKE_BUILD_TYPE} PARENT_SCOPE) + elseif(DEFINED CMAKE_CONFIGURATION_TYPES) + if("Release" IN_LIST CMAKE_CONFIGURATION_TYPES) + set(${result} "Release" PARENT_SCOPE) + elseif("RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES) + set(${result} "RelWithDebInfo" PARENT_SCOPE) + elseif("Debug" IN_LIST CMAKE_CONFIGURATION_TYPE) + set(${result} "Debug" PARENT_SCOPE) + else() + # assume MinSizeRel ? + set(${result} "${CMAKE_CONFIGURATION_TYPES}" PARENT_SCOPE) + endif() + endif() +endfunction() + macro(assertRunAsTopLevelBuild condition) if (NOT DEFINED WEBENGINE_REPO_BUILD AND ${condition}) message(FATAL_ERROR "This cmake file should run as top level build.") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d8c587034..500f6ed89 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.19) if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR) - get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH) endif() include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a8f377632..ff38398d8 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required(VERSION 3.19) if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR) - get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) + get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH) endif() if (NOT DEFINED WEBENGINE_ROOT_BUILD_DIR) - get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/../.." ABSOLUTE) + get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/../.." REALPATH) endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake") -set(buildDir "${CMAKE_CURRENT_BINARY_DIR}/debug") +set(buildDir "${CMAKE_CURRENT_BINARY_DIR}") include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake) @@ -16,198 +16,571 @@ assertRunAsTopLevelBuild(TRUE) add_subdirectory(api) -get_qt_features(featureList webengine) -message(${featureList}) - find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets Network OpenGL OpenGLWidgets Quick Qml QuickTest Test) find_package(Gn REQUIRED) -find_package(Ninja REQUIRED) -find_package(Python2 REQUIRED) - -get_target_property(qtWebEngineProcessName Qt6::WebEngineCore QTWEBENGINEPROCESS_NAME) - -include(generator.cmake) -configure_file(${WEBENGINE_ROOT_SOURCE_DIR}/src/core/configure/BUILD.toolchain.gn.in ${buildDir}/toolchain/BUILD.gn @ONLY) -configure_file(${WEBENGINE_ROOT_SOURCE_DIR}/src/core/configure/BUILD.root.gn.in ${buildDir}/BUILD.gn @ONLY) +find_package(Ninja 1.7.2 REQUIRED) +find_package(Python2 2.7.5 REQUIRED) +find_package(Nodejs 12.0) +find_package(PkgConfig) +if(PkgConfig_FOUND) + pkg_check_modules(XSCRNSAVER xscrnsaver) +endif() +get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME) get_target_property(gnCmd Gn::gn IMPORTED_LOCATION) +get_qt_features(featureList webengine) -set(gnArg gen ${buildDir}) - -list(APPEND gnArg - --script-executable=${Python2_EXECUTABLE} - --root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium) - -list(APPEND gnArgArg - use_qt=true - init_stack_vars=false - is_component_build=false - is_shared=true - enable_debugallocation=false - enable_media_remoting=false - enable_message_center=false - enable_nacl=false - enable_remoting=false - enable_reporting=false - enable_resource_allowlist_generation=false - enable_swiftshader=false - enable_swiftshader_vulkan=false - angle_enable_swiftshader=false - enable_web_speech=false - enable_widevine=true - forbid_non_component_debug_builds=false - has_native_accessibility=false - safe_browsing_mode=0 - skia_use_dawn=false - toolkit_views=false - treat_warnings_as_errors=false - use_allocator_shim=false - use_allocator="none" - use_custom_libcxx=false - chrome_pgo_phase=0 - enable_hangout_services_extension=false - optimize_webui=false - enable_js_type_check=false - v8_use_external_startup_data=false - strip_absolute_paths_from_debug_symbols=false - use_jumbo_build=true - jumbo_file_merge_limit=8 - jumbo_build_excluded=["browser"] - enable_precompiled_headers=false - is_official_build=false - is_unsafe_developer_build=false - from_here_uses_location_builtins=false - is_debug=true use_debug_fission=false - blink_symbol_level=0 - remove_v8base_debug_symbols=true - use_cups=false - use_gio=false - use_gnome_keyring=false - use_udev=true - use_bundled_fontconfig=false - use_sysroot=false - enable_session_service=false - is_cfi=false - use_ozone=true - use_x11=false - ozone_auto_platforms=false - ozone_platform_headless=false - ozone_platform_external=true - ozone_platform="qt" - ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni" - use_gold=false - use_lld=true - is_clang=false - custom_toolchain="${buildDir}/toolchain:target" - host_toolchain="${buildDir}/toolchain:host" - host_cpu="x64" - pkg_config="pkg-config" - host_pkg_config="/usr/bin/pkg-config" - use_system_zlib=true - use_system_minizip=true - pdfium_use_system_zlib=true - use_system_libpng=true - pdfium_use_system_libpng=true - use_system_libjpeg=true - use_system_freetype=true - use_system_harfbuzz=false - use_glib=false - enable_basic_printing=false - enable_print_preview=false - enable_pdf=false - enable_plugins=false - enable_spellcheck=false - enable_webrtc=false - proprietary_codecs=false - enable_extensions=false - use_kerberos=false - use_pulseaudio=true - use_alsa=true - ozone_platform_x11=true - use_xkbcommon=true - use_xscrnsaver=true - rtc_use_x11=true - use_system_libevent=true - use_system_libwebp=true - use_system_opus=true - use_system_snappy=true - use_system_libvpx=true - use_system_re2=true - use_system_lcms2=true - qtwebengine_target="${buildDir}:QtWebEngineCore") -list(JOIN gnArgArg " " gnArgArg) -list(APPEND gnArg "--args=${gnArgArg}") - -message("configure with gn") -execute_process( - COMMAND ${gnCmd} ${gnArg} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMAND_ECHO STDOUT - RESULT_VARIABLE gnResult - OUTPUT_VARIABLE gnOutput - ERROR_VARIABLE gnError - ) - -if(NOT gnResult EQUAL 0) - message(FATAL_ERROR "Calling gn - FAILED ! \n${gnOutput}\n${gnError}") +if(QT_GENERATOR_IS_MULTI_CONFIG) + set(configs ${CMAKE_CONFIGURATION_TYPES}) +else() + set(configs ${CMAKE_BUILD_TYPE}) endif() -message("CMD: ${gnCmd}\nARGS: ${gnArg}\nOUTPUT: ${gnOutput}") +foreach(config ${configs}) + +## +# BULID.gn SETUP +## + + unset(buildGn) + set(buildGn buildGn_${config}) + + add_gn_target(${buildGn} SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES) + + resolve_target_includes(gnIncludes WebEngineCore) -include(${buildDir}/QtWebEngineCore.cmake) + extend_gn_target(${buildGn} + INCLUDES + ${gnIncludes} + DEFINES + QT_NO_KEYWORDS + QT_USE_QSTRINGBUILDER + QTWEBENGINECORE_VERSION_STR=\\\\\"${QT_REPO_MODULE_VERSION}\\\\\" + QTWEBENGINEPROCESS_NAME=\\\\\"${qtWebEngineProcessName}\\\\\" + BUILDING_CHROMIUM + SOURCES + accessibility_activation_observer.cpp accessibility_activation_observer.h + accessibility_tree_formatter_qt.cpp + authentication_dialog_controller.cpp authentication_dialog_controller.h authentication_dialog_controller_p.h + browser_accessibility_manager_qt.cpp browser_accessibility_manager_qt.h + browser_accessibility_qt.cpp browser_accessibility_qt.h + browser_main_parts_qt.cpp browser_main_parts_qt.h + browser_message_filter_qt.cpp browser_message_filter_qt.h + browsing_data_remover_delegate_qt.cpp browsing_data_remover_delegate_qt.h + build_config_qt.h + certificate_error_controller.cpp certificate_error_controller.h + chromium_overrides.cpp + client_cert_select_controller.cpp client_cert_select_controller.h + clipboard_change_observer.h + clipboard_qt.cpp clipboard_qt.h + color_chooser_controller.cpp color_chooser_controller.h color_chooser_controller_p.h + color_chooser_qt.cpp color_chooser_qt.h + common/qt_ipc_logging.cpp + common/qt_messages.cpp common/qt_messages.h + compositor/compositor.cpp compositor/compositor.h + compositor/content_gpu_client_qt.cpp compositor/content_gpu_client_qt.h + compositor/display_overrides.cpp + compositor/display_software_output_surface.cpp compositor/display_software_output_surface.h + content_browser_client_qt.cpp content_browser_client_qt.h + content_client_qt.cpp content_client_qt.h + content_main_delegate_qt.cpp content_main_delegate_qt.h + content_utility_client_qt.cpp content_utility_client_qt.h + delegated_frame_host_client_qt.cpp delegated_frame_host_client_qt.h + desktop_screen_qt.cpp desktop_screen_qt.h + devtools_frontend_qt.cpp devtools_frontend_qt.h + devtools_manager_delegate_qt.cpp devtools_manager_delegate_qt.h + download_manager_delegate_qt.cpp download_manager_delegate_qt.h + favicon_manager.cpp favicon_manager.h + file_picker_controller.cpp file_picker_controller.h + find_text_helper.cpp find_text_helper.h + global_descriptors_qt.h + javascript_dialog_controller.cpp javascript_dialog_controller.h javascript_dialog_controller_p.h + javascript_dialog_manager_qt.cpp javascript_dialog_manager_qt.h + login_delegate_qt.cpp login_delegate_qt.h + media_capture_devices_dispatcher.cpp media_capture_devices_dispatcher.h + native_web_keyboard_event_qt.cpp + net/client_cert_override.cpp net/client_cert_override.h + net/client_cert_store_data.cpp net/client_cert_store_data.h + net/cookie_monster_delegate_qt.cpp net/cookie_monster_delegate_qt.h + net/custom_url_loader_factory.cpp net/custom_url_loader_factory.h + net/proxy_config_monitor.cpp + net/proxy_config_service_qt.cpp + net/proxying_restricted_cookie_manager_qt.cpp net/proxying_restricted_cookie_manager_qt.h + net/proxying_url_loader_factory_qt.cpp net/proxying_url_loader_factory_qt.h + net/qrc_url_scheme_handler.cpp net/qrc_url_scheme_handler.h + net/ssl_host_state_delegate_qt.cpp net/ssl_host_state_delegate_qt.h + net/system_network_context_manager.cpp net/system_network_context_manager.h + net/url_request_custom_job_delegate.cpp net/url_request_custom_job_delegate.h + net/url_request_custom_job_proxy.cpp net/url_request_custom_job_proxy.h + net/webui_controller_factory_qt.cpp net/webui_controller_factory_qt.h + ozone/gl_context_qt.cpp ozone/gl_context_qt.h + ozone/gl_ozone_egl_qt.cpp ozone/gl_ozone_egl_qt.h + ozone/gl_share_context_qt.cpp ozone/gl_share_context_qt.h + ozone/gl_surface_egl_qt.cpp ozone/gl_surface_egl_qt.h + ozone/gl_surface_qt.cpp ozone/gl_surface_qt.h + ozone/gl_surface_wgl_qt.cpp ozone/gl_surface_wgl_qt.h + ozone/platform_window_qt.cpp ozone/platform_window_qt.h + ozone/surface_factory_qt.cpp ozone/surface_factory_qt.h + permission_manager_qt.cpp permission_manager_qt.h + platform_notification_service_qt.cpp platform_notification_service_qt.h + pref_service_adapter.cpp pref_service_adapter.h + process_main.cpp process_main.h + profile_adapter.cpp profile_adapter.h + profile_adapter_client.cpp profile_adapter_client.h + profile_io_data_qt.cpp profile_io_data_qt.h + profile_qt.cpp profile_qt.h + proxy_config_monitor.h + proxy_config_service_qt.h + quota_permission_context_qt.cpp quota_permission_context_qt.h + quota_request_controller.h + quota_request_controller_impl.cpp quota_request_controller_impl.h + register_protocol_handler_request_controller.h + register_protocol_handler_request_controller_impl.cpp register_protocol_handler_request_controller_impl.h + render_view_context_menu_qt.cpp render_view_context_menu_qt.h + render_widget_host_view_qt.cpp render_widget_host_view_qt.h + render_widget_host_view_qt_delegate.h + render_widget_host_view_qt_delegate_client.cpp render_widget_host_view_qt_delegate_client.h + renderer/content_renderer_client_qt.cpp renderer/content_renderer_client_qt.h + renderer/content_settings_observer_qt.cpp renderer/content_settings_observer_qt.h + renderer/render_configuration.cpp renderer/render_configuration.h + renderer/render_frame_observer_qt.cpp renderer/render_frame_observer_qt.h + renderer/user_resource_controller.cpp renderer/user_resource_controller.h + renderer/web_engine_page_render_frame.cpp renderer/web_engine_page_render_frame.h + renderer_host/user_resource_controller_host.cpp renderer_host/user_resource_controller_host.h + renderer_host/web_engine_page_host.cpp renderer_host/web_engine_page_host.h + request_controller.h + resource_bundle_qt.cpp + resource_context_qt.cpp resource_context_qt.h + touch_handle_drawable_client.h + touch_handle_drawable_qt.cpp touch_handle_drawable_qt.h + touch_selection_controller_client_qt.cpp touch_selection_controller_client_qt.h + touch_selection_menu_controller.cpp touch_selection_menu_controller.h + type_conversion.cpp type_conversion.h + user_notification_controller.cpp user_notification_controller.h + user_script.cpp user_script.h + visited_links_manager_qt.cpp visited_links_manager_qt.h + web_contents_adapter.cpp web_contents_adapter.h + web_contents_adapter_client.h + web_contents_delegate_qt.cpp web_contents_delegate_qt.h + web_contents_view_qt.cpp web_contents_view_qt.h + web_engine_context.cpp web_engine_context.h + web_engine_context_threads.cpp + web_engine_error.cpp web_engine_error.h + web_engine_library_info.cpp web_engine_library_info.h + web_engine_settings.cpp web_engine_settings.h + web_event_factory.cpp web_event_factory.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_ozone_x11 + SOURCES + ozone/gl_ozone_glx_qt.cpp ozone/gl_ozone_glx_qt.h + ozone/gl_surface_glx_qt.cpp ozone/gl_surface_glx_qt.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_opengl + SOURCES + compositor/compositor_resource_fence.cpp compositor/compositor_resource_fence.h + compositor/display_gl_output_surface.cpp compositor/display_gl_output_surface.h + ) + + extend_gn_target(${buildGn} CONDITION MACOS AND QT_FEATURE_opengl + SOURCES + macos_context_type_helper.mm macos_context_type_helper.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_pepper_plugins + SOURCES + renderer/pepper/pepper_renderer_host_factory_qt.cpp renderer/pepper/pepper_renderer_host_factory_qt.h + renderer/plugins/loadable_plugin_placeholder_qt.cpp renderer/plugins/loadable_plugin_placeholder_qt.h + renderer_host/pepper/pepper_host_factory_qt.cpp renderer_host/pepper/pepper_host_factory_qt.h + renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp renderer_host/pepper/pepper_isolated_file_system_message_filter.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_printing_and_pdf + SOURCES + printing/pdfium_document_wrapper_qt.cpp printing/pdfium_document_wrapper_qt.h + printing/print_view_manager_base_qt.cpp printing/print_view_manager_base_qt.h + printing/print_view_manager_qt.cpp printing/print_view_manager_qt.h + printing/printer_worker.cpp printing/printer_worker.h + printing/printing_message_filter_qt.cpp printing/printing_message_filter_qt.h + renderer/print_web_view_helper_delegate_qt.cpp renderer/print_web_view_helper_delegate_qt.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_geolocation + SOURCES + location_provider_qt.cpp location_provider_qt.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_webchannel + SOURCES + renderer/web_channel_ipc_transport.cpp renderer/web_channel_ipc_transport.h + renderer_host/web_channel_ipc_transport_host.cpp renderer_host/web_channel_ipc_transport_host.h + ) + + extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_extensions + SOURCES + common/extensions/extensions_api_provider_qt.cpp common/extensions/extensions_api_provider_qt.h + common/extensions/extensions_client_qt.cpp common/extensions/extensions_client_qt.h + extensions/component_extension_resource_manager_qt.cpp extensions/component_extension_resource_manager_qt.h + extensions/extension_host_delegate_qt.cpp extensions/extension_host_delegate_qt.h + extensions/extension_system_factory_qt.cpp extensions/extension_system_factory_qt.h + extensions/extension_system_qt.cpp extensions/extension_system_qt.h + extensions/extension_web_contents_observer_qt.cpp extensions/extension_web_contents_observer_qt.h + extensions/extensions_api_client_qt.cpp extensions/extensions_api_client_qt.h + extensions/extensions_browser_client_qt.cpp extensions/extensions_browser_client_qt.h + extensions/messaging_delegate_qt.cpp extensions/messaging_delegate_qt.h + extensions/mime_handler_view_guest_delegate_qt.cpp extensions/mime_handler_view_guest_delegate_qt.h + extensions/pdf_iframe_navigation_throttle_qt.cpp extensions/pdf_iframe_navigation_throttle_qt.h + extensions/plugin_service_filter_qt.cpp extensions/plugin_service_filter_qt.h + net/plugin_response_interceptor_url_loader_throttle.cpp net/plugin_response_interceptor_url_loader_throttle.h + renderer/extensions/extensions_dispatcher_delegate_qt.cpp renderer/extensions/extensions_dispatcher_delegate_qt.h + renderer/extensions/extensions_renderer_client_qt.cpp renderer/extensions/extensions_renderer_client_qt.h + renderer/extensions/renderer_permissions_policy_delegate_qt.cpp renderer/extensions/renderer_permissions_policy_delegate_qt.h + renderer/extensions/resource_request_policy_qt.cpp renderer/extensions/resource_request_policy_qt.h + ) + + read_gn_target(${buildGn} ${WEBENGINE_ROOT_BUILD_DIR}/src/core/api/${config}/gn_config.cxx.cmake) + read_gn_target(${buildGn} ${WEBENGINE_ROOT_BUILD_DIR}/src/core/api/${config}/gn_config.c.cmake) + configure_gn_target(${buildGn} ${config} + ${WEBENGINE_ROOT_SOURCE_DIR}/src/core/configure/BUILD.root.gn.in ${buildDir}/${config}/BUILD.gn) + +## +# TOOLCHAIN SETUP +## + + configure_file(${WEBENGINE_ROOT_SOURCE_DIR}/src/core/configure/BUILD.toolchain.gn.in + ${buildDir}/${config}/toolchain/BUILD.gn @ONLY) + +## +# GN CALL PARAMETERS SETUP +## + + unset(gnArg) + unset(gnArgArg) + set(gnArg gen ${buildDir}/${config}) + + list(APPEND gnArg + --script-executable=${Python2_EXECUTABLE} + --root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium) + + if(${config} STREQUAL "Debug") + list(APPEND gnArgArg is_debug=true symbol_level=2) + if(WIN32 AND NOT CLANG) + list(APPEND gnArgArg enable_iterator_debugging=true v8_optimized_debug=false) + endif() + elseif(${config} STREQUAL "Release") + list(APPEND gnArgArg is_debug=false symbol_level=0) + elseif(${config} STREQUAL "RelWithDebInfo") + list(APPEND gnArgArg is_debug=false) + if(WIN32 AND NOT CLANG) + list(APPEND gnArgArg symbol_level=2) + else() + list(APPEND gnArgArg symbol_level=1) + endif() + elseif(${config} STREQUAL "MinSizeRel") + list(APPEND gnArgArg is_debug=false symbol_level=0 optimize_for_size=true) + endif() + + list(APPEND gnArgArg + qtwebengine_target="${buildDir}/${config}:QtWebEngineCore" + use_qt=true + init_stack_vars=false + is_component_build=false + is_shared=true + enable_debugallocation=false + enable_media_remoting=false + enable_message_center=false + enable_nacl=false + enable_remoting=false + enable_reporting=false + enable_resource_allowlist_generation=false + enable_swiftshader=false + enable_swiftshader_vulkan=false + angle_enable_swiftshader=false + enable_web_speech=false + enable_widevine=true + forbid_non_component_debug_builds=false + has_native_accessibility=false + safe_browsing_mode=0 + skia_use_dawn=false + toolkit_views=false + treat_warnings_as_errors=false + use_allocator_shim=false + use_allocator="none" + use_custom_libcxx=false + chrome_pgo_phase=0 + enable_hangout_services_extension=false + optimize_webui=false + enable_js_type_check=false + v8_use_external_startup_data=false + strip_absolute_paths_from_debug_symbols=false + enable_precompiled_headers=false + is_official_build=false + is_unsafe_developer_build=false + from_here_uses_location_builtins=false + use_debug_fission=false + blink_symbol_level=0 + remove_v8base_debug_symbols=true + ) + extend_gn_list(gnArgArg + ARGS use_jumbo_build + CONDITION NOT WIN32 + ) + if(NOT WIN32) + list(APPEND gnArgArg jumbo_file_merge_limit=8 jumbo_build_excluded=["browser"]) + endif() + extend_gn_list(gnArgArg + ARGS is_clang + CONDITION CLANG + ) + if(CLANG) + list(APPEND gnArgArg clang_use_chrome_plugins=false) + endif() + extend_gn_list(gnArgArg + ARGS use_gold + CONDITION QT_FEATURE_use_gold_linker + ) + extend_gn_list(gnArgArg + ARGS use_lld + CONDITION QT_FEATURE_use_lld_linker + ) + extend_gn_list(gnArgArg + ARGS enable_basic_printing enable_print_preview enable_pdf + CONDITION QT_FEATURE_webengine_printing_and_pdf + ) + extend_gn_list(gnArgArg + ARGS enable_plugins + CONDITION QT_FEATURE_webengine_pepper_plugins + ) + extend_gn_list(gnArgArg + ARGS enable_spellcheck + CONDITION QT_FEATURE_webengine_spellchecker + ) + extend_gn_list(gnArgArg + ARGS enable_webrtc + CONDITION QT_FEATURE_webengine_webrtc + ) + extend_gn_list(gnArgArg + ARGS rtc_use_pipewire + CONDITION QT_FEATURE_webengine_webrtc_pipewire + ) + extend_gn_list(gnArgArg + ARGS enable_extensions + CONDITION QT_FEATURE_webengine_extensions + ) + extend_gn_list(gnArgArg + ARGS use_kerberos + CONDITION QT_FEATURE_webengine_kerberos + ) + extend_gn_list(gnArgArg + ARGS proprietary_codecs + CONDITION QT_FEATURE_webengine_proprietary_codecs + ) + if(QT_FEATURE_webengine_proprietary_codecs) + list(APPEND gnArgArg ffmpeg_branding="Chrome") + endif() + extend_gn_list(gnArgArg + ARGS use_browser_spellchecker + CONDITION QT_FEATURE_webengine_native_spellchecker + ) + extend_gn_list(gnArgArg + ARGS use_rollup + CONDITION TARGET Nodejs::Nodejs + ) + if(LINUX) + list(APPEND gnArgArg + use_cups=false + use_gio=false + use_gnome_keyring=false + use_udev=true + use_bundled_fontconfig=false + use_sysroot=false + enable_session_service=false + is_cfi=false + use_ozone=true + use_x11=false + ozone_auto_platforms=false + ozone_platform_headless=false + ozone_platform_external=true + ozone_platform="qt" + ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni" + custom_toolchain="${buildDir}/${config}/toolchain:target" + host_toolchain="${buildDir}/${config}/toolchain:host" + host_cpu="x64" + pkg_config="pkg-config" + host_pkg_config="/usr/bin/pkg-config" + use_glib=false + ) + set(systemLibs libjpeg libpng freetype harfbuzz libevent libwebp libxml + opus snappy libvpx icu ffmpeg re2 lcms2 + ) + foreach(slib ${systemLibs}) + extend_gn_list(gnArgArg + ARGS use_system_${slib} + CONDITION QT_FEATURE_webengine_system_${slib} + ) + endforeach() + extend_gn_list(gnArgArg + ARGS icu_use_data_file + CONDITION NOT QT_FEATURE_webengine_system_icu + ) + extend_gn_list(gnArgArg + ARGS use_system_zlib use_system_minizip + CONDITION QT_FEATURE_webengine_system_zlib AND QT_FEATURE_webengine_system_minizip + ) + extend_gn_list(gnArgArg + ARGS pdfium_use_system_zlib + CONDITION QT_FEATURE_webengine_system_zlib + ) + extend_gn_list(gnArgArg + ARGS pdfium_use_system_libpng + CONDITION QT_FEATURE_webengine_system_libpng + ) + extend_gn_list(gnArgArg + ARGS use_libpci + CONDITION QT_FEATURE_webengine_system_libpci + ) + extend_gn_list(gnArgArg + ARGS use_alsa + CONDITION QT_FEATURE_webengine_system_alsa + ) + extend_gn_list(gnArgArg + ARGS use_pulseaudio + CONDITION QT_FEATURE_webengine_system_pulseaudio + ) + extend_gn_list(gnArgArg + ARGS ozone_platform_x11 use_xkbcommon + CONDITION QT_FEATURE_webengine_ozone_x11 + ) + extend_gn_list(gnArgArg + ARGS rtc_use_x11 + CONDITION QT_FEATURE_webengine_ozone_x11 AND QT_FEATURE_webengine_webrtc + ) + extend_gn_list(gnArgArg + ARGS use_xscrnsaver + CONDITION XSCRNSAVER_FOUND + ) + endif() + + list(JOIN gnArgArg " " gnArgArg) + list(APPEND gnArg "--args=${gnArgArg}") + +## +# GN CALL +## + + list(JOIN gnArg " " printArg) + message("-- Running ${config} Configuration for GN \n-- ${gnCmd} ${printArg}") + execute_process( + COMMAND ${gnCmd} ${gnArg} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + RESULT_VARIABLE gnResult + OUTPUT_VARIABLE gnOutput + ERROR_VARIABLE gnError + ) + + if(NOT gnResult EQUAL 0) + message(FATAL_ERROR "\n-- GN FAILED\n${gnOutput}\n${gnError}") + else() + string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}") + message("-- GN ${gnOutput}") + endif() + include(${buildDir}/${config}/QtWebEngineCore.cmake) +endforeach() + +## +# NINJA CALL +## add_custom_command( OUTPUT QtWebEngineCore.stamp - WORKING_DIRECTORY ${buildDir} + WORKING_DIRECTORY ${buildDir}/$<CONFIG> COMMAND Ninja::ninja $ENV{NINJAFLAGS} - -C ${buildDir} + -C ${buildDir}/$<CONFIG> QtWebEngineCore USES_TERMINAL VERBATIM + COMMAND_EXPAND_LISTS ) -add_custom_target(ninja ALL DEPENDS QtWebEngineCore.stamp) + +add_custom_target(ninja DEPENDS QtWebEngineCore.stamp) + +## +# WEBENGINECORE SETUP +## add_dependencies(WebEngineCore ninja) -target_include_directories(WebEngineCore PRIVATE ${buildDir}/gen) +target_include_directories(WebEngineCore PRIVATE ${buildDir}/$<CONFIG>/gen) +add_library(GnObjects OBJECT IMPORTED GLOBAL) +target_link_libraries(WebEngineCore PRIVATE GnObjects) -# there is no syncqt on this module so use includes provided for gn, which should be identical -target_include_directories(WebEngineCore PRIVATE ${GN_INCLUDES_IN}) -add_library(chromiumObjects OBJECT IMPORTED GLOBAL) -set_property(TARGET chromiumObjects PROPERTY IMPORTED_OBJECTS ${NINJA_OBJECTS}) -target_link_libraries(WebEngineCore PRIVATE chromiumObjects) -target_link_libraries(WebEngineCore PRIVATE ${NINJA_ARCHIVES}) -target_link_libraries(WebEngineCore PUBLIC ${NINJA_LIBS}) +foreach(config ${configs}) + string(TOUPPER ${config} cfg) + set_property(TARGET GnObjects PROPERTY IMPORTED_OBJECTS_${cfg} ${${cfg}_NINJA_OBJECTS}) + set_source_files_properties(${${cfg}_NINJA_OBJECTS} PROPERTIES GENERATED TRUE) + if(LINUX) + target_link_libraries(WebEngineCore + PRIVATE "-Wl,--start-group" "$<$<CONFIG:${config}>:${${cfg}_NINJA_ARCHIVES}>" "-Wl,--end-group") + else() + target_link_libraries(WebEngineCore PRIVATE "$<$<CONFIG:${config}>:${${cfg}_NINJA_ARCHIVES}>") + endif() + target_link_libraries(WebEngineCore PUBLIC "$<$<CONFIG:${config}>:${${cfg}_NINJA_LIBS}>") + # we depend on WebEnigneCore stamp, but ninja backend generator needs more + add_custom_command(OUTPUT ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES} DEPENDS QtWebEngineCore.stamp) + add_custom_target(generate_${cfg} DEPENDS ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES}) +endforeach() -# -# RESOURCES -# +## +# RESOURCES +## #TODO: use simply filter / globbing-expressions set(localeList am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk vi zh-CN zh-TW) +set(resourceList qtwebengine_resources.pak + qtwebengine_resources_100p.pak + qtwebengine_resources_200p.pak + qtwebengine_devtools_resources.pak) + +get_install_config(config) + foreach(loc ${localeList}) - get_filename_component(locSourcePath ${buildDir}/qtwebengine_locales/${loc}.pak ABSOLUTE) - LIST(APPEND localeFiles ${locSourcePath}) + get_filename_component(locSourcePath ${buildDir}/${config}/qtwebengine_locales/${loc}.pak REALPATH) + list(APPEND localeFiles ${locSourcePath}) endforeach() -set(resourceList qtwebengine_resources.pak - qtwebengine_resources_100p.pak - qtwebengine_resources_200p.pak - qtwebengine_devtools_resources.pak) - foreach(res ${resourceList}) - get_filename_component(resSourcePath ${buildDir}/${res} ABSOLUTE) - LIST(APPEND resourceFiles ${resSourcePath}) + get_filename_component(resSourcePath ${buildDir}/${config}/${res} REALPATH) + list(APPEND resourceFiles ${resSourcePath}) endforeach() +get_filename_component(icuFiles ${buildDir}/${config}/icudtl.dat REALPATH) -get_filename_component(icuFiles ${buildDir}/icudtl.dat ABSOLUTE) - -install(FILES ${localeFiles} DESTINATION ${INSTALL_DATADIR}/translations/qtwebengine_locales) -install(FILES ${resourceFiles} DESTINATION ${INSTALL_DATADIR}/resources) -install(FILES ${icuFiles} DESTINATION ${INSTALL_DATADIR}/resources) - +install(FILES ${localeFiles} + DESTINATION translations/qtwebengine_locales + CONFIGURATIONS ${config} +) +install(FILES ${resourceFiles} + DESTINATION resources + CONFIGURATIONS ${config} +) +install(FILES ${icuFiles} + DESTINATION resources + CONFIGURATIONS ${config} +) +# install (again) for superbuild +install(FILES ${localeFiles} + DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/translations/qtwebengine_locales + CONFIGURATIONS ${config} +) +install(FILES ${resourceFiles} + DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/resources + CONFIGURATIONS ${config} +) +install(FILES ${icuFiles} + DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/resources + CONFIGURATIONS ${config} +) diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt index cca5150ee..3ee45af0f 100644 --- a/src/core/api/CMakeLists.txt +++ b/src/core/api/CMakeLists.txt @@ -1,5 +1,5 @@ if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR) - get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE) + get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." REALPATH) endif() find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS Gui Network OpenGL Quick) find_package(Qt6 ${PROJECT_VERSION} QUIET OPTIONAL_COMPONENTS PrintSupport WebChannel) diff --git a/src/core/generator.cmake b/src/core/generator.cmake deleted file mode 100644 index 160275fc7..000000000 --- a/src/core/generator.cmake +++ /dev/null @@ -1,271 +0,0 @@ -set(GN_DEFINES QT_NO_KEYWORDS - QT_USE_QSTRINGBUILDER - QTWEBENGINECORE_VERSION_STR=\\\"${QT_REPO_MODULE_VERSION}\\\" - QTWEBENGINEPROCESS_NAME=\\\"${qtWebEngineProcessName}\\\" - BUILDING_CHROMIUM) - -set(GN_SOURCES_IN - accessibility_activation_observer.cpp - accessibility_tree_formatter_qt.cpp - authentication_dialog_controller.cpp - browser_accessibility_manager_qt.cpp - browser_accessibility_qt.cpp - browsing_data_remover_delegate_qt.cpp - browser_main_parts_qt.cpp - browser_message_filter_qt.cpp - certificate_error_controller.cpp - chromium_overrides.cpp - client_cert_select_controller.cpp - clipboard_qt.cpp - color_chooser_qt.cpp - color_chooser_controller.cpp - common/qt_ipc_logging.cpp - common/qt_messages.cpp - compositor/compositor.cpp - compositor/content_gpu_client_qt.cpp - compositor/display_overrides.cpp - compositor/display_software_output_surface.cpp - content_client_qt.cpp - content_browser_client_qt.cpp - content_main_delegate_qt.cpp - content_utility_client_qt.cpp - delegated_frame_host_client_qt.cpp - desktop_screen_qt.cpp - devtools_frontend_qt.cpp - devtools_manager_delegate_qt.cpp - download_manager_delegate_qt.cpp - favicon_manager.cpp - file_picker_controller.cpp - find_text_helper.cpp - javascript_dialog_controller.cpp - javascript_dialog_manager_qt.cpp - login_delegate_qt.cpp - media_capture_devices_dispatcher.cpp - native_web_keyboard_event_qt.cpp - net/client_cert_override.cpp - net/client_cert_store_data.cpp - net/cookie_monster_delegate_qt.cpp - net/custom_url_loader_factory.cpp - net/proxy_config_monitor.cpp - net/proxy_config_service_qt.cpp - net/proxying_url_loader_factory_qt.cpp - net/proxying_restricted_cookie_manager_qt.cpp - net/qrc_url_scheme_handler.cpp - net/ssl_host_state_delegate_qt.cpp - net/system_network_context_manager.cpp - net/url_request_custom_job_delegate.cpp - net/url_request_custom_job_proxy.cpp - net/webui_controller_factory_qt.cpp - ozone/gl_context_qt.cpp - ozone/gl_share_context_qt.cpp - ozone/gl_ozone_egl_qt.cpp - ozone/gl_surface_qt.cpp - ozone/gl_surface_egl_qt.cpp - ozone/gl_surface_wgl_qt.cpp - ozone/platform_window_qt.cpp - ozone/surface_factory_qt.cpp - permission_manager_qt.cpp - platform_notification_service_qt.cpp - process_main.cpp - profile_adapter.cpp - profile_adapter_client.cpp - profile_qt.cpp - profile_io_data_qt.cpp - quota_permission_context_qt.cpp - quota_request_controller_impl.cpp - pref_service_adapter.cpp - register_protocol_handler_request_controller_impl.cpp - render_view_context_menu_qt.cpp - render_widget_host_view_qt.cpp - render_widget_host_view_qt_delegate_client.cpp - renderer/content_renderer_client_qt.cpp - renderer/content_settings_observer_qt.cpp - renderer/render_frame_observer_qt.cpp - renderer/web_engine_page_render_frame.cpp - renderer/render_configuration.cpp - renderer/user_resource_controller.cpp - renderer/plugins/plugin_placeholder_qt.cpp - renderer_host/web_engine_page_host.cpp - renderer_host/user_resource_controller_host.cpp - resource_bundle_qt.cpp - resource_context_qt.cpp - touch_handle_drawable_qt.cpp - touch_selection_controller_client_qt.cpp - touch_selection_menu_controller.cpp - type_conversion.cpp - user_notification_controller.cpp - user_script.cpp - visited_links_manager_qt.cpp - web_contents_adapter.cpp - web_contents_delegate_qt.cpp - web_contents_view_qt.cpp - web_engine_context.cpp - web_engine_context_threads.cpp - web_engine_error.cpp - web_engine_library_info.cpp - web_engine_settings.cpp - web_event_factory.cpp - ozone/gl_surface_glx_qt.cpp - ozone/gl_ozone_glx_qt.cpp - compositor/compositor_resource_fence.cpp - compositor/display_gl_output_surface.cpp) - -set(GN_HEADERS_IN - accessibility_activation_observer.h - authentication_dialog_controller_p.h - authentication_dialog_controller.h - build_config_qt.h - browser_accessibility_manager_qt.h - browser_accessibility_qt.h - browsing_data_remover_delegate_qt.h - browser_main_parts_qt.h - browser_message_filter_qt.h - certificate_error_controller.h - client_cert_select_controller.h - clipboard_change_observer.h - clipboard_qt.h - color_chooser_qt.h - color_chooser_controller_p.h - color_chooser_controller.h - common/qt_messages.h - compositor/compositor.h - compositor/content_gpu_client_qt.h - compositor/display_software_output_surface.h - content_client_qt.h - content_browser_client_qt.h - content_main_delegate_qt.h - content_utility_client_qt.h - delegated_frame_host_client_qt.h - desktop_screen_qt.h - devtools_frontend_qt.h - devtools_manager_delegate_qt.h - download_manager_delegate_qt.h - favicon_manager.h - file_picker_controller.h - find_text_helper.h - global_descriptors_qt.h - javascript_dialog_controller_p.h - javascript_dialog_controller.h - javascript_dialog_manager_qt.h - login_delegate_qt.h - media_capture_devices_dispatcher.h - net/client_cert_override.h - net/client_cert_store_data.h - net/cookie_monster_delegate_qt.h - net/custom_url_loader_factory.h - net/proxying_url_loader_factory_qt.h - net/proxying_restricted_cookie_manager_qt.h - net/qrc_url_scheme_handler.h - net/ssl_host_state_delegate_qt.h - net/system_network_context_manager.h - net/url_request_custom_job_delegate.h - net/url_request_custom_job_proxy.h - net/webui_controller_factory_qt.h - ozone/gl_context_qt.h - ozone/gl_share_context_qt.h - ozone/gl_ozone_egl_qt.h - ozone/gl_surface_qt.h - ozone/gl_surface_egl_qt.h - ozone/gl_surface_wgl_qt.h - ozone/platform_window_qt.h - ozone/surface_factory_qt.h - permission_manager_qt.h - platform_notification_service_qt.h - pref_service_adapter.h - process_main.h - profile_adapter.h - profile_adapter_client.h - profile_qt.h - profile_io_data_qt.h - proxy_config_monitor.h - proxy_config_service_qt.h - quota_permission_context_qt.h - quota_request_controller.h - quota_request_controller_impl.h - register_protocol_handler_request_controller.h - register_protocol_handler_request_controller_impl.h - render_view_context_menu_qt.h - render_widget_host_view_qt.h - render_widget_host_view_qt_delegate.h - render_widget_host_view_qt_delegate_client.h - renderer/content_renderer_client_qt.h - renderer/content_settings_observer_qt.h - renderer/render_frame_observer_qt.h - renderer/web_engine_page_render_frame.h - renderer/render_configuration.h - renderer/user_resource_controller.h - renderer/plugins/plugin_placeholder_qt.h - renderer_host/web_engine_page_host.h - renderer_host/user_resource_controller_host.h - request_controller.h - resource_context_qt.h - touch_handle_drawable_client.h - touch_handle_drawable_qt.h - touch_selection_controller_client_qt.h - touch_selection_menu_controller.h - type_conversion.h - user_notification_controller.h - user_script.h - visited_links_manager_qt.h - web_contents_adapter.h - web_contents_adapter_client.h - web_contents_delegate_qt.h - web_contents_view_qt.h - web_engine_context.h - web_engine_error.h - web_engine_library_info.h - web_engine_settings.h - web_event_factory.h - ozone/gl_ozone_glx_qt.h - ozone/gl_surface_glx_qt.h - compositor/compositor_resource_fence.h - compositor/display_gl_output_surface.h) - -foreach(GN_HEADER_FILE ${GN_HEADERS_IN}) - get_filename_component(GN_HEADER_PATH ${GN_HEADER_FILE} ABSOLUTE) - list(APPEND GN_HEADERS \"${GN_HEADER_PATH}\") -endforeach() -string(REPLACE ";" ",\n " GN_HEADERS "${GN_HEADERS}") -foreach(GN_SOURCE_FILE ${GN_SOURCES_IN}) - get_filename_component(GN_SOURCE_PATH ${GN_SOURCE_FILE} ABSOLUTE) - list(APPEND GN_SOURCES \"${GN_SOURCE_PATH}\") -endforeach() -string(REPLACE ";" ",\n " GN_SOURCES "${GN_SOURCES}") -include(${CMAKE_WEBENGINE_ROOT_BUILD_PATH}/src/core/api/gn_config.cxx.cmake) -include(${CMAKE_WEBENGINE_ROOT_BUILD_PATH}/src/core/api/gn_config.c.cmake) -list(APPEND GN_DEFINES_IN ${GN_DEFINES}) -list(REMOVE_DUPLICATES GN_DEFINES_IN) -unset(GN_DEFINES) -foreach(GN_DEFINE ${GN_DEFINES_IN}) - list(APPEND GN_ARGS_DEFINES \"-D${GN_DEFINE}\") - list(APPEND GN_DEFINES \"${GN_DEFINE}\") -endforeach() -string(REPLACE ";" ",\n " GN_ARGS_DEFINES "${GN_ARGS_DEFINES}") -string(REPLACE ";" ",\n " GN_DEFINES "${GN_DEFINES}") -# we had no qtsync on headers during configure, so take current interface from expression generator -get_target_property(moduleIncludes WebEngineCore INCLUDE_DIRECTORIES) -foreach(moduleInclude ${moduleIncludes}) - if (moduleInclude MATCHES "\\$<BUILD_INTERFACE:([^,>]+)>") - list(APPEND GN_INCLUDES_IN ${CMAKE_MATCH_1}) - endif() -endforeach() -list(REMOVE_DUPLICATES GN_INCLUDES_IN) -foreach(GN_INCLUDE ${GN_INCLUDES_IN}) - list(APPEND GN_ARGS_INCLUDES \"-I${GN_INCLUDE}\") - list(APPEND GN_INCLUDE_DIRS \"${GN_INCLUDE}\") -endforeach() -string(REPLACE ";" ",\n " GN_ARGS_INCLUDES "${GN_ARGS_INCLUDES}") -string(REPLACE ";" ",\n " GN_INCLUDE_DIRS "${GN_INCLUDE_DIRS}") -get_target_property(GN_MOC_BIN_IN Qt6::moc IMPORTED_LOCATION) -set(GN_ARGS_MOC_BIN \"${GN_MOC_BIN_IN}\") -foreach(GN_CXX_COMPILE_OPTION ${GN_CXX_COMPILE_OPTIONS_IN}) - list(APPEND GN_CFLAGS_CC \"${GN_CXX_COMPILE_OPTION}\") -endforeach() -list(REMOVE_DUPLICATES GN_CFLAGS_CC) -string(REPLACE ";" ",\n " GN_CFLAGS_CC "${GN_CFLAGS_CC}") -foreach(GN_C_COMPILE_OPTION ${GN_C_COMPILE_OPTIONS_IN}) - list(APPEND GN_CFLAGS_C \"${GN_C_COMPILE_OPTION}\") -endforeach() -list(REMOVE_DUPLICATES GN_CFLAGS_C) -string(REPLACE ";" ",\n " GN_CFLAGS_C "${GN_CFLAGS_C}") - diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt index d26ce2a62..bad9ffb08 100644 --- a/src/gn/CMakeLists.txt +++ b/src/gn/CMakeLists.txt @@ -8,8 +8,8 @@ project(Gn ) set(GN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/gn) -set(GN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gn) -set(GN_EXECUTABLE ${GN_BINARY_DIR}/gn) +set(GN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(GN_EXECUTABLE gn) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake") find_package(Python2 REQUIRED) @@ -21,16 +21,17 @@ add_custom_command( WORKING_DIRECTORY ${GN_BINARY_DIR} COMMAND ${Python2_EXECUTABLE} ${GN_SOURCE_DIR}/build/gen.py --no-last-commit-position - --out-path . + --out-path ${GN_BINARY_DIR}/$<CONFIG> --cc ${CMAKE_C_COMPILER} --cxx ${CMAKE_CXX_COMPILER} --ld ${CMAKE_CXX_COMPILER} - COMMAND Ninja::ninja gn + COMMAND Ninja::ninja -C ${GN_BINARY_DIR}/$<CONFIG> ${GN_EXECUTABLE} VERBATIM USES_TERMINAL COMMAND_EXPAND_LISTS ) -add_custom_target(gn ALL DEPENDS ${GN_EXECUTABLE}) -install(FILES ${GN_EXECUTABLE} +add_custom_target(Gn ALL DEPENDS ${GN_EXECUTABLE}) +install(FILES ${GN_BINARY_DIR}/$<CONFIG>/${GN_EXECUTABLE} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - DESTINATION bin) + DESTINATION bin +) diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt index a59901432..742fecf0c 100644 --- a/src/process/CMakeLists.txt +++ b/src/process/CMakeLists.txt @@ -1,3 +1,8 @@ +if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR) + get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH) +endif() +include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake) + find_package(Qt6 COMPONENTS Gui) get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME) @@ -14,7 +19,11 @@ target_link_libraries(${qtWebEngineProcessName} ) target_include_directories(${qtWebEngineProcessName} PRIVATE ../core) +get_install_config(config) -install(TARGETS ${qtWebEngineProcessName} RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}") +install(TARGETS ${qtWebEngineProcessName} + RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}" + CONFIGURATIONS ${config} +) make_install_only(${qtWebEngineProcessName}) diff --git a/tests/auto/httpserver/httpserver.cmake b/tests/auto/httpserver/httpserver.cmake index 78d13055c..e10c52b76 100644 --- a/tests/auto/httpserver/httpserver.cmake +++ b/tests/auto/httpserver/httpserver.cmake @@ -28,8 +28,9 @@ if (NOT TARGET Test::HttpServer) Qt::Network ) + get_filename_component(SERVER_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH) target_compile_definitions(httpserver PRIVATE - SERVER_SOURCE_DIR="${CMAKE_CURRENT_LIST_DIR}" + SERVER_SOURCE_DIR="${SERVER_SOURCE_DIR}" ) set_target_properties(httpserver PROPERTIES diff --git a/tests/auto/widgets/proxypac/CMakeLists.txt b/tests/auto/widgets/proxypac/CMakeLists.txt index 25d754cf7..6a20bc95a 100644 --- a/tests/auto/widgets/proxypac/CMakeLists.txt +++ b/tests/auto/widgets/proxypac/CMakeLists.txt @@ -9,7 +9,8 @@ qt_internal_add_test(tst_proxypac_file ) if(WIN32) - set(fileEnvArg "--proxy-pac-url=\"file:///${CMAKE_CURRENT_LIST_DIR}/proxy.pac\"") + get_filename_component(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH) + set(fileEnvArg "--proxy-pac-url=\"file:///${SOURCE_DIR}/proxy.pac\"") elseif(boot2qt) set(fileEnvArg "--single-process --no-sandbox --proxy-pac-url=\"file://${CMAKE_CURRENT_LIST_DIR}/proxy.pac\"") else() |