2009-09-22 07:38:44 +00:00
|
|
|
foreach(c ${LLVM_TARGETS_TO_BUILD})
|
|
|
|
set(TARGETS_BUILT "${TARGETS_BUILT} ${c}")
|
|
|
|
endforeach(c)
|
|
|
|
set(TARGETS_TO_BUILD ${TARGETS_BUILT})
|
|
|
|
|
2009-11-08 09:29:52 +00:00
|
|
|
# FIXME: This won't work for project files, we need to use a --param.
|
|
|
|
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}")
|
|
|
|
set(SHLIBEXT "${LTDL_SHLIB_EXT}")
|
|
|
|
|
2010-11-29 00:20:21 +00:00
|
|
|
set(SHLIBDIR "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}")
|
|
|
|
|
2010-03-10 18:41:59 +00:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set(LLVM_SHARED_LIBS_ENABLED "1")
|
|
|
|
else()
|
|
|
|
set(LLVM_SHARED_LIBS_ENABLED "0")
|
|
|
|
endif(BUILD_SHARED_LIBS)
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
set(SHLIBPATH_VAR "DYLD_LIBRARY_PATH")
|
|
|
|
else() # Default for all other unix like systems.
|
|
|
|
# CMake hardcodes the library locaction using rpath.
|
|
|
|
# Therefore LD_LIBRARY_PATH is not required to run binaries in the
|
2010-09-24 09:00:56 +00:00
|
|
|
# build dir. We pass it anyways.
|
2010-03-10 18:41:59 +00:00
|
|
|
set(SHLIBPATH_VAR "LD_LIBRARY_PATH")
|
|
|
|
endif()
|
|
|
|
|
2009-09-22 07:38:44 +00:00
|
|
|
include(FindPythonInterp)
|
|
|
|
if(PYTHONINTERP_FOUND)
|
2010-11-11 04:09:35 +00:00
|
|
|
set(LIT_ARGS "${LLVM_LIT_ARGS}")
|
|
|
|
separate_arguments(LIT_ARGS)
|
|
|
|
|
2009-09-22 07:38:44 +00:00
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/site.exp)
|
|
|
|
|
2009-11-08 09:08:00 +00:00
|
|
|
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit)
|
|
|
|
|
2010-11-27 13:10:11 +00:00
|
|
|
# Configuration-time: See Unit/lit.site.cfg.in
|
2011-06-23 18:00:32 +00:00
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
|
2010-09-17 03:22:21 +00:00
|
|
|
set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
|
|
|
|
set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
|
2010-11-27 13:10:11 +00:00
|
|
|
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
|
2010-09-17 03:22:21 +00:00
|
|
|
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
|
|
|
|
set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED})
|
|
|
|
set(SHLIBPATH_VAR ${SHLIBPATH_VAR})
|
|
|
|
|
2011-06-28 16:32:01 +00:00
|
|
|
if(LLVM_ENABLE_ASSERTIONS AND NOT MSVC_IDE)
|
2011-06-23 17:52:36 +00:00
|
|
|
set(ENABLE_ASSERTIONS "1")
|
|
|
|
else()
|
|
|
|
set(ENABLE_ASSERTIONS "0")
|
2011-06-28 21:46:21 +00:00
|
|
|
endif()
|
2011-06-23 17:52:36 +00:00
|
|
|
|
2010-09-17 03:22:21 +00:00
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
@ONLY)
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
@ONLY)
|
|
|
|
|
2009-11-08 09:08:00 +00:00
|
|
|
add_custom_target(check
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
2009-09-22 07:38:44 +00:00
|
|
|
${LLVM_SOURCE_DIR}/utils/lit/lit.py
|
2009-12-08 19:47:36 +00:00
|
|
|
--param llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
--param llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
2010-11-27 13:10:11 +00:00
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
|
|
|
--param build_mode=${RUNTIME_BUILD_MODE}
|
2010-11-11 04:09:35 +00:00
|
|
|
${LIT_ARGS}
|
2009-09-22 07:38:44 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Running LLVM regression tests")
|
2011-02-20 22:06:10 +00:00
|
|
|
set_target_properties(check PROPERTIES FOLDER "Tests")
|
2009-09-22 07:38:44 +00:00
|
|
|
|
2010-12-10 02:15:36 +00:00
|
|
|
add_custom_target(check.deps)
|
|
|
|
add_dependencies(check check.deps)
|
|
|
|
add_dependencies(check.deps
|
|
|
|
UnitTests
|
|
|
|
BugpointPasses LLVMHello
|
|
|
|
llc lli llvm-ar llvm-as llvm-dis llvm-extract
|
2011-09-27 21:54:50 +00:00
|
|
|
llvm-ld llvm-link llvm-mc llvm-nm llvm-objdump macho-dump opt
|
2010-12-10 02:15:36 +00:00
|
|
|
FileCheck count not)
|
2011-02-20 22:06:10 +00:00
|
|
|
set_target_properties(check.deps PROPERTIES FOLDER "Tests")
|
2010-12-10 02:15:36 +00:00
|
|
|
|
2009-11-08 09:08:00 +00:00
|
|
|
endif()
|