projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f922109
)
build: Use cc.links to check linker arguments
author
Ting-Wei Lan
<lantw@src.gnome.org>
Sun, 22 Apr 2018 13:42:03 +0000
(21:42 +0800)
committer
Ting-Wei Lan
<lantw@src.gnome.org>
Sun, 22 Apr 2018 13:57:10 +0000
(21:57 +0800)
Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.
meson.build
patch
|
blob
|
history
diff --git
a/meson.build
b/meson.build
index cdd83e76355569afc83c57b875ddda886010cb04..895cef9fc0618fd634d106a77592c0116afa41c3 100644
(file)
--- a/
meson.build
+++ b/
meson.build
@@
-284,8
+284,12
@@
endif
common_ldflags = []
-if host_machine.system() == 'linux' and cc.get_id() == 'gcc'
- common_ldflags += [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
+if os_unix and not os_darwin
+ foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
+ if cc.links('int main () { return 0; }', name: ldflag, args: ldflag)
+ common_ldflags += [ ldflag ]
+ endif
+ endforeach
endif
# Maintain compatibility with autotools