pyfstree 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. pyfstree-0.1.0/CMakeLists.txt +170 -0
  2. pyfstree-0.1.0/LICENSE +674 -0
  3. pyfstree-0.1.0/MANIFEST.in +25 -0
  4. pyfstree-0.1.0/PKG-INFO +128 -0
  5. pyfstree-0.1.0/README.rst +95 -0
  6. pyfstree-0.1.0/build.jolt +328 -0
  7. pyfstree-0.1.0/pyfstree.egg-info/PKG-INFO +128 -0
  8. pyfstree-0.1.0/pyfstree.egg-info/SOURCES.txt +58 -0
  9. pyfstree-0.1.0/pyfstree.egg-info/dependency_links.txt +1 -0
  10. pyfstree-0.1.0/pyfstree.egg-info/not-zip-safe +1 -0
  11. pyfstree-0.1.0/pyfstree.egg-info/requires.txt +1 -0
  12. pyfstree-0.1.0/pyfstree.egg-info/top_level.txt +1 -0
  13. pyfstree-0.1.0/pyproject.toml +58 -0
  14. pyfstree-0.1.0/python/fstree_python.cpp +142 -0
  15. pyfstree-0.1.0/requirements.txt +2 -0
  16. pyfstree-0.1.0/setup.cfg +4 -0
  17. pyfstree-0.1.0/setup.py +56 -0
  18. pyfstree-0.1.0/src/argparser.hpp +218 -0
  19. pyfstree-0.1.0/src/cache.cpp +556 -0
  20. pyfstree-0.1.0/src/cache.hpp +86 -0
  21. pyfstree-0.1.0/src/commit_ostream.hpp +31 -0
  22. pyfstree-0.1.0/src/directory_iterator.hpp +82 -0
  23. pyfstree-0.1.0/src/directory_iterator_posix.cpp +108 -0
  24. pyfstree-0.1.0/src/directory_iterator_std.cpp +97 -0
  25. pyfstree-0.1.0/src/directory_iterator_win32.cpp +111 -0
  26. pyfstree-0.1.0/src/event.cpp +80 -0
  27. pyfstree-0.1.0/src/event.hpp +14 -0
  28. pyfstree-0.1.0/src/filesystem.hpp +23 -0
  29. pyfstree-0.1.0/src/filesystem_posix.cpp +84 -0
  30. pyfstree-0.1.0/src/filesystem_win32.cpp +107 -0
  31. pyfstree-0.1.0/src/ignore.hpp +167 -0
  32. pyfstree-0.1.0/src/index.cpp +451 -0
  33. pyfstree-0.1.0/src/index.hpp +79 -0
  34. pyfstree-0.1.0/src/inode.cpp +129 -0
  35. pyfstree-0.1.0/src/inode.hpp +163 -0
  36. pyfstree-0.1.0/src/inode_posix.cpp +82 -0
  37. pyfstree-0.1.0/src/lock_file.hpp +41 -0
  38. pyfstree-0.1.0/src/lock_file_posix.cpp +53 -0
  39. pyfstree-0.1.0/src/lock_file_win32.cpp +56 -0
  40. pyfstree-0.1.0/src/main.cpp +399 -0
  41. pyfstree-0.1.0/src/remote.cpp +16 -0
  42. pyfstree-0.1.0/src/remote.hpp +38 -0
  43. pyfstree-0.1.0/src/remote_jolt.cpp +216 -0
  44. pyfstree-0.1.0/src/remote_jolt.hpp +31 -0
  45. pyfstree-0.1.0/src/semaphore.hpp +52 -0
  46. pyfstree-0.1.0/src/sha1.cpp +109 -0
  47. pyfstree-0.1.0/src/sha1.hpp +11 -0
  48. pyfstree-0.1.0/src/status.hpp +107 -0
  49. pyfstree-0.1.0/src/thread.cpp +18 -0
  50. pyfstree-0.1.0/src/thread.hpp +8 -0
  51. pyfstree-0.1.0/src/thread_pool.cpp +74 -0
  52. pyfstree-0.1.0/src/thread_pool.hpp +70 -0
  53. pyfstree-0.1.0/src/url.hpp +43 -0
  54. pyfstree-0.1.0/src/version.hpp +1 -0
  55. pyfstree-0.1.0/src/wait_group.hpp +113 -0
  56. pyfstree-0.1.0/test/test_config.cpp +26 -0
  57. pyfstree-0.1.0/test/test_ignore.cpp +135 -0
  58. pyfstree-0.1.0/test/test_ignore.txt +3 -0
  59. pyfstree-0.1.0/test/test_status.cpp +46 -0
  60. pyfstree-0.1.0/test/test_url.cpp +39 -0
