diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-29 19:31:43 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-29 19:31:43 +0000 |
commit | b5f5bf534a4c2572afdacfc01f38d1467195732d (patch) | |
tree | ba98b3af3aeb8c4f08d99248c219b4c6b982e16e /CMakeLists.txt | |
parent | 64790a3e2980449e5db915bcd400b0a1d5b957f4 (diff) |
[CMake] Disallow direct configuration
As a first step, this allows us to generalize the detection of
standalone builds and make it fully compatible when building in
llvm/runtimes/ which automatically sets OPENMP_STANDLONE_BUILD.
Differential Revision: https://reviews.llvm.org/D40080
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@319341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b0a5f6..8795f61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,17 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing") +# llvm/runtimes/ will set OPENMP_STANDALONE_BUILD. +if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(OPENMP_STANDALONE_BUILD TRUE) + project(openmp C CXX) + + # CMAKE_BUILD_TYPE was not set, default to Release. + if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) + endif() + + set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") +endif() add_subdirectory(runtime) |