CMake 3.2 warning in Compiler-RT

Hi Folks,

Now that I'm using CMake 3.2.2 to get the "pool = console" Ninja
feature, I'm seeing this warning:

CMake Warning (dev) at
projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:55 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
  details. Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "HAVE_RPC_XDR_H" will no longer be dereferenced 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):
  projects/compiler-rt/lib/sanitizer_common/CMakeLists.txt:116
(append_have_file_definition)
This warning is for project developers. Use -Wno-dev to suppress it.

I don't want to suppress it, since the semantics of the expansion is
different. Is anyone seeing this who knows what the best work around
is? Or is it just a developer's message (as the warning implies) and
future release versions will work around it automatically?

Would be good to get some way that both pre and pos 3.2 can work
correctly with the same code.

cheers,
--renato

Now that I’m using CMake 3.2.2 to get the “pool = console” Ninja
feature, I’m seeing this warning:

[…]
Quoted variables like “HAVE_RPC_XDR_H” will no longer be dereferenced when
[…]

I don’t want to suppress it, since the semantics of the expansion is
different. Is anyone seeing this who knows what the best work around
is?

The fix should be as simple as changing “if (NOT “${varname}”)” to “if (NOT ${varname})” on that line.

Or is it just a developer’s message (as the warning implies) and
future release versions will work around it automatically?

When it says “for project developers”, it doesn’t mean CMake developers, it means LLVM developers; that part of the warning is meant for end-users compiling at home.

Stefanus

Would that work on CMake 2.8, too? That's our current lowest version.

cheers,
--renato

Yes, that should work fine on CMake 2.8. There’s even an example of doing exactly what is done here (without the quotes) in the CMake 2.8 docs:

http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:if

(towards the end of that section, starting with “The if command was written very early”)

Stefanus