[PATCH] D71695: [cmake] Include the llvm-locstats target when utils and tools are not being built.

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 06:06:15 PST 2019


djtodoro added a comment.

In D71695#1791081 <https://reviews.llvm.org/D71695#1791081>, @djtodoro wrote:

> Something like the diff bellow would address the concerns.
>
>   diff --git a/llvm/utils/llvm-locstats/CMakeLists.txt b/llvm/utils/llvm-locstats/CMakeLists.txt
>   index d5366f99050..82099fed314 100644
>   --- a/llvm/utils/llvm-locstats/CMakeLists.txt
>   +++ b/llvm/utils/llvm-locstats/CMakeLists.txt
>   @@ -2,6 +2,7 @@ if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
>      add_custom_command(
>        OUTPUT ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
>        DEPENDS ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py
>   +    DEPENDS llvm-dwarfdump
>        COMMAND ${CMAKE_COMMAND} -E copy ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
>        COMMENT "Copying llvm-locstats into ${LLVM_TOOLS_BINARY_DIR}"
>        )


Actually, the combination of your recommendation and this one will be the appropriate way to resolve this. Please let me know what do you think.

  diff --git a/llvm/utils/llvm-locstats/CMakeLists.txt b/llvm/utils/llvm-locstats/CMakeLists.txt
  index d5366f99050..1dbb9da92e2 100644
  --- a/llvm/utils/llvm-locstats/CMakeLists.txt
  +++ b/llvm/utils/llvm-locstats/CMakeLists.txt
  @@ -2,11 +2,15 @@ if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
     add_custom_command(
       OUTPUT ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
       DEPENDS ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py
  +    DEPENDS llvm-dwarfdump
       COMMAND ${CMAKE_COMMAND} -E copy ${LLVM_MAIN_SRC_DIR}/utils/llvm-locstats/llvm-locstats.py ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
       COMMENT "Copying llvm-locstats into ${LLVM_TOOLS_BINARY_DIR}"
       )
     add_custom_target(llvm-locstats ALL
       DEPENDS ${LLVM_TOOLS_BINARY_DIR}/llvm-locstats
       )
  +  if (NOT LLVM_BUILD_TOOLS)
  +    set_target_properties(llvm-locstats PROPERTIES EXCLUDE_FROM_ALL ON)
  +  endif()
     set_target_properties(llvm-locstats PROPERTIES FOLDER "Tools")
   endif()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71695/new/

https://reviews.llvm.org/D71695





More information about the llvm-commits mailing list