[CMAKE]
[reactos.git] / hal / CMakeLists.txt
1
2 if(ARCH MATCHES i386)
3
4 add_definitions(-D_NTHALDLL_)
5 add_definitions(-D_NTHAL_)
6
7 include_directories(halx86/include)
8 include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
9
10 list(APPEND HAL_GENERIC_SOURCE
11 halx86/generic/beep.c
12 halx86/generic/cmos.c
13 halx86/generic/display.c
14 halx86/generic/dma.c
15 halx86/generic/drive.c
16 halx86/generic/memory.c
17 halx86/generic/misc.c
18 halx86/generic/profil.c
19 halx86/generic/reboot.c
20 halx86/generic/sysinfo.c
21 halx86/generic/timer.c
22 halx86/generic/usage.c)
23
24 list(APPEND HAL_GENERIC_SOURCE
25 halx86/generic/bios.c
26 halx86/generic/halinit.c
27 halx86/generic/i386/portio.c
28 halx86/generic/i386/systimer.S
29 halx86/generic/i386/trap.S)
30
31 list(APPEND HAL_GENERIC_PCAT_SOURCE
32 halx86/generic/legacy/bus/bushndlr.c
33 halx86/generic/legacy/bus/cmosbus.c
34 halx86/generic/legacy/bus/isabus.c
35 halx86/generic/legacy/bus/pcibus.c
36 halx86/generic/legacy/bus/pcidata.c
37 halx86/generic/legacy/bus/sysbus.c
38 halx86/generic/legacy/bussupp.c
39 halx86/generic/legacy/halpcat.c)
40
41 list(APPEND HAL_GENERIC_UP_SOURCE
42 halx86/generic/spinlock.c
43 halx86/up/pic.c
44 halx86/up/processor.c)
45
46
47
48 list(APPEND HAL_SOURCE
49 ${CMAKE_CURRENT_BINARY_DIR}/hal_hal.h.gch
50 ${HAL_GENERIC_SOURCE}
51 ${HAL_GENERIC_PCAT_SOURCE}
52 ${HAL_GENERIC_UP_SOURCE}
53 halx86/up/halinit_up.c
54 halx86/up/halup.rc)
55
56 add_library(hal SHARED ${HAL_SOURCE})
57 add_pch(hal ${CMAKE_CURRENT_SOURCE_DIR}/halx86/include/hal.h ${HAL_SOURCE})
58 add_dependencies(hal psdk bugcodes)
59
60 set_target_properties(hal PROPERTIES LINK_FLAGS "-Wl,-entry,_HalInitSystem@8 -Wl,--image-base,0x00010000 -Wl,--subsystem,native")
61
62 target_link_libraries(hal
63 ${CMAKE_CURRENT_SOURCE_DIR}/halx86/hal_i386.def
64 -lntoskrnl
65 libcntpr)
66
67 list(APPEND MINI_HAL_SOURCE
68 halx86/generic/legacy/bus/bushndlr.c
69 halx86/generic/legacy/bus/cmosbus.c
70 halx86/generic/legacy/bus/isabus.c
71 halx86/generic/legacy/bus/pcibus.c
72 halx86/generic/legacy/bus/pcidata.c
73 halx86/generic/legacy/bus/sysbus.c
74 halx86/generic/legacy/bussupp.c
75 halx86/generic/beep.c
76 halx86/generic/bios.c
77 halx86/generic/cmos.c
78 halx86/generic/dma.c
79 halx86/generic/display.c
80 halx86/generic/drive.c
81 halx86/generic/misc.c
82 halx86/generic/profil.c
83 halx86/generic/reboot.c
84 halx86/generic/spinlock.c
85 halx86/generic/sysinfo.c
86 halx86/generic/timer.c
87 halx86/generic/usage.c
88 halx86/up/halinit_up.c
89 halx86/up/pic.c
90 halx86/up/processor.c)
91
92 if(ARCH MATCHES i386)
93 list(APPEND MINI_HAL_SOURCE
94 halx86/generic/i386/portio.c
95 halx86/generic/i386/systimer.S)
96 endif(ARCH MATCHES i386)
97
98 add_library(mini_hal ${MINI_HAL_SOURCE})
99 set_property(TARGET mini_hal PROPERTY COMPILE_DEFINITIONS "_BLDR_;_MINIHAL_")
100 add_dependencies(mini_hal psdk bugcodes)
101
102 else()
103 #TBD
104 endif(ARCH MATCHES i386)