xref: /reactos/win32ss/CMakeLists.txt (revision 0c42866e)
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/mem.c
77    gdi/eng/engmisc.c
78    gdi/eng/mouse.c
79    gdi/eng/paint.c
80    gdi/eng/pathobj.c
81    gdi/eng/pdevobj.c
82    gdi/eng/perfcnt.c
83    gdi/eng/rlecomp.c
84    gdi/eng/semaphor.c
85    gdi/eng/sort.c
86    gdi/eng/string.c
87    gdi/eng/stretchblt.c
88    gdi/eng/surface.c
89    gdi/eng/transblt.c
90    gdi/eng/engwindow.c
91    gdi/eng/xlateobj.c
92    user/ntuser/main.c
93    user/ntuser/misc/file.c
94    user/ntuser/misc/rtlstr.c
95    user/ntuser/misc/copy.c
96    user/ntuser/misc/registry.c
97    reactx/ntddraw/ddraw.c
98    reactx/ntddraw/dd.c
99    reactx/ntddraw/ddsurf.c
100    reactx/ntddraw/d3d.c
101    reactx/ntddraw/d3dkmt.c
102    reactx/ntddraw/dvp.c
103    reactx/ntddraw/mocomp.c
104    reactx/ntddraw/eng.c
105    reactx/ntddraw/dxeng.c
106    user/ntuser/accelerator.c
107    user/ntuser/callback.c
108    user/ntuser/callproc.c
109    user/ntuser/caret.c
110    user/ntuser/class.c
111    user/ntuser/clipboard.c
112    user/ntuser/console.c
113    user/ntuser/csr.c
114    user/ntuser/cursoricon.c
115    user/ntuser/dde.c
116    user/ntuser/defwnd.c
117    user/ntuser/desktop.c
118    user/ntuser/display.c
119    user/ntuser/draw.c
120    user/ntuser/event.c
121    user/ntuser/focus.c
122    user/ntuser/ghost.c
123    user/ntuser/guicheck.c
124    user/ntuser/hook.c
125    user/ntuser/hotkey.c
126    user/ntuser/input.c
127    user/ntuser/ime.c
128    user/ntuser/keyboard.c
129    user/ntuser/kbdlayout.c
130    user/ntuser/layered.c
131    user/ntuser/menu.c
132    user/ntuser/message.c
133    user/ntuser/metric.c
134    user/ntuser/misc.c
135    user/ntuser/monitor.c
136    user/ntuser/mouse.c
137    user/ntuser/msgqueue.c
138    user/ntuser/nonclient.c
139    user/ntuser/ntstubs.c
140    user/ntuser/ntuser.c
141    user/ntuser/painting.c
142    user/ntuser/prop.c
143    user/ntuser/scrollbar.c
144    user/ntuser/scrollex.c
145    user/ntuser/session.c
146    user/ntuser/shutdown.c
147    user/ntuser/simplecall.c
148    user/ntuser/sysparams.c
149    user/ntuser/timer.c
150    user/ntuser/useratom.c
151    user/ntuser/usrheap.c
152    user/ntuser/vis.c
153    user/ntuser/windc.c
154    user/ntuser/window.c
155    user/ntuser/winpos.c
156    user/ntuser/winsta.c
157    user/ntuser/object.c
158    user/rtl/text.c
159    gdi/ntgdi/arc.c
160    gdi/ntgdi/bezier.c
161    gdi/ntgdi/bitblt.c
162    gdi/ntgdi/bitmaps.c
163    gdi/ntgdi/cliprgn.c
164    gdi/ntgdi/coord.c
165    gdi/ntgdi/dcattr.c
166    gdi/ntgdi/dclife.c
167    gdi/ntgdi/dcobjs.c
168    gdi/ntgdi/dcstate.c
169    gdi/ntgdi/dcutil.c
170    gdi/ntgdi/device.c
171    gdi/ntgdi/dibobj.c
172    gdi/ntgdi/drawing.c
173    gdi/ntgdi/fillshap.c
174    gdi/ntgdi/font.c
175    gdi/ntgdi/freetype.c
176    gdi/ntgdi/gdibatch.c
177    gdi/ntgdi/gdidbg.c
178    gdi/ntgdi/gdiobj.c
179    gdi/ntgdi/gdipool.c
180    gdi/ntgdi/icm.c
181    gdi/ntgdi/init.c
182    gdi/ntgdi/line.c
183    gdi/ntgdi/metafile.c
184    gdi/ntgdi/palette.c
185    gdi/ntgdi/path.c
186    gdi/ntgdi/pen.c
187    gdi/ntgdi/polyfill.c
188    gdi/ntgdi/print.c
189    gdi/ntgdi/rect.c
190    gdi/ntgdi/region.c
191    gdi/ntgdi/stockobj.c
192    gdi/ntgdi/text.c
193    gdi/ntgdi/wingl.c
194    gdi/ntgdi/xformobj.c
195    gdi/eng/stubs.c
196    gdi/eng/umpdstubs.c
197    pch.h)
198
199if(USE_DIBLIB)
200    add_definitions(-D_USE_DIBLIB_)
201    list(APPEND SOURCE
202        gdi/dib/dib_new.c
203        gdi/eng/bitblt_new.c)
204else()
205    list(APPEND SOURCE
206        gdi/dib/dib.c
207        gdi/eng/copybits.c
208        ${GENDIB_FILES})
209endif()
210
211if(ARCH STREQUAL "i386")
212list(APPEND ASM_SOURCE
213    gdi/dib/i386/dib24bpp_hline.s
214    gdi/dib/i386/dib32bpp_hline.s
215    gdi/dib/i386/dib32bpp_colorfill.s
216    gdi/eng/i386/floatobj.S)
217list(APPEND SOURCE gdi/eng/i386/floatobj.c)
218else()
219list(APPEND SOURCE
220    gdi/dib/dib24bppc.c
221    gdi/dib/dib32bppc.c)
222endif()
223
224if(KDBG)
225    list(APPEND SOURCE gdi/ntgdi/gdikdbgext.c)
226endif()
227
228add_asm_files(win32k_asm ${ASM_SOURCE})
229
230add_library(win32k MODULE
231    ${SOURCE}
232    gdi/ntgdi/brush.cpp
233    ${win32k_asm}
234    win32k.rc
235    ${CMAKE_CURRENT_BINARY_DIR}/win32k.def)
236
237set_module_type(win32k kernelmodedriver)
238target_link_libraries(win32k ${PSEH_LIB} dxguid libcntpr)
239
240if(USE_DIBLIB)
241    target_link_libraries(win32k diblib)
242endif()
243
244add_importlibs(win32k ntoskrnl hal ftfd)
245add_pch(win32k pch.h SOURCE)
246add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all)
247
248set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h)
249add_asm_files(win32ksys_asm sys-stubs.S)
250add_library(win32ksys ${win32ksys_asm})
251set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")
252add_dependencies(win32ksys asm)
253