2020-04-05 02:25:27 +02:00
|
|
|
get_property(LLVM_LIT_CONFIG_FILES GLOBAL PROPERTY LLVM_LIT_CONFIG_FILES)
|
|
|
|
list(LENGTH LLVM_LIT_CONFIG_FILES file_len)
|
|
|
|
math(EXPR file_last "${file_len} - 1")
|
2017-09-16 00:10:46 +02:00
|
|
|
|
|
|
|
get_llvm_lit_path(LIT_BASE_DIR LIT_FILE_NAME)
|
|
|
|
|
2020-04-07 02:38:26 +02:00
|
|
|
set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
|
|
|
|
|
2020-04-05 02:25:27 +02:00
|
|
|
# LLVM_LIT_CONFIG_FILES contains interleaved main config (in the source tree)
|
|
|
|
# and site config (in the build tree) pairs. Make them relative to
|
|
|
|
# llvm-lit and then convert them to map_config() calls.
|
|
|
|
if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
|
|
|
make_paths_relative(
|
2020-04-07 02:38:26 +02:00
|
|
|
LLVM_LIT_CONFIG_FILES "${LIT_BASE_DIR}" "${LLVM_LIT_CONFIG_FILES}")
|
|
|
|
make_paths_relative(
|
|
|
|
LLVM_SOURCE_DIR "${LIT_BASE_DIR}" "${LLVM_SOURCE_DIR}")
|
2020-04-05 02:25:27 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_PATH_FUNCTION}\n")
|
2020-04-06 16:47:41 +02:00
|
|
|
if (${file_last} GREATER -1)
|
|
|
|
foreach(i RANGE 0 ${file_last} 2)
|
|
|
|
list(GET LLVM_LIT_CONFIG_FILES ${i} main_config)
|
|
|
|
math(EXPR i1 "${i} + 1")
|
|
|
|
list(GET LLVM_LIT_CONFIG_FILES ${i1} site_out)
|
2020-04-13 22:53:06 +02:00
|
|
|
set(map "map_config(path(r'${main_config}'), path(r'${site_out}'))")
|
2020-04-06 16:47:41 +02:00
|
|
|
set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_CONFIG_MAP}\n${map}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2020-04-05 02:25:27 +02:00
|
|
|
|
2013-12-30 08:02:12 +01:00
|
|
|
if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
|
|
|
foreach(BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
|
2017-09-16 00:10:46 +02:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${BUILD_MODE} bi ${LIT_BASE_DIR})
|
|
|
|
set(bi "${bi}/${LIT_FILE_NAME}")
|
2013-12-30 08:02:12 +01:00
|
|
|
configure_file(
|
|
|
|
llvm-lit.in
|
|
|
|
${bi}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
set(BUILD_MODE .)
|
|
|
|
configure_file(
|
|
|
|
llvm-lit.in
|
2017-09-16 00:10:46 +02:00
|
|
|
${LIT_BASE_DIR}/${LIT_FILE_NAME}
|
2013-12-30 08:02:12 +01:00
|
|
|
)
|
|
|
|
endif()
|