File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,24 @@ function(find_and_copy_dependency_dlls)
88 return ()
99 endif ()
1010
11+ # Copy DLLs from all linked CMake targets (e.g. lazperf.dll built via
12+ # FetchContent). $<TARGET_RUNTIME_DLLS:tgt> lists every SHARED_LIBRARY the
13+ # target transitively depends on. Post-build steps are appended in order, so
14+ # this runs before the gtest_discover_tests step added later in
15+ # CMakeLists.txt.
16+ foreach (target ${ARGN} )
17+ if (TARGET ${target} )
18+ add_custom_command (
19+ TARGET ${target}
20+ POST_BUILD
21+ COMMAND
22+ powershell -NonInteractive -Command
23+ "$dllList = '$<JOIN :$<TARGET_RUNTIME_DLLS :${target} >,|>'; foreach ($dll in $dllList.Split('|')) { if ($dll) { Copy-Item -Path $dll -Destination '$<TARGET_FILE_DIR :${target} >' -Force -ErrorAction SilentlyContinue } }"
24+ COMMENT "Copying target runtime DLLs for ${target} "
25+ VERBATIM )
26+ endif ()
27+ endforeach ()
28+
1129 # For vcpkg builds, copy all DLLs from vcpkg's bin directory
1230 if (BLAZE_USE_VCPKG)
1331 if (DEFINED VCPKG_INSTALLED_DIR)
You can’t perform that action at this time.
0 commit comments