[Win32SS]
[reactos.git] / reactos / win32ss / CMakeLists.txt
1
2 set(USE_DIBLIB FALSE)
3
4 if(NOT MSVC)
5 # HACK: this should be enabled globally!
6 add_compile_flags_language("-std=c++11" "CXX")
7 endif()
8
9 # Give WIN32 subsystem its own project.
10 PROJECT(WIN32SS)
11
12 add_subdirectory(drivers)
13
14 if(USE_DIBLIB)
15 add_subdirectory(gdi/diblib)
16 endif()
17
18 add_subdirectory(gdi/gdi32)
19 add_subdirectory(reactx)
20 add_subdirectory(user/user32)
21 add_subdirectory(user/winsrv)
22
23 spec2def(win32k.sys win32k.spec ADD_IMPORTLIB)
24
25 include_directories(
26 .
27 include
28 ${REACTOS_SOURCE_DIR}/ntoskrnl/include
29 ${REACTOS_SOURCE_DIR}/lib/3rdparty/freetype/include
30 ${REACTOS_SOURCE_DIR}/include/reactos/subsys
31 ${REACTOS_SOURCE_DIR}/include/reactos/drivers)
32
33 add_definitions(
34 -DLANGPACK
35 -D_WIN32K_)
36
37 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gdi/dib)
38
39 list(APPEND GENDIB_FILES
40 ${CMAKE_CURRENT_BINARY_DIR}/gdi/dib/dib8gen.c
41 ${CMAKE_CURRENT_BINARY_DIR}/gdi/dib/dib16gen.c
42 ${CMAKE_CURRENT_BINARY_DIR}/gdi/dib/dib32gen.c)
43
44 add_custom_command(
45 OUTPUT ${GENDIB_FILES}
46 COMMAND native-gendib ${CMAKE_CURRENT_BINARY_DIR}/gdi/dib
47 DEPENDS native-gendib)
48
49 list(APPEND SOURCE
50 gdi/dib/alphablend.c
51 gdi/dib/dib1bpp.c
52 gdi/dib/dib4bpp.c
53 gdi/dib/dib8bpp.c
54 gdi/dib/dib16bpp.c
55 gdi/dib/dib24bpp.c
56 gdi/dib/dib32bpp.c
57 gdi/dib/floodfill.c
58 gdi/dib/stretchblt.c
59 gdi/eng/alphablend.c
60 gdi/eng/bitblt.c
61 gdi/eng/engbrush.c
62 gdi/eng/engevent.c
63 gdi/eng/clip.c
64 gdi/eng/debug.c
65 gdi/eng/device.c
66 gdi/eng/driverobj.c
67 gdi/eng/error.c
68 gdi/eng/float.c
69 gdi/eng/gradient.c
70 gdi/eng/lineto.c
71 gdi/eng/ldevobj.c
72 gdi/eng/mapping.c
73 gdi/eng/math.c
74 gdi/eng/mem.c
75 gdi/eng/engmisc.c
76 gdi/eng/mouse.c
77 gdi/eng/paint.c
78 gdi/eng/pdevobj.c
79 gdi/eng/perfcnt.c
80 gdi/eng/rlecomp.c
81 gdi/eng/semaphor.c
82 gdi/eng/sort.c
83 gdi/eng/string.c
84 gdi/eng/stretchblt.c
85 gdi/eng/surface.c
86 gdi/eng/transblt.c
87 gdi/eng/engwindow.c
88 gdi/eng/xlateobj.c
89 user/ntuser/main.c
90 user/ntuser/misc/file.c
91 user/ntuser/misc/rtlstr.c
92 user/ntuser/misc/copy.c
93 user/ntuser/misc/registry.c
94 reactx/ntddraw/ddraw.c
95 reactx/ntddraw/dd.c
96 reactx/ntddraw/ddsurf.c
97 reactx/ntddraw/d3d.c
98 reactx/ntddraw/dvp.c
99 reactx/ntddraw/mocomp.c
100 reactx/ntddraw/eng.c
101 reactx/ntddraw/dxeng.c
102 user/ntuser/accelerator.c
103 user/ntuser/callback.c
104 user/ntuser/callproc.c
105 user/ntuser/caret.c
106 user/ntuser/class.c
107 user/ntuser/clipboard.c
108 user/ntuser/console.c
109 user/ntuser/csr.c
110 user/ntuser/cursoricon.c
111 user/ntuser/dde.c
112 user/ntuser/defwnd.c
113 user/ntuser/desktop.c
114 user/ntuser/display.c
115 user/ntuser/draw.c
116 user/ntuser/event.c
117 user/ntuser/focus.c
118 user/ntuser/guicheck.c
119 user/ntuser/hook.c
120 user/ntuser/hotkey.c
121 user/ntuser/input.c
122 user/ntuser/ime.c
123 user/ntuser/keyboard.c
124 user/ntuser/kbdlayout.c
125 user/ntuser/menu.c
126 user/ntuser/message.c
127 user/ntuser/metric.c
128 user/ntuser/misc.c
129 user/ntuser/monitor.c
130 user/ntuser/mouse.c
131 user/ntuser/msgqueue.c
132 user/ntuser/nonclient.c
133 user/ntuser/ntstubs.c
134 user/ntuser/ntuser.c
135 user/ntuser/painting.c
136 user/ntuser/prop.c
137 user/ntuser/scrollbar.c
138 user/ntuser/scrollex.c
139 user/ntuser/session.c
140 user/ntuser/shutdown.c
141 user/ntuser/simplecall.c
142 user/ntuser/sysparams.c
143 user/ntuser/timer.c
144 user/ntuser/useratom.c
145 user/ntuser/usrheap.c
146 user/ntuser/vis.c
147 user/ntuser/windc.c
148 user/ntuser/window.c
149 user/ntuser/winpos.c
150 user/ntuser/winsta.c
151 user/ntuser/object.c
152 gdi/ntgdi/arc.c
153 gdi/ntgdi/bezier.c
154 gdi/ntgdi/bitblt.c
155 gdi/ntgdi/bitmaps.c
156 gdi/ntgdi/cliprgn.c
157 gdi/ntgdi/coord.c
158 gdi/ntgdi/dcattr.c
159 gdi/ntgdi/dclife.c
160 gdi/ntgdi/dcobjs.c
161 gdi/ntgdi/dcstate.c
162 gdi/ntgdi/dcutil.c
163 gdi/ntgdi/device.c
164 gdi/ntgdi/dibobj.c
165 gdi/ntgdi/drawing.c
166 gdi/ntgdi/fillshap.c
167 gdi/ntgdi/font.c
168 gdi/ntgdi/freetype.c
169 gdi/ntgdi/gdibatch.c
170 gdi/ntgdi/gdidbg.c
171 gdi/ntgdi/gdiobj.c
172 gdi/ntgdi/gdipool.c
173 gdi/ntgdi/icm.c
174 gdi/ntgdi/init.c
175 gdi/ntgdi/line.c
176 gdi/ntgdi/metafile.c
177 gdi/ntgdi/palette.c
178 gdi/ntgdi/path.c
179 gdi/ntgdi/pen.c
180 gdi/ntgdi/polyfill.c
181 gdi/ntgdi/print.c
182 gdi/ntgdi/rect.c
183 gdi/ntgdi/region.c
184 gdi/ntgdi/stockobj.c
185 gdi/ntgdi/text.c
186 gdi/ntgdi/wingl.c
187 gdi/ntgdi/xformobj.c
188 gdi/eng/stubs.c
189 gdi/eng/umpdstubs.c
190 pch.h)
191
192 if(USE_DIBLIB)
193 add_definitions(-D_USE_DIBLIB_)
194 list(APPEND SOURCE
195 gdi/dib/dib_new.c
196 gdi/eng/bitblt_new.c)
197 else()
198 list(APPEND SOURCE
199 gdi/dib/dib.c
200 gdi/eng/copybits.c
201 ${GENDIB_FILES})
202 endif()
203
204 if(ARCH STREQUAL "i386")
205 list(APPEND ASM_SOURCE
206 gdi/dib/i386/dib24bpp_hline.s
207 gdi/dib/i386/dib32bpp_hline.s
208 gdi/dib/i386/dib32bpp_colorfill.s
209 gdi/eng/i386/floatobj.S)
210 else()
211 list(APPEND SOURCE
212 gdi/dib/dib24bppc.c
213 gdi/dib/dib32bppc.c)
214 endif()
215
216 if(KDBG)
217 list(APPEND SOURCE gdi/ntgdi/gdikdbgext.c)
218 endif()
219
220 add_asm_files(win32k_asm ${ASM_SOURCE})
221
222 add_library(win32k SHARED
223 ${SOURCE}
224 gdi/ntgdi/brush.cpp
225 ${win32k_asm}
226 win32k.rc
227 ${CMAKE_CURRENT_BINARY_DIR}/win32k.def)
228
229 set_module_type(win32k kernelmodedriver)
230 target_link_libraries(win32k ${PSEH_LIB} dxguid libcntpr)
231
232 if(USE_DIBLIB)
233 target_link_libraries(win32k diblib)
234 endif()
235
236 add_importlibs(win32k ntoskrnl hal ftfd)
237 add_pch(win32k pch.h SOURCE)
238 add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all)
239
240 set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h)
241 add_asm_files(win32ksys_asm sys-stubs.S)
242 add_library(win32ksys ${win32ksys_asm})
243 set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")