1 get_property(LLVM_LIT_CONFIG_FILES GLOBAL PROPERTY LLVM_LIT_CONFIG_FILES)
2 list(LENGTH LLVM_LIT_CONFIG_FILES file_len)
3 math(EXPR file_last "${file_len} - 1")
5 get_llvm_lit_path(LIT_BASE_DIR LIT_FILE_NAME)
7 set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
9 # LLVM_LIT_CONFIG_FILES contains interleaved main config (in the source tree)
10 # and site config (in the build tree) pairs. Make them relative to
11 # llvm-lit and then convert them to map_config() calls.
12 if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
14 LLVM_LIT_CONFIG_FILES "${LIT_BASE_DIR}" "${LLVM_LIT_CONFIG_FILES}")
16 LLVM_SOURCE_DIR "${LIT_BASE_DIR}" "${LLVM_SOURCE_DIR}")
19 set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_PATH_FUNCTION}\n")
20 if (${file_last} GREATER -1)
21 foreach(i RANGE 0 ${file_last} 2)
22 list(GET LLVM_LIT_CONFIG_FILES ${i} main_config)
23 math(EXPR i1 "${i} + 1")
24 list(GET LLVM_LIT_CONFIG_FILES ${i1} site_out)
25 set(map "map_config(path(r'${main_config}'), path(r'${site_out}'))")
26 set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_CONFIG_MAP}\n${map}")
30 if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
31 foreach(BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
32 string(REPLACE ${CMAKE_CFG_INTDIR} ${BUILD_MODE} bi ${LIT_BASE_DIR})
33 set(bi "${bi}/${LIT_FILE_NAME}")
43 ${LIT_BASE_DIR}/${LIT_FILE_NAME}