@@ -0,0 +1,170 @@
1
+ cmake_minimum_required(VERSION 3.21)
2
+ project(fstree)
3
+
4
+ if(NOT CMAKE_BUILD_TYPE)
5
+ set(CMAKE_BUILD_TYPE Release)
6
+ endif()
7
+
8
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
9
+ set(CMAKE_CXX_FLAGS "/EHsc")
10
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
11
+ set(CMAKE_CXX_FLAGS_DEBUG "-g")
12
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Wextra -Werror -pedantic")
13
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
14
+ endif()
15
+
16
+
17
+ set(CMAKE_CXX_STANDARD 20)
18
+
19
+
20
+ ################################################################################
21
+ # Find dependencies
22
+ ################################################################################
23
+
24
+ find_package(Protobuf CONFIG REQUIRED)
25
+ find_package(gRPC CONFIG REQUIRED)
26
+ find_package(GTest CONFIG REQUIRED)
27
+
28
+
29
+ ################################################################################
30
+ # Build library
31
+ ################################################################################
32
+
33
+ set(SRCS
34
+ src/cache.cpp
35
+ src/event.cpp
36
+ src/index.cpp
37
+ src/inode.cpp
38
+ src/jolt.proto
39
+ src/remote.cpp
40
+ src/remote_jolt.cpp
41
+ src/sha1.cpp
42
+ src/thread.cpp
43
+ src/thread_pool.cpp
44
+ )
45
+
46
+ if (WIN32)
47
+ list(APPEND SRCS
48
+ src/directory_iterator_win32.cpp
49
+ src/filesystem_win32.cpp
50
+ src/lock_file_win32.cpp
51
+ )
52
+ else()
53
+ list(APPEND SRCS
54
+ src/directory_iterator_posix.cpp
55
+ src/filesystem_posix.cpp
56
+ src/lock_file_posix.cpp
57
+ )
58
+ endif()
59
+
60
+ add_library(fstreelib ${SRCS})
61
+
62
+ protobuf_generate(
63
+ TARGET
64
+ fstreelib
65
+ LANGUAGE
66
+ cpp
67
+ )
68
+
69
+ # compile the GRPC services
70
+ protobuf_generate(
71
+ TARGET
72
+ fstreelib
73
+ LANGUAGE
74
+ grpc
75
+ GENERATE_EXTENSIONS
76
+ .grpc.pb.h
77
+ .grpc.pb.cc
78
+ PLUGIN
79
+ "protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>"
80
+ )
81
+
82
+ target_include_directories(
83
+ fstreelib
84
+ PUBLIC
85
+ "${CMAKE_CURRENT_SOURCE_DIR}/src"
86
+ "${CMAKE_CURRENT_BINARY_DIR}"
87
+ "${CMAKE_CURRENT_BINARY_DIR}/src"
88
+ )
89
+
90
+ target_link_libraries(
91
+ fstreelib
92
+ gRPC::grpc++
93
+ protobuf::libprotobuf
94
+ )
95
+
96
+
97
+ ################################################################################
98
+ # Build executable
99
+ ################################################################################
100
+
101
+ add_executable(fstree src/main.cpp)
102
+
103
+ target_link_libraries(
104
+ fstree
105
+ PRIVATE
106
+ fstreelib
107
+ protobuf::libprotobuf
108
+ )
109
+
110
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
111
+ target_link_options(
112
+ fstree
113
+ PRIVATE
114
+ "-static"
115
+ )
116
+ endif()
117
+
118
+
119
+ install(
120
+ TARGETS
121
+ fstree
122
+ DESTINATION
123
+ bin
124
+ )
125
+
126
+ ################################################################################
127
+ # Build tests
128
+ ################################################################################
129
+
130
+ add_executable(
131
+ fstree_test
132
+ test/test_config.cpp
133
+ test/test_ignore.cpp
134
+ test/test_status.cpp
135
+ test/test_url.cpp
136
+ )
137
+
138
+ target_link_libraries(
139
+ fstree_test
140
+ PRIVATE
141
+ fstreelib
142
+ GTest::gtest
143
+ GTest::gtest_main
144
+ )
145
+
146
+ add_test(
147
+ NAME
148
+ fstree_test
149
+ COMMAND
150
+ fstree_test
151
+ )
152
+
153
+ install(
154
+ TARGETS
155
+ fstree_test
156
+ DESTINATION
157
+ bin
158
+ )
159
+
160
+ ################################################################################
161
+ # Python bindings (optional)
162
+ ################################################################################
163
+
164
+ option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
165
+
166
+ if(BUILD_PYTHON_BINDINGS)
167
+ add_subdirectory(python)
168
+ endif()
169
+
170
+ ################################################################################