- build msvc importlibs explicitly from def file
  - circumvent lack of pseh lib in MSVC.
  - fix advapi32.def

svn path=/branches/cmake-bringup/; revision=49409
This commit is contained in:
Jérôme Gardou 2010-11-01 17:24:32 +00:00
parent 18dd356710
commit 887046a6ee
45 changed files with 62 additions and 58 deletions

View file

@ -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})

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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})

View file

@ -50,7 +50,7 @@ target_link_libraries(quartz
strmiids
uuid
wine
pseh)
${PSEH_LIB})
add_importlibs(quartz
msvcrt

View file

@ -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)

View file

@ -13,7 +13,7 @@ target_link_libraries(actxprxy
actxprxy_proxy
uuid
wine
pseh)
${PSEH_LIB})
add_importlibs(actxprxy
rpcrt4

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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})

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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})

View file

@ -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)

View file

@ -40,7 +40,7 @@ target_link_libraries(setupapi
pnp_client
uuid
wine
pseh)
${PSEH_LIB})
add_importlibs(setupapi
msvcrt

View file

@ -25,7 +25,7 @@ target_link_libraries(sti
sti_proxy
wine
uuid
pseh)
${PSEH_LIB})
add_importlibs(sti
ole32

View file

@ -18,7 +18,7 @@ set_module_type(syssetup win32dll)
target_link_libraries(syssetup
uuid
pseh)
${PSEH_LIB})
add_importlibs(syssetup
msvcrt

View file

@ -40,7 +40,7 @@ target_link_libraries(urlmon
urlmon_proxy
uuid
wine
pseh)
${PSEH_LIB})
add_importlibs(urlmon
rpcrt4

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -31,7 +31,7 @@ set_module_type(tcpip kernelmodedriver)
target_link_libraries(tcpip
ip
oskittcp
pseh
${PSEH_LIB}
chew
-lndis
-lntoskrnl

View file

@ -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)

View file

@ -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-")

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)