Skip to content

Commit ba430f5

Browse files
committed
[cmake] Add dependency on llvm-dwarfdump to llvm-locstats
Though llvm-locstat is a "util" it requires llvm-dwarfdump to be useful. So what happens now is that unless LLVM_BUILD_TOOLS is ON llvm-locstats won't be part of the "all" target. However given that it requires llvm-dwarfdump, this is less confusing/build time consuming than suddenly having llvm-dwarfdump build when all other tools are disabled. Differential Revision: https://reviews.llvm.org/D71705
1 parent 86acaa9 commit ba430f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/utils/llvm-locstats/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
22
add_custom_command(
33
OUTPUT ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
44
DEPENDS ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py
5+
DEPENDS llvm-dwarfdump
56
COMMAND ${CMAKE_COMMAND} -E copy ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
67
COMMENT "Copying llvm-locstats into ${LLVM_TOOLS_BINARY_DIR}"
78
)
89
add_custom_target(llvm-locstats ALL
910
DEPENDS ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
1011
)
12+
if (NOT LLVM_BUILD_TOOLS)
13+
set_target_properties(llvm-locstats PROPERTIES EXCLUDE_FROM_ALL ON)
14+
endif()
1115
set_target_properties(llvm-locstats PROPERTIES FOLDER "Tools")
1216
endif()

0 commit comments

Comments
 (0)