summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GetPrerequisites.cmake16
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake22
2 files changed, 30 insertions, 8 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 72775ce..1b23800 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -654,6 +654,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(NOT EXISTS "${target}")
message("warning: target '${target}' does not exist...")
+ set(${prerequisites_var} "" PARENT_SCOPE)
+ return()
endif()
set(gp_cmd_paths ${gp_cmd_paths}
@@ -810,6 +812,20 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
OUTPUT_VARIABLE gp_cmd_ov
ERROR_VARIABLE gp_ev
)
+
+ if(gp_tool STREQUAL "dumpbin")
+ # Exclude delay load dependencies under windows (they are listed in dumpbin output after the message below)
+ string(FIND "${gp_cmd_ov}" "Image has the following delay load dependencies" gp_delayload_pos)
+ if (${gp_delayload_pos} GREATER -1)
+ string(SUBSTRING "${gp_cmd_ov}" 0 ${gp_delayload_pos} gp_cmd_ov_no_delayload_deps)
+ string(SUBSTRING "${gp_cmd_ov}" ${gp_delayload_pos} -1 gp_cmd_ov_delayload_deps)
+ if (verbose)
+ message(STATUS "GetPrequisites(${target}) : ignoring the following delay load dependencies :\n ${gp_cmd_ov_delayload_deps}")
+ endif()
+ set(gp_cmd_ov ${gp_cmd_ov_no_delayload_deps})
+ endif()
+ endif()
+
if(NOT gp_rv STREQUAL "0")
if(gp_tool STREQUAL "dumpbin")
# dumpbin error messages seem to go to stdout
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index f4ae091..7975bd4 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -210,21 +210,27 @@ if(MSVC)
endif()
if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT v VERSION_LESS 14)
- # Find the Windows Universal CRT redistribution directory.
+ # Find the Windows Kits directory.
get_filename_component(windows_kits_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
- find_path(WINDOWS_KITS_REDIST_DIR NAMES ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
+ find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
PATHS
- "${windows_kits_dir}/Redist"
- "$ENV{ProgramFiles}/Windows Kits/10/Redist"
- "$ENV{${programfilesx86}}/Windows Kits/10/Redist"
+ "${windows_kits_dir}"
+ "$ENV{ProgramFiles}/Windows Kits/10"
+ "$ENV{${programfilesx86}}/Windows Kits/10"
)
- mark_as_advanced(WINDOWS_KITS_REDIST_DIR)
+ mark_as_advanced(WINDOWS_KITS_DIR)
# Glob the list of UCRT DLLs.
- file(GLOB __ucrt_dlls "${WINDOWS_KITS_REDIST_DIR}/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
- list(APPEND __install__libs ${__ucrt_dlls})
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
+ list(APPEND __install__libs ${__ucrt_dlls})
+ endif()
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
+ list(APPEND __install__libs ${__ucrt_dlls})
+ endif()
endif()
endmacro()