From 887046a6eed049e3dabbf2d0bcdb748c5f9dc559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 1 Nov 2010 17:24:32 +0000 Subject: [PATCH] [CMAKE] - build msvc importlibs explicitly from def file - circumvent lack of pseh lib in MSVC. - fix advapi32.def svn path=/branches/cmake-bringup/; revision=49409 --- base/services/eventlog/CMakeLists.txt | 2 +- base/services/rpcss/CMakeLists.txt | 2 +- base/services/umpnpmgr/CMakeLists.txt | 2 +- base/services/wlansvc/CMakeLists.txt | 2 +- base/setup/vmwinst/CMakeLists.txt | 2 +- base/system/services/CMakeLists.txt | 2 +- dll/directx/quartz/CMakeLists.txt | 2 +- dll/ntdll/CMakeLists.txt | 4 ++-- dll/win32/actxprxy/CMakeLists.txt | 2 +- dll/win32/advapi32/advapi32.def | 8 ++++---- dll/win32/crypt32/CMakeLists.txt | 2 +- dll/win32/dbghelp/CMakeLists.txt | 2 +- dll/win32/gdi32/CMakeLists.txt | 2 +- dll/win32/kernel32/CMakeLists.txt | 4 ++-- dll/win32/lsasrv/CMakeLists.txt | 2 +- dll/win32/msvcrt/CMakeLists.txt | 2 +- dll/win32/ole32/CMakeLists.txt | 2 +- dll/win32/oleaut32/CMakeLists.txt | 2 +- dll/win32/psapi/CMakeLists.txt | 2 +- dll/win32/rpcrt4/CMakeLists.txt | 2 +- dll/win32/setupapi/CMakeLists.txt | 2 +- dll/win32/sti/CMakeLists.txt | 2 +- dll/win32/syssetup/CMakeLists.txt | 2 +- dll/win32/urlmon/CMakeLists.txt | 2 +- dll/win32/user32/CMakeLists.txt | 2 +- dll/win32/wininet/CMakeLists.txt | 2 +- dll/win32/winmm/CMakeLists.txt | 2 +- dll/win32/wintrust/CMakeLists.txt | 2 +- dll/win32/wlanapi/CMakeLists.txt | 2 +- drivers/base/null/CMakeLists.txt | 2 +- .../filesystems/fastfat_new/CMakeLists.txt | 2 +- drivers/input/kbdclass/CMakeLists.txt | 2 +- drivers/input/mouclass/CMakeLists.txt | 2 +- drivers/ksfilter/ks/CMakeLists.txt | 2 +- drivers/network/afd/CMakeLists.txt | 2 +- drivers/network/tcpip/CMakeLists.txt | 2 +- drivers/storage/classpnp/CMakeLists.txt | 2 +- .../wdm/audio/backpln/portcls/CMakeLists.txt | 2 +- .../wdm/audio/legacy/wdmaud/CMakeLists.txt | 2 +- gcc.cmake | 5 ++++- msc.cmake | 19 ++++++++++--------- ntoskrnl/CMakeLists.txt | 2 +- subsystems/win32/csrss/csrsrv/CMakeLists.txt | 2 +- .../win32/csrss/win32csr/CMakeLists.txt | 2 +- subsystems/win32/win32k/CMakeLists.txt | 2 +- 45 files changed, 62 insertions(+), 58 deletions(-) diff --git a/base/services/eventlog/CMakeLists.txt b/base/services/eventlog/CMakeLists.txt index b87033d5b07..211a8ffedc6 100644 --- a/base/services/eventlog/CMakeLists.txt +++ b/base/services/eventlog/CMakeLists.txt @@ -12,7 +12,7 @@ list(APPEND SOURCE add_executable(eventlog ${CMAKE_CURRENT_BINARY_DIR}/eventlog_eventlog.h.gch ${SOURCE}) -target_link_libraries(eventlog eventlogrpc_server pseh) +target_link_libraries(eventlog eventlogrpc_server ${PSEH_LIB}) add_pch(eventlog ${CMAKE_CURRENT_SOURCE_DIR}/eventlog.h ${SOURCE}) diff --git a/base/services/rpcss/CMakeLists.txt b/base/services/rpcss/CMakeLists.txt index 89d1d3f3fa2..b2fee120b3c 100644 --- a/base/services/rpcss/CMakeLists.txt +++ b/base/services/rpcss/CMakeLists.txt @@ -14,7 +14,7 @@ include_directories(${REACTOS_BINARY_DIR}/include/reactos/wine) add_executable(rpcss ${SOURCE}) -target_link_libraries(rpcss epm_server irot_server pseh wine) +target_link_libraries(rpcss epm_server irot_server ${PSEH_LIB} wine) set_module_type(rpcss win32cui) diff --git a/base/services/umpnpmgr/CMakeLists.txt b/base/services/umpnpmgr/CMakeLists.txt index b376f7c907b..c552b0771f6 100644 --- a/base/services/umpnpmgr/CMakeLists.txt +++ b/base/services/umpnpmgr/CMakeLists.txt @@ -6,7 +6,7 @@ add_definitions(-D_WIN32_WINNT=0x600) add_executable(umpnpmgr umpnpmgr.c umpnpmgr.rc) -target_link_libraries(umpnpmgr pnp_server wdmguid pseh) +target_link_libraries(umpnpmgr pnp_server wdmguid ${PSEH_LIB}) set_module_type(umpnpmgr win32cui) add_importlibs(umpnpmgr diff --git a/base/services/wlansvc/CMakeLists.txt b/base/services/wlansvc/CMakeLists.txt index 1ecb38a5159..40b6dcd9e42 100644 --- a/base/services/wlansvc/CMakeLists.txt +++ b/base/services/wlansvc/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(${REACTOS_BINARY_DIR}/include/reactos/idl) add_executable(wlansvc wlansvc.c rpcserver.c) -target_link_libraries(wlansvc wlansvc_server pseh) +target_link_libraries(wlansvc wlansvc_server ${PSEH_LIB}) set_module_type(wlansvc win32cui) add_importlibs(wlansvc diff --git a/base/setup/vmwinst/CMakeLists.txt b/base/setup/vmwinst/CMakeLists.txt index 3eda4610e4c..f6a959a294c 100644 --- a/base/setup/vmwinst/CMakeLists.txt +++ b/base/setup/vmwinst/CMakeLists.txt @@ -3,7 +3,7 @@ set_unicode() add_executable(vmwinst vmwinst.c vmwinst.rc) -target_link_libraries(vmwinst pseh) +target_link_libraries(vmwinst ${PSEH_LIB}) set_module_type(vmwinst win32gui) add_importlibs(vmwinst diff --git a/base/system/services/CMakeLists.txt b/base/system/services/CMakeLists.txt index 74be5ef1a51..3dd46f0775f 100644 --- a/base/system/services/CMakeLists.txt +++ b/base/system/services/CMakeLists.txt @@ -16,7 +16,7 @@ add_executable(services ${CMAKE_CURRENT_BINARY_DIR}/services_services.h.gch ${SO target_link_libraries(services svcctl_server - pseh) + ${PSEH_LIB}) add_pch(services ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${SOURCE}) diff --git a/dll/directx/quartz/CMakeLists.txt b/dll/directx/quartz/CMakeLists.txt index 91f6ef61f78..d0025c7c6ba 100644 --- a/dll/directx/quartz/CMakeLists.txt +++ b/dll/directx/quartz/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries(quartz strmiids uuid wine - pseh) + ${PSEH_LIB}) add_importlibs(quartz msvcrt diff --git a/dll/ntdll/CMakeLists.txt b/dll/ntdll/CMakeLists.txt index 1e86ab80a95..fa36f6a08db 100644 --- a/dll/ntdll/CMakeLists.txt +++ b/dll/ntdll/CMakeLists.txt @@ -48,11 +48,11 @@ endif() target_link_libraries(ntdll ntdllsys libcntpr - pseh) + ${PSEH_LIB}) add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE}) add_dependencies(ntdll ntstatus) add_minicd_target(ntdll reactos/system32 ntdll.dll) add_cab_target(ntdll 1) -add_importlib_target(ntdll) +add_importlib_def(${CMAKE_CURRENT_BINARY_DIR}/ntdll.def) diff --git a/dll/win32/actxprxy/CMakeLists.txt b/dll/win32/actxprxy/CMakeLists.txt index d37a4d90f9d..9c0adc05888 100644 --- a/dll/win32/actxprxy/CMakeLists.txt +++ b/dll/win32/actxprxy/CMakeLists.txt @@ -13,7 +13,7 @@ target_link_libraries(actxprxy actxprxy_proxy uuid wine - pseh) + ${PSEH_LIB}) add_importlibs(actxprxy rpcrt4 diff --git a/dll/win32/advapi32/advapi32.def b/dll/win32/advapi32/advapi32.def index 63d9aad8b99..f1922fbffd8 100644 --- a/dll/win32/advapi32/advapi32.def +++ b/dll/win32/advapi32/advapi32.def @@ -241,7 +241,7 @@ EXPORTS GetEffectiveRightsFromAclA GetEffectiveRightsFromAclW GetEventLogInformation - GetExplicitEntriesFromAclAadvapi32.GetExplicitEntriesFromAclW + GetExplicitEntriesFromAclA=GetExplicitEntriesFromAclW GetExplicitEntriesFromAclW GetFileSecurityA GetFileSecurityW @@ -271,7 +271,7 @@ EXPORTS GetSecurityDescriptorControl GetSecurityDescriptorDacl GetSecurityDescriptorGroup - GetSecurityDescriptorLengthtdll.RtlLengthSecurityDescriptor + GetSecurityDescriptorLengtht=ntdll.RtlLengthSecurityDescriptor GetSecurityDescriptorOwner GetSecurityDescriptorRMControl GetSecurityDescriptorSacl @@ -321,7 +321,7 @@ EXPORTS InitiateSystemShutdownW InstallApplication=__wine_stub_advapi32_dll_318 IsProcessRestricted=__wine_stub_advapi32_dll_319 - IsTextUnicodentdll.RtlIsTextUnicode + IsTextUnicode=ntdll.RtlIsTextUnicode IsTokenRestricted IsTokenUntrusted=__wine_stub_advapi32_dll_322 IsValidAcl @@ -418,7 +418,7 @@ EXPORTS MakeAbsoluteSD MakeAbsoluteSD2 MakeSelfRelativeSD - MapGenericMasktdll.RtlMapGenericMask + MapGenericMask=ntdll.RtlMapGenericMask NotifyBootConfigStatus NotifyChangeEventLog ObjectCloseAuditAlarmA diff --git a/dll/win32/crypt32/CMakeLists.txt b/dll/win32/crypt32/CMakeLists.txt index 09aab3c810c..af588e4e546 100644 --- a/dll/win32/crypt32/CMakeLists.txt +++ b/dll/win32/crypt32/CMakeLists.txt @@ -45,7 +45,7 @@ set_module_type(crypt32 win32dll) target_link_libraries(crypt32 wine - pseh + ${PSEH_LIB} oldnames) add_importlibs(crypt32 user32 advapi32 msvcrt kernel32 ntdll) diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt index bea240c9dcd..a148132d218 100644 --- a/dll/win32/dbghelp/CMakeLists.txt +++ b/dll/win32/dbghelp/CMakeLists.txt @@ -46,7 +46,7 @@ set_module_type(dbghelp win32dll) target_link_libraries(dbghelp wine - pseh + ${PSEH_LIB} oldnames) add_importlibs(dbghelp psapi version msvcrt kernel32 ntdll) diff --git a/dll/win32/gdi32/CMakeLists.txt b/dll/win32/gdi32/CMakeLists.txt index ceeca900014..46d69766de2 100644 --- a/dll/win32/gdi32/CMakeLists.txt +++ b/dll/win32/gdi32/CMakeLists.txt @@ -50,7 +50,7 @@ set_module_type(gdi32 win32dll) target_link_libraries(gdi32 win32ksys dxguid - pseh) + ${PSEH_LIB}) add_importlibs(gdi32 user32 advapi32 kernel32 ntdll) add_pch(gdi32 ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE}) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index b4cd40a3527..c502a8c6809 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -115,10 +115,10 @@ add_library(kernel32 SHARED set_module_type(kernel32 win32dll) -target_link_libraries(kernel32 pseh) +target_link_libraries(kernel32 ${PSEH_LIB}) add_importlibs(kernel32 ntdll) add_pch(kernel32 ${CMAKE_CURRENT_SOURCE_DIR}/k32.h ${SOURCE}) add_dependencies(kernel32 errcodes) add_cab_target(kernel32 1) -add_importlib_target(kernel32) +add_importlib_def(${CMAKE_CURRENT_BINARY_DIR}/kernel32.def) diff --git a/dll/win32/lsasrv/CMakeLists.txt b/dll/win32/lsasrv/CMakeLists.txt index cc53a3781f2..d76f58d57ac 100644 --- a/dll/win32/lsasrv/CMakeLists.txt +++ b/dll/win32/lsasrv/CMakeLists.txt @@ -20,7 +20,7 @@ set_entrypoint(lsasrv 0) target_link_libraries(lsasrv lsa_server wine - pseh) + ${PSEH_LIB}) add_importlibs(lsasrv rpcrt4 kernel32 ntdll) add_dependencies(lsasrv psdk buildno_header) diff --git a/dll/win32/msvcrt/CMakeLists.txt b/dll/win32/msvcrt/CMakeLists.txt index 394dd2e15d0..de508f0ad91 100644 --- a/dll/win32/msvcrt/CMakeLists.txt +++ b/dll/win32/msvcrt/CMakeLists.txt @@ -24,7 +24,7 @@ target_link_libraries(msvcrt ${CMAKE_CURRENT_SOURCE_DIR}/msvcrt.def crt wine - pseh) + ${PSEH_LIB}) add_pch(msvcrt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) add_importlibs(msvcrt kernel32 ntdll) diff --git a/dll/win32/ole32/CMakeLists.txt b/dll/win32/ole32/CMakeLists.txt index 3502a317da9..6078ddc29f9 100644 --- a/dll/win32/ole32/CMakeLists.txt +++ b/dll/win32/ole32/CMakeLists.txt @@ -68,7 +68,7 @@ target_link_libraries(ole32 irot_client ole32_proxy uuid - pseh) + ${PSEH_LIB}) add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 ntdll) diff --git a/dll/win32/oleaut32/CMakeLists.txt b/dll/win32/oleaut32/CMakeLists.txt index 5f38ed7d330..987236f581b 100644 --- a/dll/win32/oleaut32/CMakeLists.txt +++ b/dll/win32/oleaut32/CMakeLists.txt @@ -53,7 +53,7 @@ target_link_libraries(oleaut32 wine wineldr uuid - pseh) + ${PSEH_LIB}) add_importlibs(oleaut32 windowscodecs ole32 rpcrt4 user32 gdi32 advapi32 comctl32 urlmon msvcrt kernel32 ntdll) diff --git a/dll/win32/psapi/CMakeLists.txt b/dll/win32/psapi/CMakeLists.txt index 001776cac10..0ee751e8295 100644 --- a/dll/win32/psapi/CMakeLists.txt +++ b/dll/win32/psapi/CMakeLists.txt @@ -15,7 +15,7 @@ set_module_type(psapi win32dll) target_link_libraries(psapi epsapi - pseh) + ${PSEH_LIB}) add_importlibs(psapi kernel32 ntdll) add_pch(psapi ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) diff --git a/dll/win32/rpcrt4/CMakeLists.txt b/dll/win32/rpcrt4/CMakeLists.txt index 3885df8e0cf..c5750f7de7d 100644 --- a/dll/win32/rpcrt4/CMakeLists.txt +++ b/dll/win32/rpcrt4/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries(rpcrt4 wine uuid epm_client - pseh) + ${PSEH_LIB}) add_importlibs(rpcrt4 msvcrt user32 advapi32 secur32 iphlpapi ws2_32 kernel32 ntdll) add_dependencies(rpcrt4 winesdk) diff --git a/dll/win32/setupapi/CMakeLists.txt b/dll/win32/setupapi/CMakeLists.txt index 69a9943eb8e..a5b90b8c4cb 100644 --- a/dll/win32/setupapi/CMakeLists.txt +++ b/dll/win32/setupapi/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries(setupapi pnp_client uuid wine - pseh) + ${PSEH_LIB}) add_importlibs(setupapi msvcrt diff --git a/dll/win32/sti/CMakeLists.txt b/dll/win32/sti/CMakeLists.txt index 0e19601f2bf..940e7699cfe 100644 --- a/dll/win32/sti/CMakeLists.txt +++ b/dll/win32/sti/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(sti sti_proxy wine uuid - pseh) + ${PSEH_LIB}) add_importlibs(sti ole32 diff --git a/dll/win32/syssetup/CMakeLists.txt b/dll/win32/syssetup/CMakeLists.txt index 69e1c8251e8..3fc1b133ca5 100644 --- a/dll/win32/syssetup/CMakeLists.txt +++ b/dll/win32/syssetup/CMakeLists.txt @@ -18,7 +18,7 @@ set_module_type(syssetup win32dll) target_link_libraries(syssetup uuid - pseh) + ${PSEH_LIB}) add_importlibs(syssetup msvcrt diff --git a/dll/win32/urlmon/CMakeLists.txt b/dll/win32/urlmon/CMakeLists.txt index 926c6222744..b78c402f0aa 100644 --- a/dll/win32/urlmon/CMakeLists.txt +++ b/dll/win32/urlmon/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries(urlmon urlmon_proxy uuid wine - pseh) + ${PSEH_LIB}) add_importlibs(urlmon rpcrt4 diff --git a/dll/win32/user32/CMakeLists.txt b/dll/win32/user32/CMakeLists.txt index f8a8f4ca3b1..780c97f5228 100644 --- a/dll/win32/user32/CMakeLists.txt +++ b/dll/win32/user32/CMakeLists.txt @@ -77,7 +77,7 @@ set_module_type(user32 win32dll) target_link_libraries(user32 wine win32ksys - pseh) + ${PSEH_LIB}) add_pch(user32 ${CMAKE_CURRENT_SOURCE_DIR}/include/user32.h ${SOURCE}) add_importlibs(user32 gdi32 advapi32 imm32 kernel32 ntdll) diff --git a/dll/win32/wininet/CMakeLists.txt b/dll/win32/wininet/CMakeLists.txt index c74bd23d426..0fe8f96f218 100644 --- a/dll/win32/wininet/CMakeLists.txt +++ b/dll/win32/wininet/CMakeLists.txt @@ -30,7 +30,7 @@ set_module_type(wininet win32dll) target_link_libraries(wininet wine zlib - pseh) + ${PSEH_LIB}) add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 secur32 crypt32 ws2_32 msvcrt kernel32 ntdll) diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index 84a8ef5e13e..8a8ac42f16f 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -23,7 +23,7 @@ set_module_type(winmm win32dll) target_link_libraries(winmm wine - pseh) + ${PSEH_LIB}) add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) diff --git a/dll/win32/wintrust/CMakeLists.txt b/dll/win32/wintrust/CMakeLists.txt index 7277d09927c..93f285f9450 100644 --- a/dll/win32/wintrust/CMakeLists.txt +++ b/dll/win32/wintrust/CMakeLists.txt @@ -17,7 +17,7 @@ set_module_type(wintrust win32dll) target_link_libraries(wintrust wine - pseh) + ${PSEH_LIB}) add_importlibs(wintrust crypt32 cryptui user32 advapi32 imagehlp msvcrt kernel32 ntdll) diff --git a/dll/win32/wlanapi/CMakeLists.txt b/dll/win32/wlanapi/CMakeLists.txt index ea283c942dc..742c2192b26 100644 --- a/dll/win32/wlanapi/CMakeLists.txt +++ b/dll/win32/wlanapi/CMakeLists.txt @@ -11,7 +11,7 @@ set_entrypoint(wlanapi 0) target_link_libraries(wlanapi wlansvc_client wine - pseh) + ${PSEH_LIB}) add_importlibs(wlanapi rpcrt4 kernel32 ntdll) add_dependencies(wlanapi psdk buildno_header) diff --git a/drivers/base/null/CMakeLists.txt b/drivers/base/null/CMakeLists.txt index f6346bbea4a..896213bc821 100644 --- a/drivers/base/null/CMakeLists.txt +++ b/drivers/base/null/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(null SHARED null.c null.rc) set_target_properties(null PROPERTIES LINK_FLAGS "-Wl,-entry,_DriverEntry@8 -Wl,--image-base,0x00010000 -Wl,--exclude-all-symbols" SUFFIX ".sys") target_link_libraries(null - pseh + ${PSEH_LIB} -lntoskrnl -lhal) diff --git a/drivers/filesystems/fastfat_new/CMakeLists.txt b/drivers/filesystems/fastfat_new/CMakeLists.txt index ab0b07233f1..48dbbf1c1b4 100644 --- a/drivers/filesystems/fastfat_new/CMakeLists.txt +++ b/drivers/filesystems/fastfat_new/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(fastfat_new SHARED ${CMAKE_CURRENT_BINARY_DIR}/fastfat_new_fastfat.h set_target_properties(fastfat_new PROPERTIES LINK_FLAGS "-Wl,-entry,_DriverEntry@8 -Wl,--image-base,0x00010000 -Wl,--exclude-all-symbols -Wl,--subsystem,native" SUFFIX ".sys") target_link_libraries(fastfat_new - pseh + ${PSEH_LIB} fullfat) add_importlibs(fastfat_new ntoskrnl hal) diff --git a/drivers/input/kbdclass/CMakeLists.txt b/drivers/input/kbdclass/CMakeLists.txt index f400c1c62b7..0334af23d9a 100644 --- a/drivers/input/kbdclass/CMakeLists.txt +++ b/drivers/input/kbdclass/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(kbdclass SHARED set_module_type(kbdclass kernelmodedriver) -target_link_libraries(kbdclass pseh) +target_link_libraries(kbdclass ${PSEH_LIB}) add_importlibs(kbdclass ntoskrnl hal) diff --git a/drivers/input/mouclass/CMakeLists.txt b/drivers/input/mouclass/CMakeLists.txt index eb027257a3e..c85c0f96e2b 100644 --- a/drivers/input/mouclass/CMakeLists.txt +++ b/drivers/input/mouclass/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(mouclass SHARED set_module_type(mouclass kernelmodedriver) -target_link_libraries(mouclass pseh) +target_link_libraries(mouclass ${PSEH_LIB}) add_importlibs(mouclass ntoskrnl hal) diff --git a/drivers/ksfilter/ks/CMakeLists.txt b/drivers/ksfilter/ks/CMakeLists.txt index 9051f4b0131..7df62133148 100644 --- a/drivers/ksfilter/ks/CMakeLists.txt +++ b/drivers/ksfilter/ks/CMakeLists.txt @@ -33,7 +33,7 @@ set_image_base(ks 0x00010000) target_link_libraries(ks ${CMAKE_CURRENT_SOURCE_DIR}/ks.def - pseh) + ${PSEH_LIB}) add_importlibs(ks ntoskrnl hal msvcrt) add_dependencies(ks psdk bugcodes) diff --git a/drivers/network/afd/CMakeLists.txt b/drivers/network/afd/CMakeLists.txt index 768409cc80a..76478ebeed7 100644 --- a/drivers/network/afd/CMakeLists.txt +++ b/drivers/network/afd/CMakeLists.txt @@ -22,7 +22,7 @@ add_library(afd SHARED ${CMAKE_CURRENT_BINARY_DIR}/afd_afd.h.gch ${SOURCE}) set_module_type(afd kernelmodedriver) target_link_libraries(afd - pseh + ${PSEH_LIB} -lntoskrnl -lhal) diff --git a/drivers/network/tcpip/CMakeLists.txt b/drivers/network/tcpip/CMakeLists.txt index b41c521cdff..a4e4bc233cb 100644 --- a/drivers/network/tcpip/CMakeLists.txt +++ b/drivers/network/tcpip/CMakeLists.txt @@ -31,7 +31,7 @@ set_module_type(tcpip kernelmodedriver) target_link_libraries(tcpip ip oskittcp - pseh + ${PSEH_LIB} chew -lndis -lntoskrnl diff --git a/drivers/storage/classpnp/CMakeLists.txt b/drivers/storage/classpnp/CMakeLists.txt index c68627bd137..94b7b40b645 100644 --- a/drivers/storage/classpnp/CMakeLists.txt +++ b/drivers/storage/classpnp/CMakeLists.txt @@ -36,7 +36,7 @@ list(APPEND SOURCE spec2def(classpnp.sys class.spec) add_library(classpnp SHARED ${SOURCE}) -target_link_libraries(classpnp pseh libcntpr) +target_link_libraries(classpnp ${PSEH_LIB} libcntpr) set_module_type(classpnp kernelmodedriver) diff --git a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt index 13dd92e6e00..dbe1a6f9e33 100644 --- a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt +++ b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt @@ -51,7 +51,7 @@ add_library(portcls SHARED target_link_libraries(portcls libcntpr - pseh) + ${PSEH_LIB}) if(MSVC) set_target_properties(portcls PROPERTIES COMPILE_FLAGS "/GR-") diff --git a/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt b/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt index 0eee3ccc401..4c4b2c34ddf 100644 --- a/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt +++ b/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt @@ -17,7 +17,7 @@ set_target_properties(wdmaud PROPERTIES LINK_FLAGS "-Wl,-entry,_DriverEntry@8 -W target_link_libraries(wdmaud mmixer libcntpr - pseh) + ${PSEH_LIB}) add_importlibs(wdmaud ntoskrnl ks hal) add_dependencies(wdmaud psdk bugcodes) diff --git a/gcc.cmake b/gcc.cmake index 0317fa8a1ed..a1d8fbaeff3 100644 --- a/gcc.cmake +++ b/gcc.cmake @@ -157,8 +157,11 @@ set(IDL_TYPELIB_ARG -t -T) #.tlb set(IDL_SERVER_ARG -s -S) #.c for server library set(IDL_CLIENT_ARG -c -C) #.c for stub client library -macro(add_importlib_target _name) +macro(add_importlib_def _def_file) # empty for now, while import libs are shipped endmacro() +#pseh lib, needed with mingw +set(PSEH_LIB "pseh") + endif() diff --git a/msc.cmake b/msc.cmake index 91ba045ee1f..eb0fdc7ad84 100644 --- a/msc.cmake +++ b/msc.cmake @@ -82,25 +82,26 @@ set(IDL_SERVER_ARG /sstub) #.c for stub server library set(IDL_CLIENT_ARG /cstub) #.c for stub client library -macro(add_importlib_target _name) - add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib - COMMAND LINK /LIB /MACHINE:X86 /DEF:${CMAKE_CURRENT_BINARY_DIR}/${_name}.def /OUT:${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_name}.def - ) - add_custom_target(lib${_name} - DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib +macro(add_importlib_def _def_file) + get_filename_component(_name ${_def_file} NAME_WE) + add_custom_target( + lib${_name} + COMMAND LINK /LIB /MACHINE:X86 /DEF:${CMAKE_CURRENT_BINARY_DIR}/${_file}.def /OUT:${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib + DEPENDS ${_def_file} ) endmacro() macro(add_importlibs MODULE) foreach(LIB ${ARGN}) target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/importlibs/lib${LIB}.lib) - add_dependencies(${MODULE} lib${LIB}) + #add_dependencies(${MODULE} lib${LIB}) endforeach() endmacro() file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs) +#pseh workaround +set(PSEH_LIB "") + endif() diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index 952da5fcbbe..d97fa2c3908 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -409,7 +409,7 @@ set_target_properties(ntoskrnl PROPERTIES LINK_FLAGS "-Wl,-entry,_KiSystemStartu target_link_libraries(ntoskrnl cportlib csq - pseh + ${PSEH_LIB} cmlib rtl rossym diff --git a/subsystems/win32/csrss/csrsrv/CMakeLists.txt b/subsystems/win32/csrss/csrsrv/CMakeLists.txt index 1e3b7071da5..9b9462805bc 100644 --- a/subsystems/win32/csrss/csrsrv/CMakeLists.txt +++ b/subsystems/win32/csrss/csrsrv/CMakeLists.txt @@ -15,7 +15,7 @@ list(APPEND SOURCE add_library(csrsrv SHARED ${CMAKE_CURRENT_BINARY_DIR}/csrsrv_srv.h.gch ${SOURCE}) -target_link_libraries(csrsrv pseh) +target_link_libraries(csrsrv ${PSEH_LIB}) set_module_type(csrsrv nativedll) diff --git a/subsystems/win32/csrss/win32csr/CMakeLists.txt b/subsystems/win32/csrss/win32csr/CMakeLists.txt index 3ffc32528fb..f449eb864cb 100644 --- a/subsystems/win32/csrss/win32csr/CMakeLists.txt +++ b/subsystems/win32/csrss/win32csr/CMakeLists.txt @@ -31,7 +31,7 @@ add_library(win32csr SHARED ${CMAKE_CURRENT_BINARY_DIR}/win32csr_w32csr.h.gch ${ target_link_libraries(win32csr win32ksys - pseh) + ${PSEH_LIB}) set_module_type(win32csr win32dll) diff --git a/subsystems/win32/win32k/CMakeLists.txt b/subsystems/win32/win32k/CMakeLists.txt index 403b9d73e4a..5d9b94289fe 100644 --- a/subsystems/win32/win32k/CMakeLists.txt +++ b/subsystems/win32/win32k/CMakeLists.txt @@ -181,7 +181,7 @@ set_module_type(win32k kernelmodedriver) target_link_libraries(win32k ${CMAKE_CURRENT_SOURCE_DIR}/win32k_i386.def - pseh + ${PSEH_LIB} dxguid libcntpr)