diff --git a/Ladybird/CMakeLists.txt b/Ladybird/CMakeLists.txt index cd145cbcbff..bc58b994b03 100644 --- a/Ladybird/CMakeLists.txt +++ b/Ladybird/CMakeLists.txt @@ -96,9 +96,9 @@ add_custom_target(debug qt_finalize_executable(ladybird) +add_subdirectory(WebContent) +add_dependencies(ladybird WebContent) + if(NOT CMAKE_SKIP_INSTALL_RULES) include(cmake/InstallRules.cmake) endif() - -add_subdirectory(WebContent) -add_dependencies(ladybird WebContent) diff --git a/Ladybird/WebContent/CMakeLists.txt b/Ladybird/WebContent/CMakeLists.txt index 5d4d995d95c..1b174ebbe63 100644 --- a/Ladybird/WebContent/CMakeLists.txt +++ b/Ladybird/WebContent/CMakeLists.txt @@ -1,10 +1,10 @@ set(WEBCONTENT_SOURCE_DIR ${SERENITY_SOURCE_DIR}/Userland/Services/WebContent/) set(WEBCONTENT_SOURCES - ${WEBCONTENT_SOURCE_DIR}/ConnectionFromClient.cpp - ${WEBCONTENT_SOURCE_DIR}/ConsoleGlobalObject.cpp - ${WEBCONTENT_SOURCE_DIR}/PageHost.cpp - ${WEBCONTENT_SOURCE_DIR}/WebContentConsoleClient.cpp + ${WEBCONTENT_SOURCE_DIR}/ConnectionFromClient.cpp + ${WEBCONTENT_SOURCE_DIR}/ConsoleGlobalObject.cpp + ${WEBCONTENT_SOURCE_DIR}/PageHost.cpp + ${WEBCONTENT_SOURCE_DIR}/WebContentConsoleClient.cpp ../EventLoopPluginQt.cpp ../FontPluginQt.cpp ../ImageCodecPluginLadybird.cpp @@ -14,7 +14,7 @@ set(WEBCONTENT_SOURCES ../WebSocketClientManagerLadybird.cpp ../WebSocketLadybird.cpp main.cpp -) +) qt_add_executable(WebContent ${WEBCONTENT_SOURCES}) diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index 911348b3b16..2623693cfa6 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -38,10 +38,10 @@ ErrorOr serenity_main(Main::Arguments arguments) // FIXME: Refactor things so we can get rid of this somehow. Core::EventLoop event_loop; - platform_init(); - QGuiApplication app(arguments.argc, arguments.argv); + platform_init(); + Web::Platform::EventLoopPlugin::install(*new Ladybird::EventLoopPluginQt); Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPluginLadybird); diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index c3b82d33a48..071c4f72297 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -570,6 +570,8 @@ void WebContentView::create_client() MUST(Core::System::setenv("FD_PASSING_SOCKET"sv, fd_passing_socket_string, true)); auto rc = execlp("./WebContent/WebContent", "WebContent", nullptr); + if (rc < 0) + rc = execlp((QCoreApplication::applicationDirPath() + "/WebContent").toStdString().c_str(), "WebContent", nullptr); if (rc < 0) perror("execlp"); VERIFY_NOT_REACHED(); diff --git a/Ladybird/cmake/InstallRules.cmake b/Ladybird/cmake/InstallRules.cmake index d2a5932c29a..592d2f52247 100644 --- a/Ladybird/cmake/InstallRules.cmake +++ b/Ladybird/cmake/InstallRules.cmake @@ -18,10 +18,23 @@ install(TARGETS ladybird DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +install(TARGETS WebContent + EXPORT ladybirdTargets + RUNTIME + COMPONENT ladybird_Runtime + DESTINATION ${CMAKE_INSTALL_BINDIR} + BUNDLE + COMPONENT ladybird_Runtime + DESTINATION bundle +) + include("${Lagom_SOURCE_DIR}/get_linked_lagom_libraries.cmake") get_linked_lagom_libraries(ladybird ladybird_lagom_libraries) +get_linked_lagom_libraries(WebContent webcontent_lagom_libraries) +list(APPEND all_required_lagom_libraries ${ladybird_lagom_libraries} ${webcontent_lagom_libraries}) +list(REMOVE_DUPLICATES all_required_lagom_libraries) -install(TARGETS ${ladybird_lagom_libraries} +install(TARGETS ${all_required_lagom_libraries} EXPORT ladybirdTargets COMPONENT ladybird_Runtime LIBRARY diff --git a/Ladybird/main.cpp b/Ladybird/main.cpp index df5241edb00..e61cbb52158 100644 --- a/Ladybird/main.cpp +++ b/Ladybird/main.cpp @@ -17,18 +17,18 @@ Browser::Settings* s_settings; ErrorOr serenity_main(Main::Arguments arguments) { - platform_init(); - - // NOTE: We only instantiate this to ensure that Gfx::FontDatabase has its default queries initialized. - Gfx::FontDatabase::set_default_font_query("Katica 10 400 0"); - Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0"); - // NOTE: This is only used for the Core::Socket inside the IPC connections. // FIXME: Refactor things so we can get rid of this somehow. Core::EventLoop event_loop; QApplication app(arguments.argc, arguments.argv); + platform_init(); + + // NOTE: We only instantiate this to ensure that Gfx::FontDatabase has its default queries initialized. + Gfx::FontDatabase::set_default_font_query("Katica 10 400 0"); + Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0"); + String url; Core::ArgsParser args_parser; args_parser.set_general_help("The Ladybird web browser :^)");