This is an automated email from the ASF dual-hosted git repository.
stigahuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new 6b47031 ORC-1129: [C++] Make tool-test depends on cpp tools (#1066)
6b47031 is described below
commit 6b470314a18fe987b9448f1d49d1c7671cf7d53b
Author: Quanlong Huang <[email protected]>
AuthorDate: Fri Mar 18 09:21:03 2022 +0800
ORC-1129: [C++] Make tool-test depends on cpp tools (#1066)
### What changes were proposed in this pull request?
Make tool-test depends on cpp tools so when any of the tool codes change,
recompile tool-test will also recompile the tool.
### Why are the changes needed?
This avoids mistakes when tool-test is using the old tool binaries that are
inconsistent with the current codes.
### How was this patch tested?
Manually tested make -j8 tool-test and make -j8 DESTDIR=./tmp install
---
tools/src/CMakeLists.txt | 20 +++++++++++++-------
tools/test/CMakeLists.txt | 2 ++
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
index d55581b..4b89ace 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
@@ -94,12 +94,18 @@ target_link_libraries (csv-import
${CMAKE_THREAD_LIBS_INIT}
)
+set(CPP_TOOL_NAMES
+ orc-contents
+ orc-metadata
+ orc-statistics
+ orc-scan
+ orc-memory
+ timezone-dump
+ csv-import
+ )
+
+add_custom_target(tool-set ALL DEPENDS ${CPP_TOOL_NAMES})
+
install(TARGETS
- orc-contents
- orc-metadata
- orc-statistics
- orc-scan
- orc-memory
- timezone-dump
- csv-import
+ ${CPP_TOOL_NAMES}
DESTINATION bin)
diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt
index 29f54cb..fe2be1d 100644
--- a/tools/test/CMakeLists.txt
+++ b/tools/test/CMakeLists.txt
@@ -39,6 +39,8 @@ target_link_libraries (tool-test
orc::gmock
)
+add_dependencies(tool-test tool-set)
+
if (TEST_VALGRIND_MEMCHECK)
add_test (tool-test valgrind --tool=memcheck --leak-check=full
--error-exitcode=1 ./tool-test ${EXAMPLE_DIRECTORY} ${PROJECT_BINARY_DIR})
else ()