1
2include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/drivers
3                    inc)
4
5list(APPEND SOURCE
6    src/init.c
7    src/ext3/generic.c
8    src/ext3/htree.c
9    src/ext3/indirect.c
10    src/ext3/recover.c
11    src/ext4/ext4_bh.c
12    src/ext4/ext4_extents.c
13    src/ext4/ext4_jbd2.c
14    src/ext4/ext4_xattr.c
15    src/ext4/extents.c
16    src/jbd/recovery.c
17    src/jbd/replay.c
18    src/jbd/revoke.c
19    src/nls/nls_ascii.c
20    src/nls/nls_base.c
21    src/nls/nls_cp437.c
22    src/nls/nls_cp737.c
23    src/nls/nls_cp775.c
24    src/nls/nls_cp850.c
25    src/nls/nls_cp852.c
26    src/nls/nls_cp855.c
27    src/nls/nls_cp857.c
28    src/nls/nls_cp860.c
29    src/nls/nls_cp861.c
30    src/nls/nls_cp862.c
31    src/nls/nls_cp863.c
32    src/nls/nls_cp864.c
33    src/nls/nls_cp865.c
34    src/nls/nls_cp866.c
35    src/nls/nls_cp869.c
36    src/nls/nls_cp874.c
37    src/nls/nls_cp932.c
38    src/nls/nls_cp936.c
39    src/nls/nls_cp949.c
40    src/nls/nls_cp950.c
41    src/nls/nls_cp1250.c
42    src/nls/nls_cp1251.c
43    src/nls/nls_cp1255.c
44    src/nls/nls_euc-jp.c
45    src/nls/nls_iso8859-1.c
46    src/nls/nls_iso8859-2.c
47    src/nls/nls_iso8859-3.c
48    src/nls/nls_iso8859-4.c
49    src/nls/nls_iso8859-5.c
50    src/nls/nls_iso8859-6.c
51    src/nls/nls_iso8859-7.c
52    src/nls/nls_iso8859-9.c
53    src/nls/nls_iso8859-13.c
54    src/nls/nls_iso8859-14.c
55    src/nls/nls_iso8859-15.c
56    src/nls/nls_koi8-r.c
57    src/nls/nls_koi8-ru.c
58    src/nls/nls_koi8-u.c
59    src/nls/nls_utf8.c
60    src/access.c
61    src/block.c
62    src/cleanup.c
63    src/close.c
64    src/cmcb.c
65    src/create.c
66    src/debug.c
67    src/devctl.c
68    src/dirctl.c
69    src/dispatch.c
70    src/ea.c
71    src/except.c
72    src/fastio.c
73    src/fileinfo.c
74    src/flush.c
75    src/fsctl.c
76    src/linux.c
77    src/lock.c
78    src/memory.c
79    src/misc.c
80    src/nls.c
81    src/pnp.c
82    src/rbtree.c
83    src/read.c
84    src/shutdown.c
85    src/volinfo.c
86    src/write.c
87    inc/ext2fs.h)
88
89add_library(ext2fs SHARED ${SOURCE} ext2fs.rc)
90
91if(USE_CLANG_CL)
92    set_property(SOURCE src/create.c src/fileinfo.c src/memory.c src/read.c APPEND_STRING PROPERTY COMPILE_FLAGS " /fallback")
93endif()
94
95if(MSVC AND (NOT USE_CLANG_CL))
96    # Disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include"
97    replace_compile_flags("/we\"4189\"" " ")
98    add_target_compile_flags(ext2fs "/wd\"4189\" /wd\"4142\" /wd\"4101\"")
99else()
100    add_target_compile_flags(ext2fs "-Wno-pointer-sign -Wno-unused-function")
101    add_target_compile_flags(ext2fs "-Wno-unused-variable -Wno-missing-braces")
102    if(USE_CLANG_CL)
103        add_target_compile_flags(ext2fs "-Wno-unused-value -Wno-parentheses-equality")
104        add_target_compile_flags(ext2fs "-Wno-incompatible-pointer-types-discards-qualifiers")
105        add_target_compile_flags(ext2fs "-Wno-#pragma-messages -Wno-cast-calling-convention")
106    else()
107        add_target_compile_flags(ext2fs "-Wno-unused-but-set-variable")
108    endif()
109endif()
110
111target_link_libraries(ext2fs memcmp ${PSEH_LIB})
112add_definitions(-D__KERNEL__)
113set_module_type(ext2fs kernelmodedriver)
114add_importlibs(ext2fs ntoskrnl hal)
115
116if(NOT USE_CLANG_CL)
117    # The fallback we have above prevents cl and clang-cl from using the same PCH
118    add_pch(ext2fs inc/ext2fs.h SOURCE)
119endif()
120
121add_cd_file(TARGET ext2fs DESTINATION reactos/system32/drivers FOR all)
122