[compiler-rt] r329776 - [XRay][compiler-rt] Fix osx-based builds

Hi Dean,

For me the build is still broken:

-- Builtin supported architectures: i386;x86_64;x86_64h
CMake Error at projects/compiler-rt/lib/xray/tests/CMakeLists.txt:21 (add_library):
  add_library cannot create target "RTXRay.test.osx" because another target
  with the same name already exists. The existing target is a static library
  created in source directory
  "/Volumes/Transcend/code/llvm/projects/compiler-rt/lib/xray/tests". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  projects/compiler-rt/lib/xray/tests/CMakeLists.txt:73 (add_xray_lib)

Do you think you could take a look?


Hi Dean,

I have fixed the build failure in r329832.

In general, do you think it would be possible to perform the task using higher-level functions available from AddCompilerRT.cmake?
They were written exactly to avoid such errors.


Ouch. Sorry about that, George.

I definitely think the XRay CMake configurations should be using as many re-usable functions as possible, if they already exist. Unfortunately am not well-versed enough about what’s in AddCompilerRT.cmake and/or what CMake already does. :frowning:

This is mostly cargo-culting from surrounding CMake configs, and me crossing fingers to hope that things aren’t that broken in platforms I don’t regularly test/build with.

All the help in cleaning this up would be greatly appreciated.