[CMake] Make openmp build under runtimes/

runtimes/CMakeLists.txt in LLVM passes OPENMP_STANDALONE_BUILD.

Differential Revision: https://reviews.llvm.org/D28280

llvm-svn: 290978
GitOrigin-RevId: 49152b3f0676bf0cc1961b0e87e7e5c070470b62
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 6b896aa..33225b6 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -17,7 +17,8 @@
 
 # Standalone build or part of LLVM?
 set(LIBOMP_STANDALONE_BUILD FALSE)
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR
+if(OPENMP_STANDALONE_BUILD OR
+   "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR
    "${CMAKE_SOURCE_DIR}/runtime" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   project(libomp C CXX)
   set(LIBOMP_STANDALONE_BUILD TRUE)