LLVM build, CMAKE Message, 3.8.0

I just got the latest sources from http://llvm.org/svn/llvm-project/xxxx/trunk

[Shell script below]

I then built LLVM using CMAKE and without OCAML.

My version of cmake is 3.3.1. I did built it myself.

I get the following. Thought the list should know.

Keith smith

-- Target triple: x86_64-unknown-linux-gnu
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Sphinx disabled.
-- Go bindings disabled.
-- OCaml bindings disabled, need ctypes >=0.4.
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Compiler-RT supported architectures: x86_64
-- Clang version: 3.8.0
CMake Warning (dev) at cmake/modules/AddLLVM.cmake:5 (get_property):
  Policy CMP0051 is not set: List TARGET_OBJECTS in SOURCES target property.
  Run "cmake --help-policy CMP0051" for policy details. Use the cmake_policy
  command to set the policy and suppress this warning.

  Target "clang-tblgen" contains $<TARGET_OBJECTS> generator expression in
  its sources list. This content was not previously part of the SOURCES
  property when that property was read at configure time. Code reading that
  property needs to be adapted to ignore the generator expression using the
  string(GENEX_STRIP) command.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:600 (llvm_update_compile_flags)
  cmake/modules/AddLLVM.cmake:680 (add_llvm_executable)
  cmake/modules/TableGen.cmake:82 (add_llvm_utility)
  tools/clang/utils/TableGen/CMakeLists.txt:3 (add_tablegen)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done

I can reproduce it with clang and compiler-rt with cmake-3.3.1.
To appease, we may just add CMP0051 in compiler-rt/CMakeLists.txt.

Zachary, is there any user of “CMP0051 OLD”?

I think it may be NEW.

p.s. It might be redundant to apply llvm_update_compile_flag() to link-only target. Investigating.

We can set it to NEW, but we will have to fix all the locations that read the sources. I don’t think it should be a problem, but I might be wrong. I forget the exact scenario where I ran into this, I think it was in LLDB in source/API/CMakeLists.txt where I use TARGET_OBJECTS also.

I’m not sure if this answers your question though, let me know if you’re asking about something else.

Fixed the warning in r246984.