mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
UI: Migrate headless-browser to be alongside other Ladybird chromes
The headless-browser source is getting a bit unwieldy. The ordering of class and method definitions is fragile; e.g. the application and web view classes each require full definitions of each other. So it has reached the point where it makes sense to give headless-browser some better file structure. To prepare for that, this patch simply moves its source to live along- side the other browser chromes. This location is a bit better prepared for creating more files, as the Utilities folder doesn't even have its own CMakeLists.txt.
This commit is contained in:
parent
23d134708c
commit
79365c9519
Notes:
github-actions[bot]
2024-10-11 09:00:46 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/79365c9519d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1717
3 changed files with 20 additions and 17 deletions
|
@ -90,7 +90,8 @@ else()
|
||||||
set(LADYBIRD_TARGET ladybird PRIVATE)
|
set(LADYBIRD_TARGET ladybird PRIVATE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${LADYBIRD_TARGET} AK LibCore LibFileSystem LibGfx LibImageDecoderClient LibIPC LibJS LibMain LibWeb LibWebView LibRequests LibURL)
|
set(LADYBIRD_LIBS AK LibCore LibFileSystem LibGfx LibImageDecoderClient LibIPC LibJS LibMain LibWeb LibWebView LibRequests LibURL)
|
||||||
|
target_link_libraries(${LADYBIRD_TARGET} PRIVATE ${LADYBIRD_LIBS})
|
||||||
|
|
||||||
target_include_directories(${LADYBIRD_TARGET} ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(${LADYBIRD_TARGET} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_include_directories(${LADYBIRD_TARGET} ${LADYBIRD_SOURCE_DIR}/Userland/)
|
target_include_directories(${LADYBIRD_TARGET} ${LADYBIRD_SOURCE_DIR}/Userland/)
|
||||||
|
@ -112,14 +113,6 @@ function(set_helper_process_properties)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
add_executable(headless-browser
|
|
||||||
${LADYBIRD_SOURCE_DIR}/Userland/Utilities/headless-browser.cpp
|
|
||||||
${LADYBIRD_SOURCES})
|
|
||||||
|
|
||||||
target_include_directories(headless-browser PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
target_include_directories(headless-browser PRIVATE ${LADYBIRD_SOURCE_DIR}/Userland/)
|
|
||||||
target_link_libraries(headless-browser PRIVATE AK LibCore LibWeb LibWebView LibWebSocket LibCrypto LibFileSystem LibHTTP LibImageDecoderClient LibJS LibGfx LibMain LibTLS LibIPC LibDiff LibRequests LibURL)
|
|
||||||
|
|
||||||
add_custom_target(run
|
add_custom_target(run
|
||||||
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" "$<TARGET_FILE:ladybird>" $ENV{LAGOM_ARGS}
|
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" "$<TARGET_FILE:ladybird>" $ENV{LAGOM_ARGS}
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
|
@ -138,6 +131,7 @@ else()
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(Headless)
|
||||||
add_subdirectory(ImageDecoder)
|
add_subdirectory(ImageDecoder)
|
||||||
add_subdirectory(RequestServer)
|
add_subdirectory(RequestServer)
|
||||||
add_subdirectory(WebContent)
|
add_subdirectory(WebContent)
|
||||||
|
@ -158,10 +152,3 @@ endif()
|
||||||
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
||||||
include(cmake/InstallRules.cmake)
|
include(cmake/InstallRules.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_TESTING)
|
|
||||||
add_test(
|
|
||||||
NAME LibWeb
|
|
||||||
COMMAND $<TARGET_FILE:headless-browser> --run-tests ${LADYBIRD_SOURCE_DIR}/Tests/LibWeb --dump-failed-ref-tests --force-fontconfig
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
16
Ladybird/Headless/CMakeLists.txt
Normal file
16
Ladybird/Headless/CMakeLists.txt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
set(SOURCES
|
||||||
|
${LADYBIRD_SOURCES}
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(headless-browser ${SOURCES})
|
||||||
|
target_include_directories(headless-browser PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
target_include_directories(headless-browser PRIVATE ${LADYBIRD_SOURCE_DIR}/Userland/)
|
||||||
|
target_link_libraries(headless-browser PRIVATE ${LADYBIRD_LIBS} LibDiff)
|
||||||
|
|
||||||
|
if (BUILD_TESTING)
|
||||||
|
add_test(
|
||||||
|
NAME LibWeb
|
||||||
|
COMMAND $<TARGET_FILE:headless-browser> --run-tests ${LADYBIRD_SOURCE_DIR}/Tests/LibWeb --dump-failed-ref-tests --force-fontconfig
|
||||||
|
)
|
||||||
|
endif()
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
|
* Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
|
||||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
* Copyright (c) 2023-2024, Tim Flynn <trflynn89@ladybird.org>
|
||||||
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
||||||
* Copyright (c) 2023-2024, Sam Atkins <sam@ladybird.org>
|
* Copyright (c) 2023-2024, Sam Atkins <sam@ladybird.org>
|
||||||
*
|
*
|
Loading…
Reference in a new issue