summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-11-28 16:46:26 (GMT)
committerGitHub <noreply@github.com>2018-11-28 16:46:26 (GMT)
commit43ed17dac8134b2d6813b977cf370976d94472c9 (patch)
tree2cd74083229ef3236ca7bbb38a8e5dccd9dfcf94
parente8d4f018e5cb5dd0dd420f356b10b1d4788313e9 (diff)
parent62e885c01a370fb0f3eee7ca9e837d2612099fef (diff)
downloadSCons-43ed17dac8134b2d6813b977cf370976d94472c9.zip
SCons-43ed17dac8134b2d6813b977cf370976d94472c9.tar.gz
SCons-43ed17dac8134b2d6813b977cf370976d94472c9.tar.bz2
Merge pull request #3244 from mwichmann/clangfix
Add correct archiver tool for clang on win32
-rw-r--r--test/Clang/clang_static_library.py17
-rw-r--r--test/Clang/clangxx_static_library.py17
2 files changed, 28 insertions, 6 deletions
diff --git a/test/Clang/clang_static_library.py b/test/Clang/clang_static_library.py
index 7dedc6f..1198638 100644
--- a/test/Clang/clang_static_library.py
+++ b/test/Clang/clang_static_library.py
@@ -32,11 +32,22 @@ test = TestSCons.TestSCons()
if not test.where_is('clang'):
test.skip_test("Could not find 'clang', skipping test.\n")
+if test.IS_WINDOWS:
+ foo_lib = 'foo.lib'
+ archiver = 'mslib'
+ # TODO: other Windows combinations exist (not depending on
+ # mslib (lib.exe) from MS Build Tools / Visual Studio).
+ # Expand this if there is demand.
+else:
+ foo_lib = 'libfoo.a'
+ archiver = 'ar'
+
+
test.write('SConstruct', """\
DefaultEnvironment(tools=[])
-env = Environment(tools=['mingw','clang', 'ar'])
+env = Environment(tools=['mingw','clang', '%s'])
env.StaticLibrary('foo', 'foo.c')
-""")
+""" % archiver)
test.write('foo.c', """\
int bar() {
@@ -46,7 +57,7 @@ int bar() {
test.run()
-test.must_exist(test.workpath('libfoo.a'))
+test.must_exist(test.workpath(foo_lib))
test.pass_test()
diff --git a/test/Clang/clangxx_static_library.py b/test/Clang/clangxx_static_library.py
index c768deb..f4902e2 100644
--- a/test/Clang/clangxx_static_library.py
+++ b/test/Clang/clangxx_static_library.py
@@ -32,11 +32,22 @@ test = TestSCons.TestSCons()
if not test.where_is('clang'):
test.skip_test("Could not find 'clang++', skipping test.\n")
+if test.IS_WINDOWS:
+ foo_lib = 'foo.lib'
+ archiver = 'mslib'
+ # TODO: other Windows combinations exist (not depending on
+ # mslib (lib.exe) from MS Build Tools / Visual Studio).
+ # Expand this if there is demand.
+else:
+ foo_lib = 'libfoo.a'
+ archiver = 'ar'
+
+
test.write('SConstruct', """\
DefaultEnvironment(tools=[])
-env = Environment(tools=['mingw','clang++', 'ar'])
+env = Environment(tools=['mingw','clang++', '%s'])
env.StaticLibrary('foo', 'foo.cpp')
-""")
+""" % archiver)
test.write('foo.cpp', """\
int bar() {
@@ -46,7 +57,7 @@ int bar() {
test.run()
-test.must_exist(test.workpath('libfoo.a'))
+test.must_exist(test.workpath(foo_lib))
test.pass_test()