Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2022-09-08 17:45:46 +0300
committerHenrik Gramner <gramner@twoorioles.com>2022-09-10 16:32:36 +0300
commit178681e5fd6fc169fa3313b5263151de2b4a1d5c (patch)
treed82eb8e3d8ebb3cc887de0a85d5d69a5c77f9b92
parent5247319775ce71e2494fea97b7d30403e0244db3 (diff)
build: Improve Windows linking options
-rw-r--r--meson.build14
1 files changed, 14 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 0501ef2..3369d03 100644
--- a/meson.build
+++ b/meson.build
@@ -87,6 +87,7 @@ cdata.set10('CONFIG_LOG', get_option('logging'))
test_args = []
optional_arguments = []
+optional_link_arguments = []
if host_machine.system() == 'linux'
test_args += '-D_GNU_SOURCE'
@@ -112,6 +113,18 @@ if host_machine.system() == 'windows'
cdata.set('ftello', '_ftelli64')
endif
+ if host_machine.cpu_family() == 'x86_64'
+ if cc.get_argument_syntax() != 'msvc'
+ optional_link_arguments += '-Wl,--dynamicbase,--nxcompat,--tsaware,--high-entropy-va'
+ endif
+ elif host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'arm'
+ if cc.get_argument_syntax() == 'msvc'
+ optional_link_arguments += '/largeaddressaware'
+ else
+ optional_link_arguments += '-Wl,--dynamicbase,--nxcompat,--tsaware,--large-address-aware'
+ endif
+ endif
+
# On Windows, we use a compatibility layer to emulate pthread
thread_dependency = []
thread_compat_dep = declare_dependency(sources : files('src/win32/thread.c'))
@@ -296,6 +309,7 @@ if (host_machine.system() == 'darwin' and cc.get_id() == 'clang' and
endif
add_project_arguments(cc.get_supported_arguments(optional_arguments), language : 'c')
+add_project_link_arguments(cc.get_supported_link_arguments(optional_link_arguments), language : 'c')
# libFuzzer related things
fuzzing_engine = get_option('fuzzing_engine')