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