[libc] Fix installing GPU headers
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 23 Jun 2023 15:42:54 +0000 (10:42 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 23 Jun 2023 18:47:52 +0000 (13:47 -0500)
commit3368a92b0f595c809d5dd97ce07a728a6eff73d6
tree8a2594e84b2a47ba2f4962a50a216e99e9738af9
parenta3800ad9d87f3c8e68ba875290d5a598b39a29c3
[libc] Fix installing GPU headers

The patch in D152592 changed the logic for this. We could never check if
we were on the GPU as this was before the variable was defined so I
moved it later. Secondly, we cannot use the `LLVM_BINARY_DIR` here, and
I do not know if that works in general. The problem is that it will
isntall the headers under a normal path outside of the
`LLVM_ENABLE_RUNTIMES` build. I don't know if that's correct for the
other targets, but for the GPU I need to set it back to the
CMAKE_BINARY_DIR so it works.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D153637
libc/CMakeLists.txt