xref: /reactos/dll/win32/kernel32/CMakeLists.txt (revision c948ea85)
1
2add_subdirectory(kernel32_vista)
3
4add_definitions(-D_KERNEL32_)
5include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys)
6spec2def(kernel32.dll kernel32.spec ADD_IMPORTLIB)
7
8# Shared between kernel32 and kernel32_vista
9add_library(kernel32_shared
10    client/shared_utils.c
11    client/file/fileutils.c
12)
13target_link_libraries(kernel32_shared PRIVATE pseh)
14add_dependencies(kernel32_shared psdk)
15
16list(APPEND SOURCE
17    client/actctx.c
18    client/appcache.c
19    client/atom.c
20    client/compname.c
21    client/debugger.c
22    client/dosdev.c
23    client/dllmain.c
24    client/environ.c
25    client/except.c
26    client/fiber.c
27    client/handle.c
28    client/heapmem.c
29    client/job.c
30    client/loader.c
31    client/path.c
32    client/perfcnt.c
33    client/power.c
34    client/proc.c
35    client/resntfy.c
36    client/session.c
37    client/synch.c
38    client/sysinfo.c
39    client/time.c
40    client/timerqueue.c
41    client/toolhelp.c
42    client/utils.c
43    client/thread.c
44    client/vdm.c
45    client/version.c
46    client/virtmem.c
47    client/console/alias.c
48    client/console/console.c
49    client/console/history.c
50    client/console/init.c
51    client/console/readwrite.c
52    client/file/backup.c
53    client/file/cnotify.c
54    client/file/copy.c
55    client/file/create.c
56    client/file/delete.c
57    client/file/deviceio.c
58    client/file/dir.c
59    client/file/disk.c
60    client/file/fileinfo.c
61    client/file/filemap.c
62    client/file/filename.c
63    client/file/find.c
64    client/file/hardlink.c
65    client/file/iocompl.c
66    client/file/lfile.c
67    client/file/lock.c
68    client/file/mailslot.c
69    client/file/move.c
70    client/file/mntpoint.c
71    client/file/npipe.c
72    client/file/rw.c
73    client/file/tape.c
74    client/file/volume.c
75    wine/actctx.c
76    wine/comm.c
77    wine/lzexpand.c
78    wine/muldiv.c
79    wine/profile.c
80    wine/res.c
81    wine/timezone.c
82    winnls/string/casemap.c
83    winnls/string/collation.c
84    winnls/string/digitmap.c
85    winnls/string/fold.c
86    winnls/string/format_msg.c
87    winnls/string/japanese.c
88    winnls/string/locale.c
89    winnls/string/lcformat.c
90    winnls/string/lstring.c
91    winnls/string/nls.c
92    winnls/string/sortkey.c
93    k32.h)
94
95if(MSVC)
96    # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
97    set_source_files_properties(wine/res.c PROPERTIES COMPILE_OPTIONS "/wd4146")
98
99    # Disable warning C4267: 'initializing': conversion from 'size_t' to 'DWORD', possible loss of data
100    set_source_files_properties(winnls/string/locale.c PROPERTIES COMPILE_OPTIONS "/wd4267")
101else()
102    # Disable warning: 'variable' defined but not used
103    set_source_files_properties(winnls/string/locale.c PROPERTIES COMPILE_OPTIONS "-Wno-unused-variable")
104endif()
105
106if(ARCH STREQUAL "i386")
107    list(APPEND ASM_SOURCE
108        client/i386/fiber.S
109        client/i386/thread.S)
110elseif(ARCH STREQUAL "amd64")
111    list(APPEND ASM_SOURCE
112        client/amd64/fiber.S)
113elseif(ARCH STREQUAL "arm")
114    list(APPEND ASM_SOURCE
115        client/arm/fiber.S
116        client/arm/thread.S)
117endif()
118
119add_asm_files(kernel32_asm ${ASM_SOURCE})
120add_library(kernel32 MODULE
121    ${SOURCE}
122    ${kernel32_asm}
123    kernel32.rc
124    ${CMAKE_CURRENT_BINARY_DIR}/kernel32_stubs.c
125    ${CMAKE_CURRENT_BINARY_DIR}/kernel32.def)
126
127set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12)
128#############################################
129## HACK FOR MSVC COMPILATION WITH win32dll ##
130set_subsystem(kernel32 console)
131################# END  HACK #################
132
133target_link_libraries(kernel32 kernel32_vista_static kernel32_shared wine chkstk ${PSEH_LIB})
134add_importlibs(kernel32 ntdll)
135add_pch(kernel32 k32.h SOURCE)
136add_dependencies(kernel32 psdk errcodes asm)
137add_cd_file(TARGET kernel32 DESTINATION reactos/system32 FOR all)
138