[CMAKE] Allow overriding the .dll extension for delay imports in MSVC builds.

Fixes delay-importing winspool.drv.
This commit is contained in:
Thomas Faber 2017-12-31 13:08:39 +01:00
parent 2b4d5c5cff
commit b20280a0f9
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
4 changed files with 11 additions and 5 deletions

View file

@ -41,7 +41,7 @@ add_library(setupapi SHARED
set_module_type(setupapi win32dll UNICODE)
target_link_libraries(setupapi uuid wine ${PSEH_LIB})
add_delay_importlibs(setupapi comdlg32 shell32 winspool wintrust)
add_delay_importlibs(setupapi comdlg32 shell32 winspool.drv wintrust)
add_importlibs(setupapi gdi32 comctl32 advapi32 user32 rpcrt4 version msvcrt kernel32 ntdll)
add_pch(setupapi setupapi_private.h SOURCE)
add_cd_file(TARGET setupapi DESTINATION reactos/system32 FOR all)

View file

@ -107,7 +107,7 @@ set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT
set_module_type(shell32 win32dll UNICODE)
target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin)
add_delay_importlibs(shell32 powrprof shdocvw devmgr winspool winmm mpr uxtheme ole32 oleaut32 userenv browseui version fmifs)
add_delay_importlibs(shell32 powrprof shdocvw devmgr winspool.drv winmm mpr uxtheme ole32 oleaut32 userenv browseui version fmifs)
add_importlibs(shell32 advapi32 gdi32 user32 comctl32 comdlg32 shlwapi msvcrt kernel32 ntdll)
add_dependencies(shell32 stdole2) # shell32_shldisp.tlb needs stdole2.tlb
add_pch(shell32 precomp.h SOURCE)

View file

@ -326,7 +326,8 @@ function(add_delay_importlibs _module)
message(FATAL_ERROR "Cannot add delay imports to a static library")
endif()
foreach(_lib ${ARGN})
target_link_libraries(${_module} lib${_lib}_delayed)
get_filename_component(_basename "${_lib}" NAME_WE)
target_link_libraries(${_module} lib${_basename}_delayed)
endforeach()
target_link_libraries(${_module} delayimp)
endfunction()

View file

@ -336,8 +336,13 @@ function(add_delay_importlibs _module)
message(FATAL_ERROR "Cannot add delay imports to a static library")
endif()
foreach(_lib ${ARGN})
add_target_link_flags(${_module} "/DELAYLOAD:${_lib}.dll")
target_link_libraries(${_module} lib${_lib})
get_filename_component(_basename "${_lib}" NAME_WE)
get_filename_component(_ext "${_lib}" EXT)
if(NOT _ext)
set(_ext ".dll")
endif()
add_target_link_flags(${_module} "/DELAYLOAD:${_basename}${_ext}")
target_link_libraries(${_module} "lib${_basename}")
endforeach()
target_link_libraries(${_module} delayimp)
endfunction()