[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 add_library(hal_generic ${HAL_GENERIC_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/hal_generic_hal.h.gch)
32 add_pch(hal_generic ${CMAKE_CURRENT_SOURCE_DIR}/halx86/include/hal.h ${HAL_GENERIC_SOURCE})
33 add_dependencies(hal_generic psdk bugcodes)
34
35 list(APPEND HAL_GENERIC_PCAT_SOURCE
36 halx86/generic/legacy/bus/bushndlr.c
37 halx86/generic/legacy/bus/cmosbus.c
38 halx86/generic/legacy/bus/isabus.c
39 halx86/generic/legacy/bus/pcibus.c
40 halx86/generic/legacy/bus/pcidata.c
41 halx86/generic/legacy/bus/sysbus.c
42 halx86/generic/legacy/bussupp.c
43 halx86/generic/legacy/halpcat.c)
44
45 add_library(hal_generic_pcat ${HAL_GENERIC_PCAT_SOURCE})
46 add_dependencies(hal_generic_pcat psdk)
47
48 list(APPEND HAL_GENERIC_UP_SOURCE
49 halx86/generic/spinlock.c
50 halx86/up/pic.c
51 halx86/up/processor.c)
52
53 add_library(hal_generic_up ${HAL_GENERIC_UP_SOURCE})
54 add_dependencies(hal_generic_up psdk)
55
56 set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
57
58 add_library(hal SHARED halx86/up/halinit_up.c halx86/up/halup.rc)
59
60 set_target_properties(hal PROPERTIES LINK_FLAGS "-Wl,-entry,_HalInitSystem@8")
61
62 target_link_libraries(hal
63 ${CMAKE_CURRENT_SOURCE_DIR}/halx86/hal_i386.def
64 -Wl,--whole-archive hal_generic -Wl,--no-whole-archive
65 hal_generic_pcat
66 hal_generic_up
67 ${REACTOS_SOURCE_DIR}/ntoskrnl/libntoskrnl.a
68 libcntpr)
69
70 list(APPEND MINI_HAL_SOURCE
71 halx86/generic/legacy/bus/bushndlr.c
72 halx86/generic/legacy/bus/cmosbus.c
73 halx86/generic/legacy/bus/isabus.c
74 halx86/generic/legacy/bus/pcibus.c
75 halx86/generic/legacy/bus/pcidata.c
76 halx86/generic/legacy/bus/sysbus.c
77 halx86/generic/legacy/bussupp.c
78 halx86/generic/beep.c
79 halx86/generic/bios.c
80 halx86/generic/cmos.c
81 halx86/generic/dma.c
82 halx86/generic/display.c
83 halx86/generic/drive.c
84 halx86/generic/misc.c
85 halx86/generic/profil.c
86 halx86/generic/reboot.c
87 halx86/generic/spinlock.c
88 halx86/generic/sysinfo.c
89 halx86/generic/timer.c
90 halx86/generic/usage.c
91 halx86/up/halinit_up.c
92 halx86/up/pic.c
93 halx86/up/processor.c)
94
95 if(ARCH MATCHES i386)
96 list(APPEND MINI_HAL_SOURCE
97 halx86/generic/i386/portio.c
98 halx86/generic/i386/systimer.S)
99 endif(ARCH MATCHES i386)
100
101 add_library(mini_hal ${MINI_HAL_SOURCE})
102 set_property(TARGET mini_hal PROPERTY COMPILE_DEFINITIONS _BLDR_ _MINIHAL_)
103 add_dependencies(mini_hal psdk bugcodes)
104
105 else()
106 #TBD
107 endif(ARCH MATCHES i386)