[MEDIA][CMAKE] Create add_driver_inf cmake function

*.inf files for drivers can now be placed along with the driver code
This commit is contained in:
Victor Perevertkin 2020-04-26 19:50:44 +03:00
parent d8c6ef5ef9
commit 019f21ee1d
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
31 changed files with 34 additions and 27 deletions

View file

@ -203,6 +203,7 @@ target_link_libraries(acpi wdmguid acpica memcmp strtol ${PSEH_LIB})
add_importlibs(acpi ntoskrnl hal) add_importlibs(acpi ntoskrnl hal)
add_pch(acpi precomp.h ACPI_SOURCE) add_pch(acpi precomp.h ACPI_SOURCE)
add_cd_file(TARGET acpi DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET acpi DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_driver_inf(acpi acpi.inf)
add_subdirectory(cmbatt) add_subdirectory(cmbatt)
add_subdirectory(compbatt) add_subdirectory(compbatt)

View file

@ -70,3 +70,4 @@ set_module_type(btrfs kernelmodedriver)
target_link_libraries(btrfs rtlver zlib_solo chkstk wdmguid ${PSEH_LIB}) target_link_libraries(btrfs rtlver zlib_solo chkstk wdmguid ${PSEH_LIB})
add_importlibs(btrfs ntoskrnl hal) add_importlibs(btrfs ntoskrnl hal)
add_cd_file(TARGET btrfs DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET btrfs DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_driver_inf(btrfs btrfs.inf)

View file

@ -19,3 +19,4 @@ add_pch(e1000 nic.h SOURCE)
set_module_type(e1000 kernelmodedriver) set_module_type(e1000 kernelmodedriver)
add_importlibs(e1000 ndis ntoskrnl hal) add_importlibs(e1000 ndis ntoskrnl hal)
add_cd_file(TARGET e1000 DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET e1000 DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(e1000 nete1000.inf)

View file

@ -11,3 +11,4 @@ add_pch(ne2000 include/ne2000.h SOURCE)
set_module_type(ne2000 kernelmodedriver) set_module_type(ne2000 kernelmodedriver)
add_importlibs(ne2000 ndis ntoskrnl hal) add_importlibs(ne2000 ndis ntoskrnl hal)
add_cd_file(TARGET ne2000 DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET ne2000 DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(ne2000 netne2000.inf netrtl8029.inf)

View file

@ -24,6 +24,7 @@ add_library(netkvm MODULE ${SOURCE} wxp/parandis.rc)
set_module_type(netkvm kernelmodedriver) set_module_type(netkvm kernelmodedriver)
add_importlibs(netkvm ndis ntoskrnl hal) add_importlibs(netkvm ndis ntoskrnl hal)
add_cd_file(TARGET netkvm DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET netkvm DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(netkvm netkvm.inf)
if (NOT MSVC) if (NOT MSVC)
add_compile_flags("-Wno-unused-function") add_compile_flags("-Wno-unused-function")

View file

@ -15,3 +15,4 @@ add_pch(pcnet pcnet.h SOURCE)
set_module_type(pcnet kernelmodedriver) set_module_type(pcnet kernelmodedriver)
add_importlibs(pcnet ndis ntoskrnl hal) add_importlibs(pcnet ndis ntoskrnl hal)
add_cd_file(TARGET pcnet DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET pcnet DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(pcnet netpcnet.inf)

View file

@ -16,3 +16,4 @@ add_pch(rtl8139 nic.h SOURCE)
set_module_type(rtl8139 kernelmodedriver) set_module_type(rtl8139 kernelmodedriver)
add_importlibs(rtl8139 ndis ntoskrnl hal) add_importlibs(rtl8139 ndis ntoskrnl hal)
add_cd_file(TARGET rtl8139 DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET rtl8139 DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(rtl8139 netrtl8139.inf)

View file

@ -10,3 +10,4 @@ set_module_type(processr kernelmodedriver)
add_importlibs(processr hal ntoskrnl) add_importlibs(processr hal ntoskrnl)
add_pch(processr processr.h SOURCE) add_pch(processr processr.h SOURCE)
add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(processr cpu.inf)

View file

@ -12,3 +12,4 @@ add_importlibs(cdrom class2 scsiport ntoskrnl hal)
add_pch(cdrom precomp.h SOURCE) add_pch(cdrom precomp.h SOURCE)
add_cd_file(TARGET cdrom DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET cdrom DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_registry_inf(cdrom_reg.inf) add_registry_inf(cdrom_reg.inf)
add_driver_inf(cdrom cdrom.inf)

View file

@ -5,3 +5,4 @@ set_module_type(disk kernelmodedriver)
add_importlibs(disk class2 scsiport ntoskrnl hal) add_importlibs(disk class2 scsiport ntoskrnl hal)
add_cd_file(TARGET disk DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET disk DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_registry_inf(disk_reg.inf) add_registry_inf(disk_reg.inf)
add_driver_inf(disk disk.inf)

View file

@ -22,3 +22,4 @@ set_module_type(disk_new kernelmodedriver)
add_importlibs(disk_new classpnp ntoskrnl hal) add_importlibs(disk_new classpnp ntoskrnl hal)
add_pch(disk_new disk.h SOURCE) add_pch(disk_new disk.h SOURCE)
add_cd_file(TARGET disk_new DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET disk_new DESTINATION reactos/system32/drivers NO_CAB FOR all)
#add_driver_inf(disk_new diskdev.inf)

View file

@ -11,3 +11,4 @@ set_module_type(fdc kernelmodedriver)
add_importlibs(fdc hal ntoskrnl) add_importlibs(fdc hal ntoskrnl)
add_pch(fdc fdc.h SOURCE) add_pch(fdc fdc.h SOURCE)
add_cd_file(TARGET fdc DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET fdc DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(fdc fdc.inf)

View file

@ -23,3 +23,4 @@ set_module_type(usbstor kernelmodedriver)
add_importlibs(usbstor ntoskrnl hal usbd) add_importlibs(usbstor ntoskrnl hal usbd)
add_pch(usbstor usbstor.h SOURCE) add_pch(usbstor usbstor.h SOURCE)
add_cd_file(TARGET usbstor DESTINATION reactos/system32/drivers NO_CAB FOR all) add_cd_file(TARGET usbstor DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_driver_inf(usbstor usbstor.inf)

View file

@ -15,3 +15,4 @@ set_module_type(hdaudbus kernelmodedriver)
target_link_libraries(hdaudbus libcntpr ${PSEH_LIB}) target_link_libraries(hdaudbus libcntpr ${PSEH_LIB})
add_importlibs(hdaudbus ntoskrnl hal) add_importlibs(hdaudbus ntoskrnl hal)
add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all)
add_driver_inf(hdaudbus hdaudbus.inf)

View file

@ -1,20 +1,14 @@
list(APPEND INF_FILES list(APPEND INF_FILES
acpi.inf
audio.inf audio.inf
battery.inf battery.inf
bda.inf bda.inf
bth.inf bth.inf
btrfs.inf
c_image.inf c_image.inf
cdrom.inf
cpu.inf
disk.inf
display.inf display.inf
fdc.inf fdc.inf
flpydisk.inf flpydisk.inf
hal.inf hal.inf
hdaudbus.inf
hdc.inf hdc.inf
input.inf input.inf
keyboard.inf keyboard.inf
@ -25,12 +19,6 @@ list(APPEND INF_FILES
monitor.inf monitor.inf
msmouse.inf msmouse.inf
NET_NIC.inf NET_NIC.inf
netamd.inf
nete1000.inf
netisa.inf
netkvm.inf
netrtl.inf
netrtpnt.inf
nettcpip.inf nettcpip.inf
ports.inf ports.inf
scsi.inf scsi.inf
@ -38,10 +26,8 @@ list(APPEND INF_FILES
unknown.inf unknown.inf
usb.inf usb.inf
usbport.inf usbport.inf
usbstor.inf
wdmaudio.inf wdmaudio.inf
wmiacpi.inf wmiacpi.inf)
xboxdisp.inf)
list(APPEND UTF8_INF_FILES list(APPEND UTF8_INF_FILES
defltws.inf defltws.inf
@ -49,17 +35,8 @@ list(APPEND UTF8_INF_FILES
intl.inf intl.inf
layout.inf) layout.inf)
foreach(item ${INF_FILES}) # module name is used for a custom target creation, so we can put any unique name here
set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${item}) add_driver_inf(media_inf ${INF_FILES})
set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${item})
add_custom_command(OUTPUT "${_converted_item}"
COMMAND native-utf16le "${_source_item}" "${_converted_item}"
DEPENDS native-utf16le "${_source_item}")
add_cd_file(TARGET converted_inf_files FILE ${_converted_item} DESTINATION reactos/inf FOR all)
list(APPEND _converted_inf_files ${_converted_item})
endforeach(item)
add_custom_target(converted_inf_files DEPENDS ${_converted_inf_files})
foreach(item ${UTF8_INF_FILES}) foreach(item ${UTF8_INF_FILES})
add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/inf FOR all) add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/inf FOR all)

View file

@ -298,7 +298,7 @@ macro(dir_to_num dir var)
elseif(${dir} STREQUAL reactos/3rdParty) elseif(${dir} STREQUAL reactos/3rdParty)
set(${var} 63) set(${var} 63)
elseif(${dir} STREQUAL reactos/Resources/Themes/Lunar) elseif(${dir} STREQUAL reactos/Resources/Themes/Lunar)
set(${var} 64) set(${var} 64)
elseif(${dir} STREQUAL reactos/Resources/Themes/Mizu) elseif(${dir} STREQUAL reactos/Resources/Themes/Mizu)
set(${var} 65) set(${var} 65)
elseif(${dir} STREQUAL reactos/system32/spool/prtprocs/x64) elseif(${dir} STREQUAL reactos/system32/spool/prtprocs/x64)
@ -908,6 +908,21 @@ function(create_registry_hives)
endfunction() endfunction()
function(add_driver_inf _module)
# Add to the inf files list
foreach(_file ${ARGN})
set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${_file})
set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
add_custom_command(OUTPUT "${_converted_item}"
COMMAND native-utf16le "${_source_item}" "${_converted_item}"
DEPENDS native-utf16le "${_source_item}")
add_cd_file(FILE ${_converted_item} DESTINATION reactos/inf FOR all)
list(APPEND _converted_inf_files ${_converted_item})
endforeach()
add_custom_target(${_module}_inf_files DEPENDS ${_converted_inf_files})
endfunction()
if(KDBG) if(KDBG)
set(ROSSYM_LIB "rossym") set(ROSSYM_LIB "rossym")
else() else()

View file

@ -11,3 +11,4 @@ set_module_type(xboxvmp kernelmodedriver)
add_importlibs(xboxvmp ntoskrnl videoprt) add_importlibs(xboxvmp ntoskrnl videoprt)
add_cd_file(TARGET xboxvmp DESTINATION reactos/system32/drivers FOR all) add_cd_file(TARGET xboxvmp DESTINATION reactos/system32/drivers FOR all)
add_registry_inf(xboxvmp_reg.inf) add_registry_inf(xboxvmp_reg.inf)
add_driver_inf(xboxvmp xboxdisp.inf)