diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -82,6 +82,10 @@ include(HandleLLVMOptions) include(VersionFromVCS) + if(FLANG_BUILD_NEW_DRIVER) + include(AddClang) + endif() + if(LINK_WITH_FIR) include(TableGen) find_package(MLIR REQUIRED CONFIG) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -4,26 +4,26 @@ # Set your project compile flags. link_directories(${LLVM_LIBRARY_DIR}) +set( LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + Option + Support +) + add_flang_tool(flang-new driver.cpp fc1_main.cpp - - LINK_COMPONENTS - - ${LLVM_COMMON_COMPONENTS} - Support - Target - Option ) -# Link against LLVM and Clang libraries target_link_libraries(flang-new PRIVATE flangFrontend flangFrontendTool +) + +clang_target_link_libraries(flang-new + PRIVATE clangDriver clangBasic clangFrontend ) - -install(TARGETS flang-new DESTINATION bin)