[PATCH] D31742: [Builtins] Fix lit test setup for Windows
Weiming Zhao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 6 00:04:43 PDT 2017
weimingz created this revision.
Herald added a subscriber: mgorny.
Use .lib suffix for Windows and .a for non-Windows
https://reviews.llvm.org/D31742
Files:
test/builtins/CMakeLists.txt
test/builtins/Unit/lit.cfg
test/builtins/Unit/lit.site.cfg.in
Index: test/builtins/Unit/lit.site.cfg.in
===================================================================
--- test/builtins/Unit/lit.site.cfg.in
+++ test/builtins/Unit/lit.site.cfg.in
@@ -4,7 +4,7 @@
config.builtins_lit_source_dir = "@BUILTINS_LIT_SOURCE_DIR@/Unit"
config.target_cflags = "@BUILTINS_TEST_TARGET_CFLAGS@"
config.target_arch = "@BUILTINS_TEST_TARGET_ARCH@"
-
+config.builtins_lib_name_suffix = "@BUILTINS_STATIC_LIB_SUFFIX@"
# Load common config for all compiler-rt lit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
Index: test/builtins/Unit/lit.cfg
===================================================================
--- test/builtins/Unit/lit.cfg
+++ test/builtins/Unit/lit.cfg
@@ -24,8 +24,9 @@
config.test_source_root = os.path.dirname(__file__)
# Path to the static library
-base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins-%s.a "
- % config.target_arch)
+suffix = get_required_attr(config, "builtins_lib_name_suffix")
+base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins-%s"
+ % config.target_arch) + suffix
builtins_source_dir = os.path.join(
get_required_attr(config, "compiler_rt_src_root"), "lib", "builtins")
Index: test/builtins/CMakeLists.txt
===================================================================
--- test/builtins/CMakeLists.txt
+++ test/builtins/CMakeLists.txt
@@ -17,6 +17,11 @@
if (NOT APPLE)
foreach(arch ${BUILTIN_SUPPORTED_ARCH})
set(BUILTINS_TEST_TARGET_ARCH ${arch})
+ if (WIN32 AND NOT MINGW AND NOT CYGWIN)
+ set(BUILTINS_STATIC_LIB_SUFFIX ".lib")
+ else()
+ set(BUILTINS_STATIC_LIB_SUFFIX ".a")
+ endif()
string(TOLOWER "-${arch}-${OS_NAME}" BUILTINS_TEST_CONFIG_SUFFIX)
get_test_cc_for_arch(${arch} BUILTINS_TEST_TARGET_CC BUILTINS_TEST_TARGET_CFLAGS)
if (${arch} STREQUAL "armhf")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31742.94321.patch
Type: text/x-patch
Size: 1879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/94421cd3/attachment.bin>
More information about the llvm-commits
mailing list