Skip to content

Commit

Permalink
[clang-tools-extra] [cmake] Use add_clang_tool() to install tools
Browse files Browse the repository at this point in the history
Replace add_clang_executable() calls with add_clang_tool() that takes
care of creating correct, distribution-friendly install target.  While
at it, remove redundant install calls.

This change also causes clang-move and pp-trace to be installed.

Differential Revision: https://reviews.llvm.org/D68423

llvm-svn: 373694
  • Loading branch information
mgorny committed Oct 4, 2019
1 parent 7f379a3 commit cb46b69
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ target_link_libraries(clang-apply-replacements
clangToolingCore
clangToolingRefactoring
)

install(TARGETS clang-apply-replacements
RUNTIME DESTINATION bin)
5 changes: 1 addition & 4 deletions clang-tools-extra/clang-change-namespace/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(LLVM_LINK_COMPONENTS
Support
)

add_clang_executable(clang-change-namespace
add_clang_tool(clang-change-namespace
ClangChangeNamespace.cpp
)
target_link_libraries(clang-change-namespace
Expand All @@ -20,6 +20,3 @@ target_link_libraries(clang-change-namespace
clangTooling
clangToolingCore
)

install(TARGETS clang-change-namespace
RUNTIME DESTINATION bin)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)

add_clang_executable(find-all-symbols
add_clang_tool(find-all-symbols
FindAllSymbolsMain.cpp
)

Expand All @@ -16,9 +16,6 @@ target_link_libraries(find-all-symbols
findAllSymbols
)

install(TARGETS find-all-symbols
RUNTIME DESTINATION bin)

install(PROGRAMS run-find-all-symbols.py
DESTINATION share/clang
COMPONENT find-all-symbols)
3 changes: 0 additions & 3 deletions clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ target_link_libraries(clang-include-fixer
findAllSymbols
)

install(TARGETS clang-include-fixer
RUNTIME DESTINATION bin)

install(PROGRAMS clang-include-fixer.el
DESTINATION share/clang
COMPONENT clang-include-fixer)
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-move/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)

add_clang_executable(clang-move
add_clang_tool(clang-move
ClangMove.cpp
)

Expand Down
4 changes: 1 addition & 3 deletions clang-tools-extra/clang-query/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)

add_clang_executable(clang-query
add_clang_tool(clang-query
ClangQuery.cpp
)
target_link_libraries(clang-query
Expand All @@ -14,5 +14,3 @@ target_link_libraries(clang-query
clangSerialization
clangTooling
)

install(TARGETS clang-query RUNTIME DESTINATION bin)
2 changes: 1 addition & 1 deletion clang-tools-extra/pp-trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(LLVM_LINK_COMPONENTS
Support
)

add_clang_executable(pp-trace
add_clang_tool(pp-trace
PPTrace.cpp
PPCallbacksTracker.cpp
)
Expand Down

0 comments on commit cb46b69

Please sign in to comment.