File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed
Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,18 @@ function(lagom_generate_export_header name fs_name)
1818 generate_export_header(${name} EXPORT_MACRO_NAME ${fs_name_upper} _API EXPORT_FILE_NAME "Export.h" )
1919endfunction ()
2020
21+ function (lagom_copy_runtime_dlls target_name)
22+ if (WIN32 AND BUILD_SHARED_LIBS )
23+ add_custom_command (TARGET ${target_name} POST_BUILD
24+ COMMAND ${CMAKE_COMMAND}
25+ -E copy_if_different
26+ $<TARGET_RUNTIME_DLLS:${target_name} >
27+ $<TARGET_FILE_DIR:${target_name} >
28+ COMMAND_EXPAND_LISTS
29+ )
30+ endif ()
31+ endfunction ()
32+
2133function (lagom_lib target_name fs_name)
2234 cmake_parse_arguments (LAGOM_LIBRARY "EXPLICIT_SYMBOL_EXPORT" "LIBRARY_TYPE" "SOURCES;LIBS" ${ARGN} )
2335 string (REPLACE "Lib" "" library ${target_name} )
@@ -80,6 +92,7 @@ function(lagom_test source)
8092 endif ()
8193 add_executable (${LAGOM_TEST_NAME} ${source} )
8294 target_link_libraries (${LAGOM_TEST_NAME} PRIVATE AK LibCore LibFileSystem LibTest ${LAGOM_TEST_CUSTOM_MAIN} ${LAGOM_TEST_LIBS} )
95+ lagom_copy_runtime_dlls(${LAGOM_TEST_NAME} )
8396
8497 if (WIN32 )
8598 target_include_directories (${LAGOM_TEST_NAME} PRIVATE ${PTHREAD_INCLUDE_DIR} )
@@ -117,6 +130,7 @@ function(ladybird_bin name)
117130 add_executable (${name} ${SOURCES} ${GENERATED_SOURCES} )
118131 add_executable (Lagom::${name} ALIAS ${name} )
119132 target_link_libraries (${name} PUBLIC GenericClangPlugin)
133+ lagom_copy_runtime_dlls(${name} )
120134 install (
121135 TARGETS ${target_name}
122136 EXPORT LagomTargets
Original file line number Diff line number Diff line change @@ -9,20 +9,14 @@ set(SOURCES
99add_executable (test -web ${SOURCES} )
1010add_dependencies (test -web ladybird_build_resource_files ImageDecoder RequestServer WebContent WebWorker)
1111target_link_libraries (test -web PRIVATE AK LibCore LibDiff LibFileSystem LibGfx LibImageDecoderClient LibIPC LibJS LibMain LibRequests LibURL LibWeb LibWebView)
12+ lagom_copy_runtime_dlls(test -web)
1213
1314if (APPLE )
1415 target_compile_definitions (test -web PRIVATE LADYBIRD_BINARY_PATH="$<TARGET_FILE_DIR:ladybird>" )
1516elseif (WIN32 )
1617 target_link_libraries (test -web PRIVATE LibDevTools)
1718 find_package (pthread REQUIRED)
1819 target_include_directories (test -web PRIVATE $<BUILD_INTERFACE:${PTHREAD_INCLUDE_DIR} >)
19- add_custom_command (TARGET test -web POST_BUILD
20- COMMAND ${CMAKE_COMMAND}
21- -E copy_if_different
22- $<TARGET_RUNTIME_DLLS:test -web>
23- $<TARGET_FILE_DIR:test -web>
24- COMMAND_EXPAND_LISTS
25- )
2620endif ()
2721
2822# FIXME: Increase support for building targets on Windows
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ target_sources(ladybird PRIVATE
1515 ladybird.qrc
1616)
1717target_link_libraries (ladybird PRIVATE Qt::Core Qt::Gui Qt::Widgets)
18+ lagom_copy_runtime_dlls(ladybird)
1819create_ladybird_bundle(ladybird)
1920
2021if (WIN32 )
@@ -29,10 +30,6 @@ qt_deploy_runtime_dependencies(
2930" )
3031
3132 add_custom_command (TARGET ladybird POST_BUILD
32- COMMAND ${CMAKE_COMMAND}
33- -E copy_if_different
34- $<TARGET_RUNTIME_DLLS:ladybird>
35- $<TARGET_FILE_DIR:ladybird>
3633 COMMAND ${CMAKE_COMMAND}
3734 -P ${ladybird_deploy_script}
3835 COMMAND_EXPAND_LISTS
You can’t perform that action at this time.
0 commit comments