forked from emcrisostomo/fswatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibfswatch.py
52 lines (43 loc) · 1.59 KB
/
libfswatch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import msvc
def build_project(target: str) -> msvc.Project:
root_directory = msvc._Path_Dir(__file__)
fswatch = msvc.Project(
name = 'fswatch',
type = msvc.ProjectType.LIB,
config = msvc.Config(msvc.ConfigType.Debug),
source_directory = msvc._Path_Join(root_directory, 'libfswatch/src'),
build_directory = msvc._Path_Join(root_directory, '.build'),
tests_directory = msvc._Path_Join(root_directory, 'test')
)
fswatch.config.cflags[2] = msvc._CFlag.W2 # TODO: ?
if target == 'test':
fswatch.test()
exit(0)
if target != 'build':
fswatch.clean()
fswatch.add_sources([
'libfswatch/c/windows/realpath.c',
'libfswatch/c/cevent.cpp',
'libfswatch/c/libfswatch_log.cpp',
'libfswatch/c/libfswatch.cpp',
'libfswatch/c++/windows/win_strings.cpp',
'libfswatch/c++/windows/win_paths.cpp',
'libfswatch/c++/windows/win_error_message.cpp',
'libfswatch/c++/windows/win_handle.cpp',
'libfswatch/c++/windows/win_directory_change_event.cpp',
'libfswatch/c++/string/string_utils.cpp',
'libfswatch/c++/libfswatch_exception.cpp',
'libfswatch/c++/event.cpp',
'libfswatch/c++/filter.cpp',
'libfswatch/c++/path_utils.cpp',
'libfswatch/c++/windows_monitor.cpp',
'libfswatch/c++/monitor.cpp',
'libfswatch/c++/monitor_factory.cpp',
'fswatch.ixx',
'fswatch.cxx'
])
fswatch.build()
return fswatch
if __name__ == '__main__':
target = msvc._Parse_Target()
build_project(target)