* Add the wdmdriver module type

svn path=/trunk/; revision=58637
This commit is contained in:
Jérôme Gardou 2013-04-02 08:08:36 +00:00
parent 1cac15db4b
commit 4f6ab684bf
3 changed files with 10 additions and 5 deletions

View file

@ -299,7 +299,7 @@ function(set_module_type MODULE TYPE)
# Set subsystem. Also take this as an occasion
# to error out if someone gave a non existing type
if((${TYPE} STREQUAL nativecui) OR (${TYPE} STREQUAL nativedll) OR (${TYPE} STREQUAL kernelmodedriver))
if((${TYPE} STREQUAL nativecui) OR (${TYPE} STREQUAL nativedll) OR (${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver))
set(__subsystem native)
elseif(${TYPE} STREQUAL win32cui)
set(__subsystem console)
@ -342,7 +342,7 @@ function(set_module_type MODULE TYPE)
OR (${TYPE} STREQUAL cpl))
set(__entrypoint DllMainCRTStartup)
set(__entrystack 12)
elseif(${TYPE} STREQUAL kernelmodedriver)
elseif((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver))
set(__entrypoint DriverEntry)
set(__entrystack 8)
elseif(${TYPE} STREQUAL nativedll)
@ -369,12 +369,12 @@ function(set_module_type MODULE TYPE)
else()
message(STATUS "${MODULE} has no base address")
endif()
elseif(${TYPE} STREQUAL kernelmodedriver)
elseif((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver))
set_image_base(${MODULE} 0x00010000)
endif()
# Now do some stuff which is specific to each type
if(${TYPE} STREQUAL kernelmodedriver)
if((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver))
add_dependencies(${MODULE} bugcodes)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
endif()

View file

@ -202,8 +202,11 @@ function(set_module_type_toolchain MODULE TYPE)
target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex)
endif()
if(${TYPE} STREQUAL "kernelmodedriver")
if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver"))
add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000")
if(${TYPE} STREQUAL "wdmdriver")
add_target_link_flags(${MODULE} "-Wl,--wdmdriver")
endif()
endif()
endfunction()

View file

@ -112,6 +112,8 @@ function(set_module_type_toolchain MODULE TYPE)
add_target_link_flags(${MODULE} "/DLL")
elseif(${TYPE} STREQUAL "kernelmodedriver")
add_target_link_flags(${MODULE} "/DRIVER")
elseif(${TYPE} STREQUAL "wdmdriver")
add_target_link_flags(${MODULE} "/DRIVER:WDM")
endif()
endfunction()