Skip to content

Commit 2484d58

Browse files
authored
[vcpkg] Disable vcpkg_copy_tool_dependencies on non-Windows (#14366)
1 parent 0bf3923 commit 2484d58

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

scripts/cmake/vcpkg_copy_tool_dependencies.cmake

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,25 @@
1717
## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake)
1818
## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake)
1919
function(vcpkg_copy_tool_dependencies TOOL_DIR)
20-
find_program(PWSH_EXE pwsh)
21-
if (NOT PWSH_EXE)
22-
message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.")
20+
if (VCPKG_TARGET_IS_WINDOWS)
21+
find_program(PWSH_EXE pwsh)
22+
if (NOT PWSH_EXE)
23+
message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.")
24+
endif()
25+
macro(search_for_dependencies PATH_TO_SEARCH)
26+
file(GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll")
27+
foreach(TOOL IN LISTS TOOLS)
28+
vcpkg_execute_required_process(
29+
COMMAND "${PWSH_EXE}" -noprofile -executionpolicy Bypass -nologo
30+
-file "${SCRIPTS}/buildsystems/msbuild/applocal.ps1"
31+
-targetBinary "${TOOL}"
32+
-installedDir "${PATH_TO_SEARCH}"
33+
WORKING_DIRECTORY "${VCPKG_ROOT_DIR}"
34+
LOGNAME copy-tool-dependencies
35+
)
36+
endforeach()
37+
endmacro()
38+
search_for_dependencies("${CURRENT_PACKAGES_DIR}/bin")
39+
search_for_dependencies("${CURRENT_INSTALLED_DIR}/bin")
2340
endif()
24-
macro(search_for_dependencies PATH_TO_SEARCH)
25-
file(GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll")
26-
foreach(TOOL IN LISTS TOOLS)
27-
vcpkg_execute_required_process(
28-
COMMAND "${PWSH_EXE}" -noprofile -executionpolicy Bypass -nologo
29-
-file "${SCRIPTS}/buildsystems/msbuild/applocal.ps1"
30-
-targetBinary "${TOOL}"
31-
-installedDir "${PATH_TO_SEARCH}"
32-
WORKING_DIRECTORY "${VCPKG_ROOT_DIR}"
33-
LOGNAME copy-tool-dependencies
34-
)
35-
endforeach()
36-
endmacro()
37-
search_for_dependencies("${CURRENT_PACKAGES_DIR}/bin")
38-
search_for_dependencies("${CURRENT_INSTALLED_DIR}/bin")
3941
endfunction()

0 commit comments

Comments
 (0)