1 foreach(c ${LLVM_TARGETS_TO_BUILD})
2 set(TARGETS_BUILT "${TARGETS_BUILT} ${c}")
4 set(TARGETS_TO_BUILD ${TARGETS_BUILT})
6 # FIXME: This won't work for project files, we need to use a --param.
7 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}")
8 set(SHLIBEXT "${LTDL_SHLIB_EXT}")
11 set(LLVM_SHARED_LIBS_ENABLED "1")
13 set(LLVM_SHARED_LIBS_ENABLED "0")
14 endif(BUILD_SHARED_LIBS)
16 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
17 set(SHLIBPATH_VAR "DYLD_LIBRARY_PATH")
18 else() # Default for all other unix like systems.
19 # CMake hardcodes the library locaction using rpath.
20 # Therefore LD_LIBRARY_PATH is not required to run binaries in the
21 # build dir. We pass it anyways.
22 set(SHLIBPATH_VAR "LD_LIBRARY_PATH")
25 include(FindPythonInterp)
26 if(PYTHONINTERP_FOUND)
28 ${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
29 ${CMAKE_CURRENT_BINARY_DIR}/site.exp)
31 MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit)
33 add_custom_target(check
34 COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
35 -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
36 -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}#"
37 -e "s#\@LLVMGCCDIR\@##"
38 -e "s#\@PYTHON_EXECUTABLE\@#${PYTHON_EXECUTABLE}#"
39 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
40 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
41 COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
42 -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
43 -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}#"
44 -e "s#\@LLVMGCCDIR\@##"
45 -e "s#\@LLVM_BUILD_MODE\@#${CMAKE_CFG_INTDIR}#"
46 -e "s#\@ENABLE_SHARED\@#${LLVM_SHARED_LIBS_ENABLED}#"
47 -e "s#\@SHLIBPATH_VAR\@#${SHLIBPATH_VAR}#"
48 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in >
49 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
50 COMMAND ${PYTHON_EXECUTABLE}
51 ${LLVM_SOURCE_DIR}/utils/lit/lit.py
52 --param llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
53 --param llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
55 ${CMAKE_CURRENT_BINARY_DIR}
57 COMMENT "Running LLVM regression tests")