This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fixing lit for runtimes directory
ClosedPublic

Authored by Hahnfeld on Sep 13 2016, 6:23 AM.

Details

Summary

Copy variable LLVM_BUILD_MAIN_SRC_DIR from LLVMConfig.cmake to
LLVM_MAIN_SRC_DIR as it is named for in-tree builds. This ensures that
add_lit_target() can reliably find llvm-lit which is not necessarily
in the PATH.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld updated this revision to Diff 71155.Sep 13 2016, 6:23 AM
Hahnfeld retitled this revision from to [CMake] Fixing lit for runtimes directory.
Hahnfeld updated this object.
Hahnfeld added a reviewer: beanz.
Hahnfeld added a subscriber: llvm-commits.
beanz edited edge metadata.Sep 13 2016, 10:09 AM

LLVMConfig.cmake does have LLVM_BUILD_MAIN_SRC_DIR which is set to the value of LLVM_MAIN_SRC_DIR, so we should instead just do set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) around line 60 where we map up the other variables that don't match between in-tree builds and LLVMConfig.cmake.

Hahnfeld updated this revision to Diff 71301.Sep 13 2016, 11:31 PM
Hahnfeld updated this object.
Hahnfeld edited edge metadata.

LLVMConfig.cmake does have LLVM_BUILD_MAIN_SRC_DIR which is set to the value of LLVM_MAIN_SRC_DIR, so we should instead just do set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) around line 60 where we map up the other variables that don't match between in-tree builds and LLVMConfig.cmake.

Ah thanks, that looks much better!

beanz accepted this revision.Sep 14 2016, 9:48 PM
beanz edited edge metadata.

LGTM!

This revision is now accepted and ready to land.Sep 14 2016, 9:48 PM
This revision was automatically updated to reflect the committed changes.