CMake: Add helper to ensure vcpkg DLLs are copied to the output dir

The BUILD_RPATH/INSTALL_RPATH CMake infrastructure is not supported
on Windows, but we want to ensure Ladybird executables are runnable
after the build phase so there can be an efficient dev loop.
lagom_copy_runtime_dlls() can be used by executable targets so all
their dependent dlls are copied to their output directory in their
post build step.
This commit is contained in:
ayeteadoe 2025-08-07 11:08:13 -07:00 committed by Andrew Kaster
parent 3df8e00d91
commit 9ec1643d88
Notes: github-actions[bot] 2025-08-23 22:05:49 +00:00
3 changed files with 16 additions and 11 deletions

View file

@ -15,6 +15,7 @@ target_sources(ladybird PRIVATE
ladybird.qrc
)
target_link_libraries(ladybird PRIVATE Qt::Core Qt::Gui Qt::Widgets)
lagom_copy_runtime_dlls(ladybird)
create_ladybird_bundle(ladybird)
if (WIN32)
@ -29,10 +30,6 @@ qt_deploy_runtime_dependencies(
")
add_custom_command(TARGET ladybird POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy_if_different
$<TARGET_RUNTIME_DLLS:ladybird>
$<TARGET_FILE_DIR:ladybird>
COMMAND ${CMAKE_COMMAND}
-P ${ladybird_deploy_script}
COMMAND_EXPAND_LISTS