mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 20:00:11 +08:00
[flang]Fix individual tests with lit when building out of tree
Summary: Fix individual check tests with lit when building out-of-tree `ninja check-flang-<folder>` was not working. The CMakeLists.txt was looking for the lit tests in the source directory instead of the build directory. This commit extends @CarolineConcatto previous patch[D81002] Reviewers: DavidTruby, sscalpone, tskeith, CarolineConcatto, jdoerfert Reviewed By: DavidTruby Subscribers: flang-commits, llvm-commits, CarolineConcatto Tags: #flang, #llvm Differential Revision: https://reviews.llvm.org/D82120
This commit is contained in:
@@ -50,6 +50,7 @@ option(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is trigger
|
||||
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
message("Building Flang as a standalone project.")
|
||||
project(Flang)
|
||||
set(FLANG_STANDALONE_BUILD ON)
|
||||
|
||||
set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if (NOT MSVC_IDE)
|
||||
@@ -179,6 +180,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(FLANG_STANDALONE_BUILD OFF)
|
||||
option(FLANG_INCLUDE_TESTS
|
||||
"Generate build targets for the Flang unit tests."
|
||||
${LLVM_INCLUDE_TESTS})
|
||||
|
||||
@@ -45,7 +45,13 @@ add_lit_testsuite(check-flang "Running the Flang regression tests"
|
||||
)
|
||||
set_target_properties(check-flang PROPERTIES FOLDER "Tests")
|
||||
|
||||
add_lit_testsuites(FLANG ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PARAMS ${FLANG_TEST_PARAMS}
|
||||
DEPENDS ${FLANG_TEST_DEPENDS})
|
||||
|
||||
# In case of standalone builds.
|
||||
if (FLANG_STANDALONE_BUILD)
|
||||
add_lit_testsuites(FLANG ${CMAKE_CURRENT_BINARY_DIR}
|
||||
PARAMS ${FLANG_TEST_PARAMS}
|
||||
DEPENDS ${FLANG_TEST_DEPENDS})
|
||||
else()
|
||||
add_lit_testsuites(FLANG ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PARAMS ${FLANG_TEST_PARAMS}
|
||||
DEPENDS ${FLANG_TEST_DEPENDS})
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user