This allows their reuse across projects. The name of the module
is intentionally generic because we would like to move more platform
checks there.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm thinking about moving https://github.com/llvm/llvm-project/blob/cfe5d768be95ae0a62cf430e56e7762cebf81a65/llvm/cmake/modules/HandleLLVMOptions.cmake#L174 and https://github.com/llvm/llvm-project/blob/cfe5d768be95ae0a62cf430e56e7762cebf81a65/compiler-rt/cmake/Modules/UseLibtool.cmake into CheckPlatform.cmake since this is logic we want to reuse across projects. Let me know if you have a better suggestion for the name of this module.
SetArchiverForPlatform? Or something that conveys the fact that (1) this is basically about ar, and (2) it actually performs an action (it sets global variables).
For the record, the review guidelines we have for libc++/libc++abi do not necessarily apply to compiler-rt, so there's no requirement that someone from the libc++ review group gives an approval for this to make progress.
LGTM
cmake/Modules/SetPlatformToolchainTools.cmake | ||
---|---|---|
4 | Super nit: using an unquoted ${} inside an if is a bad idea cos of https://cmake.org/cmake/help/latest/command/if.html#variable-expansion. Should be either if(CMAKE_SYSTEM_NAME or if("${CMAKE_SYSTEM_NAME}" |
cmake/Modules/SetPlatformToolchainTools.cmake | ||
---|---|---|
4 | (I know it's just a copypasta of the existing code, but might as well fix it while we're here) |
Super nit: using an unquoted ${} inside an if is a bad idea cos of https://cmake.org/cmake/help/latest/command/if.html#variable-expansion. Should be either if(CMAKE_SYSTEM_NAME or if("${CMAKE_SYSTEM_NAME}"