diff options
| author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-11-28 23:45:40 +0000 |
|---|---|---|
| committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-12-09 20:40:27 +0000 |
| commit | 65160a969e4ec078a8ec740160b3bfc96055bc8c (patch) | |
| tree | 10f555d77691fcbb755399df43aca548dec3e591 /test cases | |
| parent | 6700a8bfd71dd831b1dd832efc6b70bfe69879de (diff) | |
| download | meson-65160a969e4ec078a8ec740160b3bfc96055bc8c.tar.gz | |
Don't rely on -fPIC being ignored where it's meaningless
clang considers it an error to try to use -fPIC for a windows target
v2:
'' isn't consistently elided, use []
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/common/143 C and CPP link/meson.build | 6 | ||||
| -rw-r--r-- | test cases/common/59 exe static shared/meson.build | 8 |
2 files changed, 11 insertions, 3 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/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) |
