[llvm-commits] [PATCH] [*san][CMake] Lit tests may run outside of "projects/compiler-rt"
NAKAMURA Takumi
geek4civic at gmail.com
Wed Oct 24 06:56:43 PDT 2012
This patch gets rid of assumption of "projects/compiler-rt" in lit_tests with LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR.
Checked on x86_64-linux centos6.
http://llvm-reviews.chandlerc.com/D76
Files:
compiler-rt/CMakeLists.txt
compiler-rt/lib/asan/lit_tests/Unit/lit.cfg
compiler-rt/lib/asan/lit_tests/Unit/lit.site.cfg.in
compiler-rt/lib/asan/lit_tests/lit.cfg
compiler-rt/lib/asan/lit_tests/lit.site.cfg.in
compiler-rt/lib/sanitizer_common/tests/lit.cfg
compiler-rt/lib/sanitizer_common/tests/lit.site.cfg.in
compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg
compiler-rt/lib/tsan/lit_tests/Unit/lit.site.cfg.in
compiler-rt/lib/tsan/lit_tests/lit.cfg
compiler-rt/lib/tsan/lit_tests/lit.site.cfg.in
compiler-rt/lib/ubsan/lit_tests/lit.cfg
compiler-rt/lib/ubsan/lit_tests/lit.site.cfg.in
Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -7,6 +7,8 @@
# An important constraint of the build is that it only produces libraries
# based on the ability of the host toolchain to target various platforms.
+set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
include(LLVMParseArguments)
# The CompilerRT build system requires CMake version 2.8.8 or higher in order
Index: compiler-rt/lib/asan/lit_tests/Unit/lit.cfg
===================================================================
--- compiler-rt/lib/asan/lit_tests/Unit/lit.cfg
+++ compiler-rt/lib/asan/lit_tests/Unit/lit.cfg
@@ -11,9 +11,9 @@
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root,
+ "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Index: compiler-rt/lib/asan/lit_tests/Unit/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/asan/lit_tests/Unit/lit.site.cfg.in
+++ compiler-rt/lib/asan/lit_tests/Unit/lit.site.cfg.in
@@ -2,7 +2,7 @@
# Do not edit!
config.target_triple = "@TARGET_TRIPLE@"
-config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.build_type = "@CMAKE_BUILD_TYPE@"
config.asan_binary_dir = "@ASAN_BINARY_DIR@"
Index: compiler-rt/lib/asan/lit_tests/lit.cfg
===================================================================
--- compiler-rt/lib/asan/lit_tests/lit.cfg
+++ compiler-rt/lib/asan/lit_tests/lit.cfg
@@ -49,7 +49,8 @@
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
+compiler_rt_src_dir = getattr(config, 'compiler_rt_src_root', None)
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_dir,
"lib", "lit.common.cfg")
if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
lit.fatal("Can't find common compiler-rt lit config at: %r"
Index: compiler-rt/lib/asan/lit_tests/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/asan/lit_tests/lit.site.cfg.in
+++ compiler-rt/lib/asan/lit_tests/lit.site.cfg.in
@@ -3,6 +3,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.host_os = "@HOST_OS@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
Index: compiler-rt/lib/sanitizer_common/tests/lit.cfg
===================================================================
--- compiler-rt/lib/sanitizer_common/tests/lit.cfg
+++ compiler-rt/lib/sanitizer_common/tests/lit.cfg
@@ -11,9 +11,9 @@
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root,
+ "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Index: compiler-rt/lib/sanitizer_common/tests/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/sanitizer_common/tests/lit.site.cfg.in
+++ compiler-rt/lib/sanitizer_common/tests/lit.site.cfg.in
@@ -2,8 +2,8 @@
# Do not edit!
config.build_type = "@CMAKE_BUILD_TYPE@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
-config.llvm_src_root = "@LLVM_SOURCE_DIR@"
# Let the main config do the real work.
lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
Index: compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg
===================================================================
--- compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg
+++ compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg
@@ -11,9 +11,9 @@
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root,
+ "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Index: compiler-rt/lib/tsan/lit_tests/Unit/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/tsan/lit_tests/Unit/lit.site.cfg.in
+++ compiler-rt/lib/tsan/lit_tests/Unit/lit.site.cfg.in
@@ -2,8 +2,8 @@
# Do not edit!
config.build_type = "@CMAKE_BUILD_TYPE@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
-config.llvm_src_root = "@LLVM_SOURCE_DIR@"
# Let the main config do the real work.
lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg")
Index: compiler-rt/lib/tsan/lit_tests/lit.cfg
===================================================================
--- compiler-rt/lib/tsan/lit_tests/lit.cfg
+++ compiler-rt/lib/tsan/lit_tests/lit.cfg
@@ -49,7 +49,8 @@
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
+compiler_rt_src_root = getattr(config, 'compiler_rt_src_root', None)
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root,
"lib", "lit.common.cfg")
if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
lit.fatal("Can't find common compiler-rt lit config at: %r"
Index: compiler-rt/lib/tsan/lit_tests/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/tsan/lit_tests/lit.site.cfg.in
+++ compiler-rt/lib/tsan/lit_tests/lit.site.cfg.in
@@ -3,6 +3,7 @@
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
Index: compiler-rt/lib/ubsan/lit_tests/lit.cfg
===================================================================
--- compiler-rt/lib/ubsan/lit_tests/lit.cfg
+++ compiler-rt/lib/ubsan/lit_tests/lit.cfg
@@ -49,7 +49,8 @@
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
+compiler_rt_src_dir = config.compiler_rt_src_root
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_dir,
"lib", "lit.common.cfg")
if not compiler_rt_lit_cfg or not os.path.exists(compiler_rt_lit_cfg):
lit.fatal("Can't find common compiler-rt lit config at: %r"
Index: compiler-rt/lib/ubsan/lit_tests/lit.site.cfg.in
===================================================================
--- compiler-rt/lib/ubsan/lit_tests/lit.site.cfg.in
+++ compiler-rt/lib/ubsan/lit_tests/lit.site.cfg.in
@@ -3,6 +3,7 @@
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76.1.patch
Type: text/x-patch
Size: 8188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121024/ac381cf9/attachment.bin>
More information about the llvm-commits
mailing list