You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Not a CMake expert, and the current CMake build support added by this PR is
unlikely the best way of doing it. Sending out the PR to demonstrate it
can work.
Pull Request resolved: facebook#9214
Test Plan:
Will need to update https://github.com/ajkr/dedupfs with CMake build.
Also, PR facebook#9170 and PR facebook#9206 both include CMake support for their
plugins, and can be used as a proof of concept.
Reviewed By: ajkr
Differential Revision: D32738273
Pulled By: riversand963
fbshipit-source-id: da87fb4377c716bbbd577a69763b48d22483f845
Copy file name to clipboardexpand all lines: plugin/README.md
+19-1
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,32 @@ External plugins will be linked according to their name into a subdirectory of "
12
12
13
13
### Build standard
14
14
15
-
Currently the only supported build system is make. In the plugin directory, files ending in the .mk extension can define the following variables.
15
+
Currently the only supported build system are make and cmake.
16
+
17
+
For make, files in the plugin directory ending in the .mk extension can define the following variables.
16
18
17
19
*`$(PLUGIN_NAME)_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
18
20
*`$(PLUGIN_NAME)_HEADERS`: these files will be installed in the RocksDB header directory. Their paths will be prefixed by "rocksdb/plugin/$(PLUGIN_NAME)/".
19
21
*`$(PLUGIN_NAME)_LDFLAGS`: these flags will be passed to the final link step. For example, library dependencies can be propagated here, or symbols can be forcibly included, e.g., for static registration.
22
+
*`$(PLUGIN_NAME)_CXXFLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
20
23
21
24
Users will run the usual make commands from the RocksDB directory, specifying the plugins to include in a space-separated list in the variable `ROCKSDB_PLUGINS`.
22
25
26
+
For CMake, the CMakeLists.txt file in the plugin directory can define the following variables.
27
+
28
+
*`${PLUGIN_NAME}_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
29
+
*`${PLUGIN_NAME}_COMPILE_FLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
30
+
*`${PLUGIN_NAME}_INCLUDE_PATHS`: paths to directories to search for plugin-specific header files during compilation.
31
+
*`${PLUGIN_NAME}_LIBS`: list of library names required to build the plugin, e.g. `dl`, `java`, `jvm`, `rados`, etc. CMake will generate proper flags for linking.
32
+
*`${PLUGIN_NAME}_LINK_PATHS`: list of paths for the linker to search for required libraries in additional to standard locations.
33
+
*`${PLUGIN_NAME}_CMAKE_SHARED_LINKER_FLAGS` additional linker flags used to generate shared libraries. For example, symbols can be forcibly included, e.g., for static registration.
34
+
*`${PLUGIN_NAME}_CMAKE_EXE_LINKER_FLAGS`: additional linker flags used to generate executables. For example, symbols can be forcibly included, e.g., for static registration.
35
+
36
+
Users will run the usual cmake commands, specifying the plugins to include in a space-separated list in the command line variable `ROCKSDB_PLUGINS` when invoking cmake.
37
+
```
38
+
cmake .. -DROCKSDB_PLUGINS="dedupfs hdfs rados"
39
+
```
40
+
23
41
### Example
24
42
25
43
For a working example, see [Dedupfs](https://github.com/ajkr/dedupfs).
0 commit comments