xref: /reactos/win32ss/CMakeLists.txt (revision 3dcae2ce)
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/prop.c
151    user/ntuser/scrollbar.c
152    user/ntuser/scrollex.c
153    user/ntuser/security.c
154    user/ntuser/session.c
155    user/ntuser/shutdown.c
156    user/ntuser/simplecall.c
157    user/ntuser/sysparams.c
158    user/ntuser/timer.c
159    user/ntuser/useratom.c
160    user/ntuser/usrheap.c
161    user/ntuser/vis.c
162    user/ntuser/windc.c
163    user/ntuser/window.c
164    user/ntuser/winpos.c
165    user/ntuser/winsta.c
166    user/ntuser/object.c
167    user/rtl/image.c
168    user/rtl/text.c
169    gdi/ntgdi/arc.c
170    gdi/ntgdi/bezier.c
171    gdi/ntgdi/bitblt.c
172    gdi/ntgdi/bitmaps.c
173    gdi/ntgdi/cliprgn.c
174    gdi/ntgdi/coord.c
175    gdi/ntgdi/dcattr.c
176    gdi/ntgdi/dclife.c
177    gdi/ntgdi/dcobjs.c
178    gdi/ntgdi/dcstate.c
179    gdi/ntgdi/dcutil.c
180    gdi/ntgdi/device.c
181    gdi/ntgdi/dibobj.c
182    gdi/ntgdi/drawing.c
183    gdi/ntgdi/fillshap.c
184    gdi/ntgdi/font.c
185    gdi/ntgdi/freetype.c
186    gdi/ntgdi/gdibatch.c
187    gdi/ntgdi/gdidbg.c
188    gdi/ntgdi/gdiobj.c
189    gdi/ntgdi/gdipool.c
190    gdi/ntgdi/icm.c
191    gdi/ntgdi/init.c
192    gdi/ntgdi/line.c
193    gdi/ntgdi/metafile.c
194    gdi/ntgdi/palette.c
195    gdi/ntgdi/path.c
196    gdi/ntgdi/pen.c
197    gdi/ntgdi/polyfill.c
198    gdi/ntgdi/print.c
199    gdi/ntgdi/rect.c
200    gdi/ntgdi/region.c
201    gdi/ntgdi/stockobj.c
202    gdi/ntgdi/text.c
203    gdi/ntgdi/wingl.c
204    gdi/ntgdi/xformobj.c
205    gdi/eng/stubs.c
206    gdi/eng/umpdstubs.c
207    pch.h)
208
209if(USE_DIBLIB)
210    add_definitions(-D_USE_DIBLIB_)
211    list(APPEND SOURCE
212        gdi/dib/dib_new.c
213        gdi/eng/bitblt_new.c)
214else()
215    list(APPEND SOURCE
216        gdi/dib/dib.c
217        gdi/eng/copybits.c
218        ${GENDIB_FILES})
219endif()
220
221if(ARCH STREQUAL "i386")
222list(APPEND ASM_SOURCE
223    gdi/dib/i386/dib24bpp_hline.s
224    gdi/dib/i386/dib32bpp_hline.s
225    gdi/dib/i386/dib32bpp_colorfill.s
226    gdi/eng/i386/floatobj.S)
227list(APPEND SOURCE gdi/eng/i386/floatobj.c)
228else()
229list(APPEND SOURCE
230    gdi/dib/dib24bppc.c
231    gdi/dib/dib32bppc.c)
232endif()
233
234if(KDBG)
235    add_definitions(-DKDBG)
236    list(APPEND SOURCE gdi/ntgdi/gdikdbgext.c)
237endif()
238
239add_asm_files(win32k_asm ${ASM_SOURCE})
240
241add_library(win32k MODULE
242    ${SOURCE}
243    gdi/ntgdi/brush.cpp
244    ${win32k_asm}
245    win32k.rc
246    ${CMAKE_CURRENT_BINARY_DIR}/win32k.def)
247
248set_module_type(win32k kernelmodedriver)
249target_link_libraries(win32k ${PSEH_LIB} dxguid libcntpr)
250
251if(USE_DIBLIB)
252    target_link_libraries(win32k diblib)
253endif()
254
255add_importlibs(win32k ntoskrnl hal ftfd)
256add_pch(win32k pch.h SOURCE)
257add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all)
258
259if(ARCH STREQUAL "amd64")
260    set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc64.h)
261else()
262    set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc32.h)
263endif()
264add_asm_files(win32ksys_asm sys-stubs.S)
265add_library(win32ksys ${win32ksys_asm})
266set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")
267add_dependencies(win32ksys asm)
268