Skip to content

Commit 9c90c5c

Browse files
committed
Remove FLANG_BUILD_NEW_DRIVER since it is no longer optional after #1078
Last cherry-pick from LLVM requires FLANG_BUILD_NEW_DRIVER=ON to pass the driver tests but FLANG_BUILD_NEW_DRIVER was left OFF by default in the CMakeLists.txt which breaks build bots not passing ON explicitly (or passing OFF). Just remove the FLANG_BUILD_NEW_DRIVER option. This will require clang to be available to build fir-dev.
1 parent 56a0727 commit 9c90c5c

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

flang/CMakeLists.txt

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.13.4)
22

33
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
44

5-
option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" OFF)
6-
75
# Flang requires C++17.
86
set(CMAKE_CXX_STANDARD 17)
97
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
@@ -49,11 +47,9 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
4947
get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR} REALPATH)
5048
list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR_ABSOLUTE})
5149

52-
if(FLANG_BUILD_NEW_DRIVER)
53-
# TODO: Remove when libclangDriver is lifted out of Clang
54-
list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR})
55-
find_package(Clang REQUIRED HINTS "${CLANG_DIR}")
56-
endif()
50+
# TODO: Remove when libclangDriver is lifted out of Clang
51+
list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR})
52+
find_package(Clang REQUIRED HINTS "${CLANG_DIR}")
5753

5854
find_package(MLIR REQUIRED HINTS "${MLIR_CMAKE_PATH}")
5955
list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR})
@@ -74,9 +70,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
7470
include(VersionFromVCS)
7571
include(GetErrcMessages)
7672

77-
if(FLANG_BUILD_NEW_DRIVER)
78-
include(AddClang)
79-
endif()
73+
include(AddClang)
8074

8175
include(TableGen)
8276
find_package(MLIR REQUIRED CONFIG)
@@ -199,20 +193,18 @@ endif()
199193
set(FLANG_INCLUDE_DIR ${FLANG_BINARY_DIR}/include)
200194
set(FLANG_INTRINSIC_MODULES_DIR ${CMAKE_BINARY_DIR}/include/flang)
201195

202-
if(FLANG_BUILD_NEW_DRIVER)
203-
# TODO: Remove when libclangDriver is lifted out of Clang
204-
if(FLANG_STANDALONE_BUILD)
205-
set(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIRS} )
206-
# No need to specify TableGen output dir as that's embedded in CLANG_DIR
207-
else()
208-
set(CLANG_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/include )
209-
# Specify TableGen output dir for things like DiagnosticCommonKinds.inc,
210-
# DiagnosticDriverKinds.inc (required for reporting diagnostics)
211-
set(CLANG_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/clang/include)
212-
include_directories(SYSTEM ${CLANG_TABLEGEN_OUTPUT_DIR})
213-
endif()
214-
include_directories(SYSTEM ${CLANG_INCLUDE_DIR})
196+
# TODO: Remove when libclangDriver is lifted out of Clang
197+
if(FLANG_STANDALONE_BUILD)
198+
set(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIRS} )
199+
# No need to specify TableGen output dir as that's embedded in CLANG_DIR
200+
else()
201+
set(CLANG_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/include )
202+
# Specify TableGen output dir for things like DiagnosticCommonKinds.inc,
203+
# DiagnosticDriverKinds.inc (required for reporting diagnostics)
204+
set(CLANG_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/clang/include)
205+
include_directories(SYSTEM ${CLANG_TABLEGEN_OUTPUT_DIR})
215206
endif()
207+
include_directories(SYSTEM ${CLANG_INCLUDE_DIR})
216208

217209
include_directories(BEFORE
218210
${FLANG_BINARY_DIR}/include

0 commit comments

Comments
 (0)