[Lldb-commits] [PATCH] D65362: [CMake] Move project() call to main CMake file
Haibo Huang via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 26 18:29:10 PDT 2019
hhb created this revision.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D65362
Files:
lldb/CMakeLists.txt
lldb/cmake/modules/LLDBStandalone.cmake
Index: lldb/cmake/modules/LLDBStandalone.cmake
===================================================================
--- lldb/cmake/modules/LLDBStandalone.cmake
+++ 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)
Index: lldb/CMakeLists.txt
===================================================================
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -14,6 +14,7 @@
# 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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65362.212037.patch
Type: text/x-patch
Size: 805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190727/e46d9bb1/attachment.bin>
More information about the lldb-commits
mailing list