-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: add option WITH_CORE_TOOLS to exclude tools except ldb and sst…
…_dump (#6506) Summary: ldb and sst_dump are most important tools and they don't dependend on gflags. In cmake, we don't have an way to only build these two tools and exclude other tools. This is inconvenient if the environment has a problem with gflags. Add such an option WITH_CORE_TOOLS. Pull Request resolved: #6506 Test Plan: cmake and build with WITH_TOOLS and without. Differential Revision: D20473029 fbshipit-source-id: 3d730fd14bbae6eeeae7f9cc9aec50a4e488ad72
- Loading branch information
Showing
2 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
set(TOOLS | ||
set(CORE_TOOLS | ||
sst_dump.cc | ||
db_sanity_test.cc | ||
write_stress.cc | ||
ldb.cc | ||
db_repl_stress.cc | ||
dump/rocksdb_dump.cc | ||
dump/rocksdb_undump.cc) | ||
foreach(src ${TOOLS}) | ||
ldb.cc) | ||
foreach(src ${CORE_TOOLS}) | ||
get_filename_component(exename ${src} NAME_WE) | ||
add_executable(${exename}${ARTIFACT_SUFFIX} | ||
${src}) | ||
target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB}) | ||
list(APPEND tool_deps ${exename}) | ||
list(APPEND core_tool_deps ${exename}) | ||
endforeach() | ||
|
||
list(APPEND tool_deps) | ||
if(WITH_TOOLS) | ||
set(TOOLS | ||
db_sanity_test.cc | ||
write_stress.cc | ||
db_repl_stress.cc | ||
dump/rocksdb_dump.cc | ||
dump/rocksdb_undump.cc) | ||
foreach(src ${TOOLS}) | ||
get_filename_component(exename ${src} NAME_WE) | ||
add_executable(${exename}${ARTIFACT_SUFFIX} | ||
${src}) | ||
target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB}) | ||
list(APPEND tool_deps ${exename}) | ||
endforeach() | ||
|
||
add_custom_target(ldb_tests | ||
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/ldb_tests.py | ||
DEPENDS ldb) | ||
add_custom_target(ldb_tests | ||
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/ldb_tests.py | ||
DEPENDS ldb) | ||
endif() |