]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Use builtin option to handle LTO
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 8 Aug 2023 13:16:05 +0000 (15:16 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:33 +0000 (13:28 +0100)
meson.build
meson/lto/meson.build [deleted file]
meson_options.txt

index 859a92f25d453f632b227d0739d0b532b58dd4d4..5df24064fb07bbdcd0029c732b4ee13102ccc01a 100644 (file)
@@ -70,8 +70,6 @@ subdir('meson/code-coverage')            # Code coverage
 subdir('meson/auto-var-init')            # Automatic Variable Initialization
 subdir('meson/sanitizers')               # Sanitizers
 subdir('meson/malloc-trace')             # Malloc-trace
-# TODO Use meson's -Db_lto* options?
-subdir('meson/lto')                      # Link-time Optimization
 
 # Find or generate pdns/dnslabeltext.cc
 if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
diff --git a/meson/lto/meson.build b/meson/lto/meson.build
deleted file mode 100644 (file)
index eb9a0f1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# Link-time Optimization
-
-opt_lto = get_option('lto')
-
-if opt_lto == 'thin'
-  compiler_opt = '-flto=thin'
-  if cxx.has_argument(compiler_opt)
-    add_global_arguments(compiler_opt, language: ['c', 'cpp'])
-    add_global_link_arguments(compiler_opt, language: ['c', 'cpp'])
-  else
-    opt_lto = 'auto'
-  endif
-endif
-
-if opt_lto == 'auto'
-  compiler_opt = '-flto=auto'
-  if cxx.has_argument(compiler_opt)
-    add_global_arguments(compiler_opt, language: ['c', 'cpp'])
-    add_global_link_arguments(compiler_opt, language: ['c', 'cpp'])
-  else
-    opt_lto = 'yes'
-  endif
-endif
-
-if opt_lto == 'yes'
-  compiler_opt = '-flto'
-  if cxx.has_argument(compiler_opt)
-    add_global_arguments(compiler_opt, language: ['c', 'cpp'])
-    add_global_link_arguments(compiler_opt, language: ['c', 'cpp'])
-  else
-    error('LTO was requested but is not supported')
-  endif
-endif
-
-summary('LTO', opt_lto, section: 'Configuration')
index d4f14a7a1b3c358ed9974b57b5f1a40590b1566a..24d462a7185b51cdab98434e299549683191994d 100644 (file)
@@ -48,5 +48,3 @@ option('systemd-service-user', type: 'string', value: 'pdns', description: 'Syst
 option('systemd-service-group', type: 'string', value: 'pdns', description: 'Systemd service group (setgid and unit file; group is not created)')
 option('auto-var-init', type: 'combo', value: 'disabled', choices: ['zero', 'pattern', 'disabled'], description: 'Enable initialization of automatic variables')
 option('malloc-trace', type: 'boolean', value: false, description: 'Enable malloc-trace')
-# TODO Use meson's -Db_lto* options?
-option('lto', type: 'combo', choices: ['yes', 'no', 'thin', 'auto'], value: 'no', description: 'Enable link-time optimization')