1 diff --git a/meson.build b/meson.build
2 index e1e94e7..b355f94 100644
5 @@ -447,7 +447,9 @@ endif
7 # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
9 -if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
10 +with_use_elf_tls = get_option('use-elf-tls')
11 +if with_use_elf_tls and
12 + (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
13 (not with_platform_android or get_option('platform-sdk-version') >= 29) and
14 (not with_platform_windows or not with_shared_glapi))
15 pre_args += '-DUSE_ELF_TLS'
16 diff --git a/meson_options.txt b/meson_options.txt
17 index a7030ab..73bd28e 100644
18 --- a/meson_options.txt
19 +++ b/meson_options.txt
20 @@ -465,3 +465,9 @@ option(
22 description : 'use msse2 flag for mingw x86. Default: true',
28 + description : 'Build support for initial-exec TLS model'