From 79d117f27ecd3a3508decb990794c648bda7270b Mon Sep 17 00:00:00 2001 From: Haibo Huang Date: Mon, 29 Jul 2019 23:09:31 +0000 Subject: [PATCH] [CMake] Move project() call to main CMake file Summary: The main CMake file don't have a project() call. In this case, cmake will run a dummy project(Project ) at the very beginning. Even before cmake_minimum_required. And a series of compiler detections will be triggered. This is problematic if we depends on some policy to be set. E.g. CMP0056. try_compile will fail before we have a chance to do anything. Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65362 llvm-svn: 367273 --- lldb/CMakeLists.txt | 1 + lldb/cmake/modules/LLDBStandalone.cmake | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index c9de1fa99d5d..5415ed805872 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -14,6 +14,7 @@ set(CMAKE_MODULE_PATH # If we are not building as part of LLVM, build LLDB as a standalone project, # using LLVM as an external library. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(lldb) include(LLDBStandalone) endif() diff --git a/lldb/cmake/modules/LLDBStandalone.cmake b/lldb/cmake/modules/LLDBStandalone.cmake index fd7e8a78d975..4b67d164d1c2 100644 --- a/lldb/cmake/modules/LLDBStandalone.cmake +++ b/lldb/cmake/modules/LLDBStandalone.cmake @@ -1,5 +1,3 @@ -project(lldb) - option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}" NO_CMAKE_FIND_ROOT_PATH)