Sync with trunk for console graphics palettes.
[reactos.git] / hal / halx86 / CMakeLists.txt
1
2 add_definitions(
3 -D_NTHALDLL_
4 -D_NTHAL_)
5
6 include_directories(
7 include
8 ${REACTOS_SOURCE_DIR}/ntoskrnl/include)
9
10 function(add_hal _halname)
11 cmake_parse_arguments(_haldata "" "" "SOURCES;COMPONENTS" ${ARGN})
12
13 # Handle the spec file for the dll name
14 spec2def(${_halname}.dll ../hal.spec ADD_IMPORTLIB)
15
16 # Create the actual target
17 if(NOT MSVC)
18 foreach(_component ${_haldata_COMPONENTS})
19 list(APPEND _haldata_SOURCES "$<TARGET_OBJECTS:lib_hal_${_component}>")
20 endforeach()
21 add_library(${_halname} SHARED
22 ${_haldata_SOURCES}
23 ${CMAKE_CURRENT_BINARY_DIR}/hal.def)
24 else()
25 foreach(_component ${_haldata_COMPONENTS})
26 list(APPEND _haldata_LIBS "lib_hal_${_component}")
27 endforeach()
28 add_library(${_halname} SHARED
29 ${_haldata_SOURCES}
30 ${CMAKE_CURRENT_BINARY_DIR}/hal.def)
31 target_link_libraries(${_halname} ${_haldata_LIBS})
32 endif()
33
34 target_link_libraries(${_halname} libcntpr)
35 add_importlibs(${_halname} ntoskrnl)
36 #add_pch(${_halname} include/hal.h)
37 add_dependencies(${_halname} psdk bugcodes asm)
38 set_entrypoint(${_halname} HalInitSystem 8)
39 set_subsystem(${_halname} native)
40 set_image_base(${_halname} 0x00010000)
41 add_cd_file(TARGET ${_halname} DESTINATION reactos/system32 NO_CAB FOR all)
42 if(MSVC)
43 add_target_link_flags(${_halname} "/ignore:4216 /ignore:4078")
44 else()
45 target_link_libraries(${_halname} -lgcc)
46 endif()
47 endfunction()
48
49 # The components
50 include(generic.cmake)
51 include(acpi.cmake)
52 include(apic.cmake)
53
54 if(ARCH STREQUAL "i386")
55 include(pcidata.cmake)
56 include(legacy.cmake)
57 include(up.cmake)
58 include(pic.cmake)
59 include(minihal.cmake)
60
61 # hal
62 add_hal(hal SOURCES up/halup.rc COMPONENTS generic legacy up pic)
63 add_hal(halacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up pic)
64 add_hal(halapic SOURCES acpi/halacpi.rc COMPONENTS generic legacy up apic)
65 add_hal(halaacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi up apic)
66
67 #add_hal(halmps SOURCES up/halup.rc COMPONENTS generic legacy smp pic)
68 #add_hal(halmacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi smp pic)
69 #add_hal(halmapic SOURCES acpi/halacpi.rc COMPONENTS generic legacy smp apic)
70 #add_hal(halmaacpi SOURCES acpi/halacpi.rc COMPONENTS generic acpi smp apic)
71
72 elseif(ARCH STREQUAL "amd64")
73
74 list(APPEND HAL_SOURCE
75 generic/spinlock.c
76 amd64/x86bios.c
77 amd64/halinit.c
78 amd64/processor.c)
79
80 add_hal(hal SOURCES ${HAL_SOURCE} COMPONENTS generic acpi apic)
81
82 endif()