2011-05-16 13:12:07 +00:00
|
|
|
|
|
|
|
add_definitions(
|
|
|
|
-D_NTHALDLL_
|
|
|
|
-D_NTHAL_)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
include
|
2018-02-11 18:21:01 +00:00
|
|
|
${REACTOS_SOURCE_DIR}/ntoskrnl/include
|
|
|
|
${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/fast486)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
function(add_hal _halname)
|
|
|
|
cmake_parse_arguments(_haldata "" "" "SOURCES;COMPONENTS" ${ARGN})
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
# Handle the spec file for the dll name
|
|
|
|
spec2def(${_halname}.dll ../hal.spec ADD_IMPORTLIB)
|
2012-07-17 14:11:49 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
# Create the actual target
|
2021-02-02 15:33:15 +00:00
|
|
|
foreach(_component ${_haldata_COMPONENTS})
|
|
|
|
list(APPEND _haldata_SOURCES "$<TARGET_OBJECTS:lib_hal_${_component}>")
|
|
|
|
endforeach()
|
|
|
|
add_library(${_halname} MODULE
|
|
|
|
${_haldata_SOURCES}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
|
2020-07-25 13:31:02 +00:00
|
|
|
|
2020-05-26 18:24:02 +00:00
|
|
|
if(${_halname} STREQUAL "hal")
|
2020-04-09 17:19:00 +00:00
|
|
|
target_link_libraries(${_halname} libcntpr arbiter)
|
|
|
|
else()
|
|
|
|
target_link_libraries(${_halname} libcntpr)
|
|
|
|
endif()
|
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
add_importlibs(${_halname} ntoskrnl)
|
|
|
|
#add_pch(${_halname} include/hal.h)
|
2014-10-04 20:25:57 +00:00
|
|
|
add_dependencies(${_halname} psdk asm)
|
|
|
|
set_module_type(${_halname} kerneldll ENTRYPOINT HalInitSystem 8)
|
2013-03-23 21:15:28 +00:00
|
|
|
add_cd_file(TARGET ${_halname} DESTINATION reactos/system32 NO_CAB FOR all)
|
2011-09-07 12:00:29 +00:00
|
|
|
if(MSVC)
|
2021-09-13 16:51:08 +00:00
|
|
|
target_link_options(${_halname} PRIVATE /ignore:4216 /SECTION:INIT,ERWD)
|
2013-03-24 13:27:52 +00:00
|
|
|
else()
|
|
|
|
target_link_libraries(${_halname} -lgcc)
|
2011-09-07 12:00:29 +00:00
|
|
|
endif()
|
2013-03-23 21:15:28 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
# The components
|
|
|
|
include(generic.cmake)
|
|
|
|
include(acpi.cmake)
|
|
|
|
include(apic.cmake)
|
2021-03-14 23:42:49 +00:00
|
|
|
include(up.cmake)
|
2021-06-06 12:19:00 +00:00
|
|
|
include(smp.cmake)
|
2012-07-17 14:11:49 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
|
|
|
include(pcidata.cmake)
|
|
|
|
include(legacy.cmake)
|
|
|
|
include(pic.cmake)
|
2019-08-12 09:23:25 +00:00
|
|
|
include(xbox.cmake)
|
2020-07-25 13:31:02 +00:00
|
|
|
include(pc98.cmake)
|
2014-02-10 18:35:12 +00:00
|
|
|
add_subdirectory(minihal)
|
2011-08-15 15:36:25 +00:00
|
|
|
|
2020-07-25 13:31:02 +00:00
|
|
|
remove_definitions(-DSARCH_XBOX)
|
|
|
|
remove_definitions(-DSARCH_PC98)
|
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
# hal
|
2021-03-14 23:42:49 +00:00
|
|
|
add_hal(hal SOURCES pic/halpic.rc COMPONENTS generic legacy up pic)
|
2013-03-23 21:15:28 +00:00
|
|
|
add_hal(halacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up pic)
|
2021-05-04 01:29:50 +00:00
|
|
|
add_hal(halaacpi SOURCES apic/halaacpi.rc COMPONENTS generic acpi up apic)
|
2021-06-03 09:53:07 +00:00
|
|
|
add_hal(halapic SOURCES apic/halapic.rc COMPONENTS generic legacy up apic)
|
2019-10-04 17:42:16 +00:00
|
|
|
add_hal(halxbox SOURCES xbox/halxbox.rc COMPONENTS xbox up)
|
2020-07-25 13:31:02 +00:00
|
|
|
add_hal(halpc98 SOURCES pc98/halpc98.rc COMPONENTS pc98 up)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2021-06-24 16:57:19 +00:00
|
|
|
#add_hal(halmacpi SOURCES smp/halmacpi.rc COMPONENTS generic acpi smp apic)
|
|
|
|
#add_hal(halmp SOURCES mp/halmp.rc COMPONENTS generic legacy smp apic)
|
2011-08-26 19:45:21 +00:00
|
|
|
|
2013-03-23 21:15:28 +00:00
|
|
|
elseif(ARCH STREQUAL "amd64")
|
2011-08-26 19:45:21 +00:00
|
|
|
|
|
|
|
list(APPEND HAL_SOURCE
|
2021-03-14 23:51:25 +00:00
|
|
|
amd64/x86bios.c)
|
2011-08-26 19:45:21 +00:00
|
|
|
|
2021-03-14 23:42:49 +00:00
|
|
|
add_hal(hal SOURCES ${HAL_SOURCE} COMPONENTS generic acpi up apic)
|
2018-02-11 18:21:01 +00:00
|
|
|
target_link_libraries(hal fast486)
|
2011-08-26 19:45:21 +00:00
|
|
|
|
2021-06-06 12:19:00 +00:00
|
|
|
add_hal(halmp SOURCES ${HAL_SOURCE} COMPONENTS generic acpi smp apic)
|
|
|
|
target_link_libraries(halmp fast486)
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|