mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
build: Add feature test flags to project-wide preprocessor flags
Rather than defining them piecemeal in each C and H file, and having problems with headers being included in different orders so that `_POSIX_C_SOURCE` gets a value which is too low, just define the feature test flags in `meson.build`. See `man 7 feature_test_macros`. This is useful for when building sysprof as a subproject beneath a project which doesn’t define these macros, or which targets an older C standard than `gnu11`. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@ -87,7 +87,10 @@ add_project_arguments([
|
||||
'-I' + meson.build_root(), # config.h
|
||||
], language: 'c')
|
||||
|
||||
global_c_args = []
|
||||
global_c_args = [
|
||||
'-D_GNU_SOURCE',
|
||||
'-D_POSIX_C_SOURCE=200809L',
|
||||
]
|
||||
test_c_args = [
|
||||
'-Wcast-align',
|
||||
'-Wdeclaration-after-statement',
|
||||
|
||||
Reference in New Issue
Block a user