[flang][cmake] Set the default for FLANG_BUILD_NEW_DRIVER for oot builds
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Mon, 24 May 2021 20:10:11 +0000 (20:10 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Mon, 24 May 2021 20:10:11 +0000 (20:10 +0000)
For out-of-tree builds of Flang, FLANG_BUILD_NEW_DRIVER is not inherited
from llvm-project/llvm/CMakeLists.txt. Instead, a separate definition is
required (but only for out-of-tree builds).

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

flang/CMakeLists.txt

index 37c8813..0090922 100644 (file)
@@ -26,6 +26,11 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(Flang)
   set(FLANG_STANDALONE_BUILD ON)
 
+  # For in-tree builds, this variable is inherited from
+  # llvm-project/llvm/CMakeLists.txt. For out-of-tree builds, we need a
+  # separate definition.
+  option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" ON)
+
   set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
   if (NOT MSVC_IDE)
     set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}