MAKE_FIND_ROOT_PATH_MODE_PACKAGE can be set to ONLY for cross compilation. However we need to find LLVMConfig from the host compiler, which is outside of the root path.
Set CMAKE_FIND_ROOT_PATH_BOTH when finding the LLVMConfig package.
Differential D146355
[compiler-rt] Allow finding LLVMConfig if CMAKE_FIND_ROOT_PATH_MODE_PACKAGE is set to ONLY kongyi on Mar 18 2023, 1:18 AM. Authored by
Details
Diff Detail Event TimelineComment Actions Do you have a doc link or some precedent? Something to help us understand the implications of this. Comment Actions We cross compile compiler-rt for Android, and we set CMAKE_FIND_ROOT_PATH_MODE_* to ONLY to force using the correct sysroots. Comment Actions I still don't understand the motivation behind this change. You already explicitly set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY for Android so why do we need to change the default? Comment Actions We need to pull the build dependencies from the target root path, thus setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY. However LLVMConfig is different that we need the host version instead, as it records the configs of the host toolchain. |