Skip to content
Permalink
Browse files

Sanitized CMAKE files (#680)

* Sanitized CMAKE files

* Remove redundant include
  • Loading branch information...
dutor committed Jul 24, 2019
1 parent 23c46c4 commit 560d60bfce47dc778483060832619efd566ff432
Showing with 1,290 additions and 1,622 deletions.
  1. +55 −11 CMakeLists.txt
  2. +1 −3 cmake/ThriftGenerate.cmake
  3. +1 −2 src/client/cpp/CMakeLists.txt
  4. +65 −104 src/common/base/test/CMakeLists.txt
  5. +4 −5 src/common/concurrent/CMakeLists.txt
  6. +12 −13 src/common/concurrent/test/CMakeLists.txt
  7. +1 −2 src/common/filter/CMakeLists.txt
  8. +15 −25 src/common/filter/test/CMakeLists.txt
  9. +6 −2 src/common/fs/CMakeLists.txt
  10. +15 −32 src/common/fs/test/CMakeLists.txt
  11. +4 −3 src/common/hdfs/CMakeLists.txt
  12. +5 −5 src/common/hdfs/test/CMakeLists.txt
  13. +4 −2 src/common/network/CMakeLists.txt
  14. +27 −26 src/common/network/test/CMakeLists.txt
  15. +4 −2 src/common/process/CMakeLists.txt
  16. +12 −12 src/common/process/test/CMakeLists.txt
  17. +5 −2 src/common/stats/CMakeLists.txt
  18. +10 −19 src/common/stats/test/CMakeLists.txt
  19. +5 −6 src/common/thread/CMakeLists.txt
  20. +7 −7 src/common/thread/test/CMakeLists.txt
  21. +1 −6 src/common/thrift/CMakeLists.txt
  22. +1 −3 src/common/time/CMakeLists.txt
  23. +38 −41 src/common/time/test/CMakeLists.txt
  24. +23 −22 src/console/CMakeLists.txt
  25. +103 −100 src/daemons/CMakeLists.txt
  26. +1 −4 src/dataman/CMakeLists.txt
  27. +1 −1 src/dataman/RowUpdater.cpp
  28. +1 −1 src/dataman/RowWriter.cpp
  29. +1 −1 src/dataman/SchemaWriter.cpp
  30. +35 −77 src/dataman/test/CMakeLists.txt
  31. +2 −4 src/graph/CMakeLists.txt
  32. +97 −103 src/graph/test/CMakeLists.txt
  33. +1 −2 src/kvstore/CMakeLists.txt
  34. +0 −1 src/kvstore/plugins/CMakeLists.txt
  35. +1 −2 src/kvstore/plugins/hbase/CMakeLists.txt
  36. +49 −48 src/kvstore/plugins/hbase/test/CMakeLists.txt
  37. +1 −3 src/kvstore/raftex/CMakeLists.txt
  38. +30 −96 src/kvstore/raftex/test/CMakeLists.txt
  39. +55 −146 src/kvstore/test/CMakeLists.txt
  40. +1 −3 src/kvstore/wal/CMakeLists.txt
  41. +13 −14 src/kvstore/wal/test/CMakeLists.txt
  42. +4 −8 src/meta/CMakeLists.txt
  43. +313 −311 src/meta/test/CMakeLists.txt
  44. +11 −13 src/parser/CMakeLists.txt
  45. +17 −39 src/parser/test/CMakeLists.txt
  46. +3 −6 src/storage/CMakeLists.txt
  47. +164 −219 src/storage/test/CMakeLists.txt
  48. +1 −1 src/tools/native-client/CMakeLists.txt
  49. +30 −29 src/tools/storage-perf/CMakeLists.txt
  50. +1 −3 src/webservice/CMakeLists.txt
  51. +33 −32 src/webservice/test/CMakeLists.txt
@@ -309,18 +309,62 @@ if(ENABLE_ASAN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()

macro(nebula_add_test test_name)
add_test(NAME ${test_name} COMMAND ${test_name})
# e.g. cmake -DNEBULA_ASAN_PRELOAD=/path/to/libasan.so
# or, cmake -DNEBULA_ASAN_PRELOAD=`/path/to/gcc --print-file-name=libasan.so`
if (NEBULA_ASAN_PRELOAD)
set_property(TEST ${test_name} PROPERTY ENVIRONMENT LD_PRELOAD=${NEBULA_ASAN_PRELOAD})
endif(NEBULA_ASAN_PRELOAD)
endmacro(nebula_add_test)

macro(nebula_add_base_obj obj_name)
macro(nebula_add_executable)
cmake_parse_arguments(
nebula_exec # prefix
"" # <options>
"NAME" # <one_value_args>
"SOURCES;OBJECTS;LIBRARIES" # <multi_value_args>
${ARGN}
)
add_executable(
${nebula_exec_NAME}
${nebula_exec_SOURCES}
${nebula_exec_OBJECTS}
)
nebula_link_libraries(
${nebula_exec_NAME}
${nebula_exec_LIBRARIES}
)
endmacro()

macro(nebula_add_test)
cmake_parse_arguments(
nebula_test # prefix
"DISABLED" # <options>
"NAME" # <one_value_args>
"SOURCES;OBJECTS;LIBRARIES" # <multi_value_args>
${ARGN}
)

nebula_add_executable(
NAME ${nebula_test_NAME}
SOURCES ${nebula_test_SOURCES}
OBJECTS ${nebula_test_OBJECTS}
LIBRARIES ${nebula_test_LIBRARIES}
)

if (NOT ${nebula_test_DISABLED})
add_test(NAME ${nebula_test_NAME} COMMAND ${nebula_test_NAME})
# e.g. cmake -DNEBULA_ASAN_PRELOAD=/path/to/libasan.so
# or, cmake -DNEBULA_ASAN_PRELOAD=`/path/to/gcc --print-file-name=libasan.so`
if (NEBULA_ASAN_PRELOAD)
set_property(
TEST ${nebula_test_NAME}
PROPERTY ENVIRONMENT LD_PRELOAD=${NEBULA_ASAN_PRELOAD}
)
endif()
endif()
endmacro()

macro(nebula_build_after_base obj_name)
add_dependencies(${obj_name} base_obj)
endmacro(nebula_add_base_obj)
endmacro()

macro(nebula_add_library name type)
add_library(${name} ${type} ${ARGN})
nebula_build_after_base(${name})
endmacro()

include_directories(SYSTEM ${NEBULA_THIRDPARTY_ROOT}/bzip2/include)
include_directories(SYSTEM ${NEBULA_THIRDPARTY_ROOT}/double-conversion/include)
@@ -86,7 +86,7 @@ add_custom_command(
--gen "go"
-o "." "${file_path}/${file_name}.thrift"
DEPENDS "${file_path}/${file_name}.thrift"
COMMENT "Generating ${file_name} files. Output: ${output_path}"
COMMENT "Generating thrift files for ${file_name}"
)

bypass_source_check(${file_name}_cpp2-SOURCES)
@@ -101,6 +101,4 @@ add_dependencies(
"common_thrift_obj"
)
endif()

message("Thrift will create the Object file : ${file_name}_thrift_obj")
endmacro()
@@ -1,5 +1,4 @@
add_library(client_cpp_obj OBJECT GraphClient.cpp)
nebula_add_base_obj(client_cpp_obj)
nebula_add_library(client_cpp_obj OBJECT GraphClient.cpp)

#add_subdirectory(test)

@@ -1,130 +1,91 @@
add_executable(cord_test CordTest.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
cord_test
gtest
nebula_add_test(
NAME cord_test
SOURCES CordTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest
)
nebula_add_test(cord_test)

add_executable(cord_bm CordBenchmark.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
cord_bm
follybenchmark
boost_regex
nebula_add_executable(
NAME cord_bm
SOURCES CordBenchmark.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES follybenchmark boost_regex
)

add_executable(logging_bm LoggingBenchmark.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
logging_bm
follybenchmark
boost_regex
nebula_add_executable(
NAME logging_bm
SOURCES LoggingBenchmark.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES follybenchmark boost_regex
)

add_executable(murmurhash2_test MurmurHash2Test.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
murmurhash2_test
gtest
gtest_main
nebula_add_test(
NAME murmurhash2_test
SOURCES MurmurHash2Test.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_add_test(murmurhash2_test)

add_executable(
configuration_test
ConfigurationTest.cpp
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:base_obj>
nebula_add_test(
NAME configuration_test
SOURCES ConfigurationTest.cpp
OBJECTS $<TARGET_OBJECTS:fs_obj> $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_link_libraries(
configuration_test
gtest
gtest_main
)
nebula_add_test(configuration_test)

add_executable(
status_test
StatusTest.cpp
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:base_obj>
)
nebula_link_libraries(
status_test
gtest
gtest_main
nebula_add_test(
NAME status_test
SOURCES StatusTest.cpp
OBJECTS $<TARGET_OBJECTS:fs_obj> $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_add_test(status_test)

add_executable(
status_or_test
StatusOrTest.cpp
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:base_obj>
nebula_add_test(
NAME status_or_test
SOURCES StatusOrTest.cpp
OBJECTS $<TARGET_OBJECTS:fs_obj> $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_link_libraries(
status_or_test
gtest
gtest_main
)
nebula_add_test(status_or_test)

add_executable(
either_or_test
EitherOrTest.cpp
$<TARGET_OBJECTS:base_obj>
)
nebula_link_libraries(
either_or_test
gtest
gtest_main
nebula_add_test(
NAME either_or_test
SOURCES EitherOrTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_add_test(either_or_test)

add_executable(
error_or_test
ErrorOrTest.cpp
$<TARGET_OBJECTS:base_obj>
nebula_add_test(
NAME error_or_test
SOURCES ErrorOrTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_link_libraries(
error_or_test
gtest
gtest_main
)
nebula_add_test(error_or_test)

add_executable(hash_bm HashBenchmark.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
hash_bm
follybenchmark
boost_regex
nebula_add_executable(
NAME hash_bm
SOURCES HashBenchmark.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES follybenchmark boost_regex
)

add_executable(signal_handler_test SignalHandlerTest.cpp $<TARGET_OBJECTS:base_obj>)
nebula_link_libraries(
signal_handler_test
gtest
gtest_main
nebula_add_test(
NAME signal_handler_test
SOURCES SignalHandlerTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_add_test(signal_handler_test)

add_executable(
nebulakey_utils_test
NebulaKeyUtilsTest.cpp
$<TARGET_OBJECTS:base_obj>
)
nebula_link_libraries(
nebulakey_utils_test
gtest
gtest_main
nebula_add_test(
NAME nebulakey_utils_test
SOURCES NebulaKeyUtilsTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)
nebula_add_test(nebulakey_utils_test)

add_executable(
range_vs_transform_bm
RangeVsTransformBenchmark.cpp
$<TARGET_OBJECTS:base_obj>
)
nebula_link_libraries(
range_vs_transform_bm
follybenchmark
boost_regex
nebula_add_executable(
NAME range_vs_transform_bm
SOURCES RangeVsTransformBenchmark.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES follybenchmark boost_regex
)
target_compile_options(range_vs_transform_bm PRIVATE -O3)
@@ -1,8 +1,7 @@
add_library(
concurrent_obj OBJECT
Barrier.cpp
Latch.cpp
nebula_add_library(
concurrent_obj OBJECT
Barrier.cpp
Latch.cpp
)
nebula_add_base_obj(concurrent_obj)

add_subdirectory(test)
@@ -1,14 +1,13 @@
add_executable(
concurrent_test
BarrierTest.cpp
LatchTest.cpp
$<TARGET_OBJECTS:concurrent_obj>
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:time_obj>
nebula_add_test(
NAME
concurrent_test
SOURCES
BarrierTest.cpp LatchTest.cpp
OBJECTS
$<TARGET_OBJECTS:concurrent_obj>
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:time_obj>
LIBRARIES
gtest
gtest_main
)
nebula_link_libraries(
concurrent_test
gtest
gtest_main
)
nebula_add_test(concurrent_test)
@@ -1,9 +1,8 @@
add_library(
nebula_add_library(
filter_obj
OBJECT
Expressions.cpp
FunctionManager.cpp
)
nebula_add_base_obj(filter_obj)

add_subdirectory(test)
@@ -1,35 +1,25 @@
add_compile_options(-Wno-parentheses)
add_executable(
expression_test
ExpressionTest.cpp
set(FILTER_TEST_LIBS
$<TARGET_OBJECTS:filter_obj>
$<TARGET_OBJECTS:parser_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_obj>
)
nebula_link_libraries(
expression_test
gtest
gtest_main
)
target_include_directories(expression_test SYSTEM BEFORE PUBLIC ${FLEX_INCLUDE_DIRS})
nebula_add_test(expression_test)

add_executable(
expression_encode_decode_bm
ExpressionEncodeDecodeBenchmark.cpp
$<TARGET_OBJECTS:filter_obj>
$<TARGET_OBJECTS:parser_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:parser_obj>
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_obj>

nebula_add_test(
NAME expression_test
SOURCES ExpressionTest.cpp
OBJECTS ${FILTER_TEST_LIBS}
LIBRARIES gtest gtest_main
)
nebula_link_libraries(
expression_encode_decode_bm
follybenchmark
boost_regex
target_compile_options(expression_test PRIVATE -Wno-parentheses)


nebula_add_executable(
NAME expression_encode_decode_bm
SOURCES ExpressionEncodeDecodeBenchmark.cpp
OBJECTS ${FILTER_TEST_LIBS}
LIBRARIES follybenchmark boost_regex
)

0 comments on commit 560d60b

Please sign in to comment.
You can’t perform that action at this time.