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