diff --git a/dll/win32/advapi32/CMakeLists.txt b/dll/win32/advapi32/CMakeLists.txt index d1833586bb010..3dd877227537f 100644 --- a/dll/win32/advapi32/CMakeLists.txt +++ b/dll/win32/advapi32/CMakeLists.txt @@ -25,8 +25,6 @@ list(APPEND SOURCE misc/shutdown.c misc/sysfunc.c misc/unicode.c - reg/hkcr.c - reg/reg.c sec/ac.c sec/audit.c sec/lsa.c @@ -54,6 +52,15 @@ list(APPEND PCH_SKIP_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/svcctl_c.c ${CMAKE_CURRENT_BINARY_DIR}/winreg_c.c) +# This static library is for kernelbase and vista APIs in kernel32 +add_library(win32_registry + ${PCH_SKIP_SOURCE} + reg/hkcr.c + reg/reg.c +) +target_link_libraries(win32_registry ${PSEH_LIB}) +target_compile_definitions(win32_registry PRIVATE _KERNEL32_ UNICODE _UNICODE) + add_library(advapi32 MODULE ${SOURCE} ${PCH_SKIP_SOURCE} @@ -61,7 +68,7 @@ add_library(advapi32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/advapi32.def) set_module_type(advapi32 win32dll UNICODE ENTRYPOINT DllMain 12) -target_link_libraries(advapi32 cryptlib wine ${PSEH_LIB}) +target_link_libraries(advapi32 win32_registry cryptlib wine ${PSEH_LIB}) if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600) target_link_libraries(advapi32 etwtrace) endif() diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 8fb782283ccbb..217ec8fe80837 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -130,7 +130,7 @@ set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12) set_subsystem(kernel32 console) ################# END HACK ################# -target_link_libraries(kernel32 kernelbase_static kernel32_vista_static kernel32_shared wine chkstk ${PSEH_LIB}) +target_link_libraries(kernel32 win32_registry kernelbase_static kernel32_vista_static kernel32_shared wine chkstk ${PSEH_LIB}) add_importlibs(kernel32 ntdll) add_pch(kernel32 k32.h SOURCE) add_dependencies(kernel32 psdk errcodes asm)