[CMake] Support runtimes and monorepo layouts when looking for libcxx
This also slightly refactors the code that's checking the directory
presence which allows eliminating one unnecessary variable.
Differential Revision: https://reviews.llvm.org/D40637
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index f01cba9..d4f6368 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -465,7 +465,7 @@
# DEPS <list of build deps>
# CFLAGS <list of compile flags>)
macro(add_custom_libcxx name prefix)
- if(NOT COMPILER_RT_HAS_LIBCXX_SOURCES)
+ if(NOT COMPILER_RT_LIBCXX_PATH)
message(FATAL_ERROR "libcxx not found!")
endif()