summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-12-21 00:01:31 +0200
committerGitHub <noreply@github.com>2018-12-21 00:01:31 +0200
commitc220816350c74f59619b82e2dabebf2255acf07c (patch)
tree4d2327f43ef35c9a2fc9012efd39b2a749b99b3a /test cases
parent6864ed60dddf68e1e035194e50088649599a8d04 (diff)
parent8d6f5d869686f09957bb732f5b7acd0f98b1c195 (diff)
downloadmeson-c220816350c74f59619b82e2dabebf2255acf07c.tar.gz
Merge pull request #4573 from jon-turney/msys2-clang
More clang for Windows support
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/143 C and CPP link/meson.build6
-rw-r--r--test cases/common/190 openmp/meson.build3
-rw-r--r--test cases/common/59 exe static shared/meson.build8
-rw-r--r--test cases/failing build/2 hidden symbol/meson.build5
-rw-r--r--test cases/windows/12 resources with custom targets/meson.build2
-rw-r--r--test cases/windows/5 resources/meson.build2
6 files changed, 17 insertions, 9 deletions
diff --git a/test cases/common/143 C and CPP link/meson.build b/test cases/common/143 C and CPP link/meson.build
index 79d6f67eb..75281de62 100644
--- a/test cases/common/143 C and CPP link/meson.build
+++ b/test cases/common/143 C and CPP link/meson.build
@@ -36,7 +36,11 @@ if cxx.get_argument_syntax() == 'msvc'
compile_cmd = ['/c', '@INPUT@', '/Fo@OUTPUT@']
stlib_cmd = [static_linker, '/OUT:@OUTPUT@', '@INPUT@']
else
- compile_cmd = ['-c', '-fPIC', '@INPUT@', '-o', '@OUTPUT@']
+ picflag = []
+ if not ['darwin', 'windows'].contains(host_machine.system())
+ picflag = ['-fPIC']
+ endif
+ compile_cmd = ['-c', picflag, '@INPUT@', '-o', '@OUTPUT@']
stlib_cmd = ['ar', 'csr', '@OUTPUT@', '@INPUT@']
endif
diff --git a/test cases/common/190 openmp/meson.build b/test cases/common/190 openmp/meson.build
index 018bf24c5..f4652db7a 100644
--- a/test cases/common/190 openmp/meson.build
+++ b/test cases/common/190 openmp/meson.build
@@ -13,6 +13,9 @@ endif
if cc.get_id() == 'clang-cl'
error('MESON_SKIP_TEST clang-cl does not support OpenMP.')
endif
+if cc.get_id() == 'clang' and host_machine.system() == 'windows'
+ error('MESON_SKIP_TEST Windows clang does not support OpenMP.')
+endif
if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST macOS does not support OpenMP.')
endif
diff --git a/test cases/common/59 exe static shared/meson.build b/test cases/common/59 exe static shared/meson.build
index 288888284..69ede5e87 100644
--- a/test cases/common/59 exe static shared/meson.build
+++ b/test cases/common/59 exe static shared/meson.build
@@ -1,8 +1,12 @@
project('statchain', 'c')
subdir('subdir')
-# Test that -fPIC in c_args is also accepted
-statlib2 = static_library('stat2', 'stat2.c', c_args : '-fPIC', pic : false)
+# Test that -fPIC in c_args is also accepted (on platforms where it's permitted)
+picflag = []
+if not ['darwin', 'windows'].contains(host_machine.system())
+ picflag = ['-fPIC']
+endif
+statlib2 = static_library('stat2', 'stat2.c', c_args : picflag, pic : false)
# Test that pic is needed for both direct and indirect static library
# dependencies of shared libraries (on Linux and BSD)
statlib = static_library('stat', 'stat.c', link_with : [shlib, statlib2], pic : true)
diff --git a/test cases/failing build/2 hidden symbol/meson.build b/test cases/failing build/2 hidden symbol/meson.build
index 052734779..f7c38e353 100644
--- a/test cases/failing build/2 hidden symbol/meson.build
+++ b/test cases/failing build/2 hidden symbol/meson.build
@@ -1,10 +1,7 @@
project('hidden symbol', 'c')
if host_machine.system() == 'windows' or host_machine.system() == 'cygwin'
- cc = meson.get_compiler('c')
- if cc.get_id() == 'gcc'
- error('MESON_SKIP_TEST -fvisibility=hidden does not work on MinGW or Cygwin.')
- endif
+ error('MESON_SKIP_TEST -fvisibility=hidden does not work for PE files.')
endif
l = shared_library('bob', 'bob.c',
diff --git a/test cases/windows/12 resources with custom targets/meson.build b/test cases/windows/12 resources with custom targets/meson.build
index b1e2b091b..282272d76 100644
--- a/test cases/windows/12 resources with custom targets/meson.build
+++ b/test cases/windows/12 resources with custom targets/meson.build
@@ -3,7 +3,7 @@ project('winmain', 'c')
# MinGW windres has a bug due to which it doesn't parse args with space properly:
# https://github.com/mesonbuild/meson/pull/1346
# https://sourceware.org/bugzilla/show_bug.cgi?id=4933
-if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows'
+if ['gcc', 'clang'].contains(meson.get_compiler('c').get_id()) and host_machine.system() == 'windows'
# Construct build_to_src and skip this test if it has spaces
# because then the -I flag to windres will also have spaces
# and we know the test will fail
diff --git a/test cases/windows/5 resources/meson.build b/test cases/windows/5 resources/meson.build
index ddb7d6e8a..27b2fcc70 100644
--- a/test cases/windows/5 resources/meson.build
+++ b/test cases/windows/5 resources/meson.build
@@ -3,7 +3,7 @@ project('winmain', 'c')
# MinGW windres has a bug due to which it doesn't parse args with space properly:
# https://github.com/mesonbuild/meson/pull/1346
# https://sourceware.org/bugzilla/show_bug.cgi?id=4933
-if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows'
+if ['gcc', 'clang'].contains(meson.get_compiler('c').get_id()) and host_machine.system() == 'windows'
# Construct build_to_src and skip this test if it has spaces
# because then the -I flag to windres will also have spaces
# and we know the test will fail