This is an archive of the discontinued LLVM Phabricator instance.

depdendent projects fail to build with cmake 3.25 and llvm 16-rc4
ClosedPublic

Authored by juchem on May 18 2023, 9:52 AM.

Details

Summary

closes https://github.com/llvm/llvm-project/issues/61436

When building [latest iovisor/bcc](https://github.com/iovisor/bcc/commit/1ea0390725391e76256af6a4d0eb857816e6290f), cmake complains about a change in the behavior of operator IN_LIST:

console
CMake Warning (dev) at /usr/local/lib/cmake/llvm/LLVM-Config.cmake:230 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  cmake/clang_libs.cmake:32 (llvm_map_components_to_libnames)
  src/cc/CMakeLists.txt:132 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/lib/cmake/llvm/LLVM-Config.cmake:230 (if):
  if given arguments:

    "engine" "IN_LIST" "link_components"

  Unknown arguments specified
Call Stack (most recent call first):
  cmake/clang_libs.cmake:32 (llvm_map_components_to_libnames)
  src/cc/CMakeLists.txt:132 (include)

This patch addresses this issue by setting the aforementioned policy in LLVM-Config.cmake.

Diff Detail

Event Timeline

juchem created this revision.May 18 2023, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2023, 9:52 AM
juchem requested review of this revision.May 18 2023, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2023, 9:52 AM
thesamesam accepted this revision.May 21 2023, 8:03 PM
thesamesam added a subscriber: thesamesam.

This looks fine, thank you! I'll land it later today if nobody objects, given the bug has been open for a while and 16.x is broken as a result.

This revision is now accepted and ready to land.May 21 2023, 8:03 PM
mgorny accepted this revision.May 21 2023, 9:10 PM

LGTM