fs = import('fs')
# Create the configuration object and dependencies list.
-add_global_arguments('-DHAVE_CONFIG_H')
+add_global_arguments('-DHAVE_CONFIG_H', language: ['cpp'])
conf = configuration_data()
deps = []
subdir_done()
endif
- add_global_arguments(arg)
+ add_global_arguments(arg, language: ['cpp'])
endif
summary('Auto Var Init', auto_var_init, section: 'Configuration')
# Code coverage
-# Inputs: deps
-code_coverage_deps = []
code_coverage = get_option('code-coverage')
if code_coverage
error('Compiler does not support ' + arg + ', which is needed for code coverage')
break
endif
-
- code_coverage_deps += declare_dependency(compile_args: [arg])
endforeach
+
+ add_global_arguments(args, language: ['cpp'])
endif
summary('Code Coverage', code_coverage, bool_yn: true, section: 'Configuration')
# Don't limit the number of errors when using clang. This is useful to not cut out the
# error output when using an LSP server like clangd.
if meson.get_compiler('cpp').get_id() == 'clang'
- add_global_arguments(['-ferror-limit=0'], language: 'cpp')
+ add_global_arguments('-ferror-limit=0', language: ['cpp'])
endif
-add_global_arguments(['-Wshadow', '-Wmissing-declarations', '-Wredundant-decls'], language: 'cpp')
+add_global_arguments('-Wshadow', '-Wmissing-declarations', '-Wredundant-decls', language: ['cpp'])
cxx = meson.get_compiler('cpp')
system = target_machine.system()
# Fortify Source
-# Inputs: hardening_features deps
+# Inputs: hardening_features
fortify_source_opt = get_option('fortify-source')
variant_str = variant.to_string()
if fortify_source_level == variant
if cxx.has_argument('-D_FORTIFY_SOURCE=' + variant_str)
- dep_fortify = declare_dependency(compile_args: ['-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=' + variant_str])
- deps += dep_fortify
+ add_global_arguments('-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=' + variant_str, language: ['cpp'])
break
else
fortify_source_level = fortify_source_level - 1
# Read-only Global Offset Table
-# Inputs: hardening_features deps
+# Inputs: hardening_features
ld_help = run_command(cxx, '-Wl,-help', '2>&1', check: true).stdout().strip()
variants = ['relro', 'now']
foreach variant: variants
if ld_help.contains('-z ' + variant)
found_variant = true
- dep_relro = declare_dependency(link_args: ['-Wl,-z', '-Wl,' + variant])
- deps += dep_relro
+ add_global_link_arguments('-Wl,-z', '-Wl,' + variant, language: ['cpp'])
endif
endforeach
foreach variant: pie_variants
cflags = variant[0]
ldflags = variant[1]
- dep_pie = declare_dependency(compile_args: cflags, link_args: ldflags)
- # if cxx.links(prog, dependencies: dep_pie, name: 'compiler can build Position Independent Executables') # TODO Meson 0.57
if cxx.links(prog, args: cflags + ldflags, name: 'compiler can build Position Independent Executables')
- deps += dep_pie
+ add_global_arguments(cflags, language: ['cpp'])
+ add_global_link_arguments(ldflags, language: ['cpp'])
found_variant = true
break
endif
# Stack Protector
-# Inputs: hardening_features deps
+# Inputs: hardening_features
support_stack_protector = cxx.has_argument('-fstack-protector')
if support_stack_protector
- dep_sp = declare_dependency(compile_args: ['-fstack-protector'])
- deps += dep_sp
+ add_global_arguments('-fstack-protector', language: ['cpp'])
endif
hardening_features += [[support_stack_protector, 'Stack Protector']]
support_stack_smashing_protector = cxx.has_argument('--param=ssp-buffer-size=4')
if support_stack_smashing_protector
- add_global_arguments(['--param=ssp-buffer-size=4'], language: ['c', 'cpp'])
+ add_global_arguments('--param=ssp-buffer-size=4', language: ['cpp'])
endif
hardening_features += [[support_stack_smashing_protector, 'Stack Smashing Protection']]
conf.set10('HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT', has, description: 'Whether we have EVP_PKEY_CTX_set1_scrypt_salt')
if libdir != ''
- add_global_arguments(libcrypto_args + ['-I' + libdir / 'include'])
-else
- deps += dep_libcrypto
+ dep_libcrypto = declare_dependency(compile_args: libcrypto_args + ['-I' + libdir / 'include'])
endif
+deps += dep_libcrypto
+
conf.set10('HAVE_LIBCRYPTO', have_libcrypto, description: 'Whether we build OpenSSL libcrypto-based signers')
summary('OpenSSL libcrypto', have_libcrypto, bool_yn: true, section: 'Configuration')
message('Libdecaf: Checking for ' + header_path)
found_header = cxx.has_header(header, dependencies: dep_libdecaf, required: false, include_directories: dir)
if found_header
- add_global_arguments('-I' + dirname, language: 'cpp')
+ deps += declare_dependency(compile_args: ['-I' + dirname])
do_break = true
break
endif
endforeach
foreach arg: args
- dep = declare_dependency(compile_args: ['-D' + arg])
- deps += dep
+ add_global_arguments('-D' + arg, language: ['cpp'])
endforeach
foreach lib: libs
conf.set10('HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR', single_pointer, description: 'Address Sanitizer: __sanitizer_finish_switch_fiber takes only a pointer')
conf.set10('HAVE_SANITIZER_FINISH_SWITCH_FIBER_THREE_PTRS', three_pointers, description: 'Address Sanitizer: __sanitizer_finish_switch_fiber takes three pointers')
-add_global_arguments('-fsanitize=address')
+add_global_arguments('-fsanitize=address', language: ['cpp'])
summary('address', opt_address_sanitizer, bool_yn: true, section: 'Sanitizers')
if not cxx.has_argument(compiler_opt)
error(name + ' Sanitizer requested but compiler does not support `' + compiler_opt + '`')
endif
- add_global_arguments(compiler_opt)
+ add_global_arguments(compiler_opt, language: ['cpp'])
summary(name, get_variable(opt_name), bool_yn: true, section: 'Sanitizers')
endforeach
endif
if opt_address_sanitizer or opt_thread_sanitizer or opt_leak_sanitizer or opt_undefined_behavior_sanitizer or opt_memory_sanitizer
- add_global_arguments('-fno-omit-frame-pointer')
+ add_global_arguments('-fno-omit-frame-pointer', language: ['cpp'])
endif