forked from OSchip/llvm-project
Include LLVM {src,obj} root in lit.site.cfg, to support non-standard layouts.
llvm-svn: 82401
This commit is contained in:
parent
0b65298f7a
commit
a173d9b874
|
@ -32,9 +32,11 @@ if(PYTHONINTERP_FOUND)
|
|||
|
||||
foreach(testdir ${CLANG_TEST_DIRECTORIES})
|
||||
add_custom_target(clang-test-${testdir}
|
||||
COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
|
||||
-e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
|
||||
COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
|
||||
-e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
|
||||
-e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
|
||||
-e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
|
||||
-e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
|
@ -46,9 +48,11 @@ if(PYTHONINTERP_FOUND)
|
|||
endforeach()
|
||||
|
||||
add_custom_target(clang-test
|
||||
COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
|
||||
-e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
|
||||
COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
|
||||
-e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
|
||||
-e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
|
||||
-e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
|
||||
-e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
|
|
|
@ -43,10 +43,12 @@ endif
|
|||
FORCE:
|
||||
|
||||
lit.site.cfg: FORCE
|
||||
@echo "Making 'lit.site.cfg' file..."
|
||||
@sed -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
|
||||
-e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
|
||||
@echo "Making Clang 'lit.site.cfg' file..."
|
||||
@sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
|
||||
-e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
|
||||
-e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
|
||||
-e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
|
||||
-e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
|
||||
$(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
||||
|
||||
clean::
|
||||
|
|
|
@ -27,11 +27,8 @@ def config_new():
|
|||
config.test_exec_root = os.path.join(clang_obj_root, 'test')
|
||||
|
||||
# Set llvm_{src,obj}_root for use by others.
|
||||
config.llvm_src_root = os.path.join(config.test_source_root,
|
||||
'..', '..', '..')
|
||||
if clang_obj_root is not None:
|
||||
config.llvm_obj_root = os.path.join(clang_obj_root,
|
||||
'..', '..')
|
||||
config.llvm_src_root = getattr(config, 'llvm_src_root', None)
|
||||
config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
|
||||
|
||||
# Tweak the PATH to include the tools dir and the scripts dir.
|
||||
if clang_obj_root is not None:
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
## Autogenerated by LLVM/Clang configuration.
|
||||
# Do not edit!
|
||||
config.clang_obj_root = "@CLANG_BINARY_DIR@"
|
||||
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
|
||||
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
|
||||
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
|
||||
config.clang_obj_root = "@CLANG_BINARY_DIR@"
|
||||
|
||||
# Let the main config do the real work.
|
||||
lit.load_config(config, "@CLANG_SOURCE_DIR@/test/lit.cfg")
|
||||
|
|
Loading…
Reference in New Issue