diff options
author | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2021-07-12 08:44:38 +0000 |
---|---|---|
committer | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2021-08-05 12:57:15 +0000 |
commit | 7b73ca3043fecfc5fa6bbf5b28edfee61a83ff9f (patch) | |
tree | 58beb9d436ffeec315fbf348429be8db022653cf /flang/CMakeLists.txt | |
parent | 7217b01481566092c440f249d65a10efee8c50ad (diff) | |
download | llvm-7b73ca3043fecfc5fa6bbf5b28edfee61a83ff9f.tar.gz |
[flang][driver] Delete `f18` (i.e. the old Flang driver)
This patch removes `f18`, a.k.a. the old driver. It is being replaced
with the new driver, `flang-new`, which has reached feature parity with
`f18` a while ago. This was discussed in [1] and also in [2].
With this change, `FLANG_BUILD_NEW_DRIVER` is no longer needed and is
also deleted. This means that we are making the dependency on Clang permanent
(i.e. it cannot be disabled with a CMake flag).
LIT set-up is updated accordingly. All references to `f18` or `f18.cpp`
are either updated or removed.
The `F18_FC` variable from the `flang` bash script is replaced with
`FLANG_FC`. The former is still supported for backwards compatibility.
[1] https://lists.llvm.org/pipermail/flang-dev/2021-June/000742.html
[2] https://reviews.llvm.org/D103177
Differential Revision: https://reviews.llvm.org/D105811
Diffstat (limited to 'flang/CMakeLists.txt')
-rw-r--r-- | flang/CMakeLists.txt | 67 |
1 files changed, 28 insertions, 39 deletions
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index adf3dc819dc9..fc85f4451316 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -26,11 +26,6 @@ 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} @@ -46,24 +41,22 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR} REALPATH) list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR_ABSOLUTE}) - if(FLANG_BUILD_NEW_DRIVER) - # Users might specify a path to CLANG_DIR that's: - # * a full path, or - # * a path relative to the path of this script. - # Append the absolute path to CLANG_DIR so that find_package works in both - # cases. - get_filename_component( - CLANG_DIR_ABSOLUTE - ${CLANG_DIR} - REALPATH - ${CMAKE_CURRENT_SOURCE_DIR}) - list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR_ABSOLUTE}) - - # TODO: Remove when libclangDriver is lifted out of Clang - find_package(Clang REQUIRED PATHS "${CLANG_DIR_ABSOLUTE}" NO_DEFAULT_PATH) - if (NOT Clang_FOUND) - message(FATAL_ERROR "Failed to find Clang") - endif() + # Users might specify a path to CLANG_DIR that's: + # * a full path, or + # * a path relative to the path of this script. + # Append the absolute path to CLANG_DIR so that find_package works in both + # cases. + get_filename_component( + CLANG_DIR_ABSOLUTE + ${CLANG_DIR} + REALPATH + ${CMAKE_CURRENT_SOURCE_DIR}) + list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR_ABSOLUTE}) + + # TODO: Remove when libclangDriver is lifted out of Clang + find_package(Clang REQUIRED PATHS "${CLANG_DIR_ABSOLUTE}" NO_DEFAULT_PATH) + if (NOT Clang_FOUND) + message(FATAL_ERROR "Failed to find Clang") endif() # If LLVM links to zlib we need the imported targets so we can too. @@ -80,9 +73,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) include(HandleLLVMOptions) include(VersionFromVCS) - if(FLANG_BUILD_NEW_DRIVER) - include(AddClang) - endif() + include(AddClang) include(TableGen) find_package(MLIR REQUIRED CONFIG) @@ -206,20 +197,18 @@ endif() set(FLANG_INTRINSIC_MODULES_DIR ${CMAKE_BINARY_DIR}/include/flang) set(FLANG_INCLUDE_DIR ${FLANG_BINARY_DIR}/include) -if(FLANG_BUILD_NEW_DRIVER) - # TODO: Remove when libclangDriver is lifted out of Clang - if(FLANG_STANDALONE_BUILD) - set(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIRS} ) - # No need to specify TableGen output dir as that's embedded in CLANG_DIR - else() - set(CLANG_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/include ) - # Specify TableGen output dir for things like DiagnosticCommonKinds.inc, - # DiagnosticDriverKinds.inc (required for reporting diagnostics) - set(CLANG_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/clang/include) - include_directories(SYSTEM ${CLANG_TABLEGEN_OUTPUT_DIR}) - endif() - include_directories(SYSTEM ${CLANG_INCLUDE_DIR}) +# TODO: Remove when libclangDriver is lifted out of Clang +if(FLANG_STANDALONE_BUILD) + set(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIRS} ) + # No need to specify TableGen output dir as that's embedded in CLANG_DIR +else() + set(CLANG_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/include ) + # Specify TableGen output dir for things like DiagnosticCommonKinds.inc, + # DiagnosticDriverKinds.inc (required for reporting diagnostics) + set(CLANG_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/clang/include) + include_directories(SYSTEM ${CLANG_TABLEGEN_OUTPUT_DIR}) endif() +include_directories(SYSTEM ${CLANG_INCLUDE_DIR}) # tco tool and FIR lib output directories if(FLANG_STANDALONE_BUILD) |