[CMake] Generate ${BUILD_MODE}/llvm-lit for each ${CMAKE_CONFIGURATION_TYPES}.

llvm-lit can be invoked;

  $ Release/bin/llvm-lit

instead of;

  $ bin/llvm-lit --param buid_mode=Release

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198206 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi
2013-12-30 07:02:12 +00:00
parent 74ae52847d
commit e18e76e424
2 changed files with 17 additions and 5 deletions

View File

@@ -2,8 +2,20 @@ if (WIN32 AND NOT CYGWIN)
# llvm-lit needs suffix.py for multiprocess to find a main module. # llvm-lit needs suffix.py for multiprocess to find a main module.
set(suffix .py) set(suffix .py)
endif () endif ()
set(llvm_lit_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lit${suffix})
configure_file( if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
llvm-lit.in foreach(BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
${LLVM_TOOLS_BINARY_DIR}/llvm-lit${suffix} string(REPLACE ${CMAKE_CFG_INTDIR} ${BUILD_MODE} bi ${llvm_lit_path})
) configure_file(
llvm-lit.in
${bi}
)
endforeach()
else()
set(BUILD_MODE .)
configure_file(
llvm-lit.in
${llvm_lit_path}
)
endif()

View File

@@ -13,7 +13,7 @@ sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))
# Set up some builtin parameters, so that by default the LLVM test suite # Set up some builtin parameters, so that by default the LLVM test suite
# configuration file knows how to find the object tree. # configuration file knows how to find the object tree.
builtin_parameters = { builtin_parameters = {
'build_mode' : "@CMAKE_CFG_INTDIR@", 'build_mode' : "@BUILD_MODE@",
'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg'), 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg'),
'llvm_unit_site_config' : os.path.join(llvm_obj_root, 'test', 'Unit', 'llvm_unit_site_config' : os.path.join(llvm_obj_root, 'test', 'Unit',
'lit.site.cfg') 'lit.site.cfg')