[flang-commits] [flang] 30b7dfa - [flang] Fix standalone builds

Shoaib Meenai via flang-commits flang-commits at lists.llvm.org
Wed May 12 13:01:28 PDT 2021


Author: Shoaib Meenai
Date: 2021-05-12T13:00:53-07:00
New Revision: 30b7dfafdb620420ad3498aae01130bc7e2fb9cd

URL: https://github.com/llvm/llvm-project/commit/30b7dfafdb620420ad3498aae01130bc7e2fb9cd
DIFF: https://github.com/llvm/llvm-project/commit/30b7dfafdb620420ad3498aae01130bc7e2fb9cd.diff

LOG: [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.

Added: 
    

Modified: 
    flang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index 28b712e6a00ac..37c881319ae60 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


        


More information about the flang-commits mailing list