aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2021-10-04 09:51:23 +0100
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2021-10-11 11:13:31 +0100
commit82c89e8fe7396919cb2b8cfb343138e156fbfe4b (patch)
tree1ddceaa4fd6cbc08bd8f782542e904d1201459a6
parent78f654ed9578b549f4ae2b9ee486be98f5a23c03 (diff)
tests: check whether -Wl,--unresolved-symbols=ignore-all is supported
When linking for macOS, this linker flag is rejected. Instead of always passing it, we can check whether it is supported first. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> Reviewed-by: Simon Ser <contact@emersion.fr>
-rw-r--r--tests/meson.build10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/meson.build b/tests/meson.build
index f994ea9..5439239 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -24,6 +24,10 @@ endforeach
add_languages('c', 'cpp', native: false)
replace = find_program('replace.py')
+extra_linker_flags = meson.get_compiler('c').get_supported_link_arguments([
+ '-Wl,--unresolved-symbols=ignore-all',
+])
+
foreach protocol_file : protocol_files
xml_file = fs.name(protocol_file)
xml_components = xml_file.split('.')
@@ -100,9 +104,7 @@ foreach protocol_file : protocol_files
server_header,
code
],
- link_args: [
- '-Wl,--unresolved-symbols=ignore-all',
- ],
+ link_args: extra_linker_flags,
dependencies: libwayland,
c_args: [
'-std=c99',
@@ -130,7 +132,7 @@ foreach protocol_file : protocol_files
client_header,
server_header,
],
- link_args: [ '-Wl,--unresolved-symbols=ignore-all' ],
+ link_args: extra_linker_flags,
dependencies: libwayland,
cpp_args: [
'-Wall',