From: Shoaib Meenai Date: Wed, 12 May 2021 19:59:23 +0000 (-0700) Subject: [flang] Fix standalone builds X-Git-Tag: llvmorg-14-init~6874 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30b7dfafdb620420ad3498aae01130bc7e2fb9cd;p=platform%2Fupstream%2Fllvm.git [flang] Fix standalone builds Flang's CMake modules directory was being added to the CMake module path twice, and AddFlang was being included after the first addition. Remove the unnecessary first addition and move the AddFlang include down to the second one. This way, it occurs after LLVM's CMake modules have been included for a standalone build, so it can make use of those modules. --- diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 28b712e..37c8813 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -17,10 +17,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE) `CMakeFiles'. Please delete them.") endif() -# Add Flang-centric modules to cmake path. -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") -include(AddFlang) - option(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is triggered." OFF) # Check for a standalone build and configure as appropriate from @@ -228,12 +224,13 @@ endif() # Always build tco tool set(LLVM_BUILD_TOOLS ON) -# Add Flang-centric modules to cmake path. include_directories(BEFORE ${FLANG_BINARY_DIR}/include ${FLANG_SOURCE_DIR}/include) +# Add Flang-centric modules to cmake path. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") +include(AddFlang) if (NOT DEFAULT_SYSROOT) set(DEFAULT_SYSROOT "" CACHE PATH