[all-commits] [llvm/llvm-project] 635904: [CMake][runtimes] Add file level dependency to mer...

zero9178 via All-commits all-commits at lists.llvm.org
Thu Mar 18 10:53:08 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6359049c35042adb34ffe6ba77008613c1436ee1
      https://github.com/llvm/llvm-project/commit/6359049c35042adb34ffe6ba77008613c1436ee1
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M libcxx/src/CMakeLists.txt
    M libcxxabi/src/CMakeLists.txt

  Log Message:
  -----------
  [CMake][runtimes] Add file level dependency to merge_archives commands

Both libc++ and libc++abi have options of merging with another archive. In the case of libc++abi, libunwind can be merged into it and in the case of libc++, libc++abi can be merged into it.

This is realized using add_custom_command with POST_BUILD and the usage of the CMake generator expression TARGET_LINKER_FILE in the arguments. For such generator expressions CMake doc states: "This target-level dependency does NOT add a file-level dependency that would cause the custom command to re-run whenever the executable is recompiled" [1]

This patch adds a DEPENDS argument to both add_custom_command invocations so that the archives also have a file-level dependency on the target they are merging with. That way, changes in say, libunwind source code, will be updated in the libc++abi and/or libc++ static libraries as well.

[1] https://cmake.org/cmake/help/v3.20/command/add_custom_command.html

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




More information about the All-commits mailing list