forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
08ba9ce1ef
commit
30b7dfafdb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue