From 8399bd6b8f86b74688a45acd4913414fcc19583b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 27 Jun 2024 16:11:52 -0400 Subject: [PATCH] Dedup --- meson-utils/diagnostics/meson.build | 16 ++++++++++++++++ src/libexpr-c/meson.build | 14 ++------------ src/libexpr-test-support/meson.build | 14 ++------------ src/libexpr-test/meson.build | 14 ++------------ src/libexpr/meson.build | 15 ++------------- src/libfetchers-test/meson.build | 14 ++------------ src/libfetchers/meson.build | 15 ++------------- src/libflake-test/meson.build | 14 ++------------ src/libflake/meson.build | 14 ++------------ src/libstore-c/meson.build | 14 ++------------ src/libstore-test-support/meson.build | 14 ++------------ src/libstore-test/meson.build | 14 ++------------ src/libstore/meson.build | 15 ++------------- src/libutil-c/meson.build | 15 ++------------- src/libutil-test-support/meson.build | 15 ++------------- src/libutil-test/meson.build | 15 ++------------- src/libutil/meson.build | 15 ++------------- 17 files changed, 48 insertions(+), 199 deletions(-) create mode 100644 meson-utils/diagnostics/meson.build diff --git a/meson-utils/diagnostics/meson.build b/meson-utils/diagnostics/meson.build new file mode 100644 index 000000000..eb0c636c0 --- /dev/null +++ b/meson-utils/diagnostics/meson.build @@ -0,0 +1,16 @@ +add_project_arguments( + '-Wno-deprecated-declarations', + '-Wimplicit-fallthrough', + '-Werror=switch', + '-Werror=switch-enum', + '-Werror=unused-result', + '-Wdeprecated-copy', + '-Wignored-qualifiers', + # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked + # at ~1% overhead in `nix search`. + # + # FIXME: remove when we get meson 1.4.0 which will default this to on for us: + # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions + '-D_GLIBCXX_ASSERTIONS=1', + language : 'cpp', +) diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build index b242c2d8e..477640240 100644 --- a/src/libexpr-c/meson.build +++ b/src/libexpr-c/meson.build @@ -50,21 +50,11 @@ add_project_arguments( '-include', 'config-util.h', '-include', 'config-store.h', '-include', 'config-expr.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'nix_api_expr.cc', 'nix_api_external.cc', diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build index 4209a4464..ad3108a61 100644 --- a/src/libexpr-test-support/meson.build +++ b/src/libexpr-test-support/meson.build @@ -36,21 +36,11 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', '-include', 'config-expr.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'tests/value/context.cc', ) diff --git a/src/libexpr-test/meson.build b/src/libexpr-test/meson.build index 11ab5c6e2..e5bb771e3 100644 --- a/src/libexpr-test/meson.build +++ b/src/libexpr-test/meson.build @@ -48,21 +48,11 @@ add_project_arguments( '-include', 'config-util.h', '-include', 'config-store.h', '-include', 'config-expr.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'derived-path.cc', 'error_traces.cc', diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 8d37947b1..d99f80486 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -66,22 +66,11 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', # '-include', 'config-fetchers.h', - '-include', 'config-expr.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + parser_tab = custom_target( input : 'parser.y', output : [ diff --git a/src/libfetchers-test/meson.build b/src/libfetchers-test/meson.build index 846d2d70a..30056c64a 100644 --- a/src/libfetchers-test/meson.build +++ b/src/libfetchers-test/meson.build @@ -45,21 +45,11 @@ add_project_arguments( '-include', 'config-store.hh', '-include', 'config-util.h', '-include', 'config-store.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'public-key.cc', ) diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 07ec2bc57..16645bda3 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -38,22 +38,11 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', # '-include', 'config-fetchers.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'attrs.cc', 'cache.cc', diff --git a/src/libflake-test/meson.build b/src/libflake-test/meson.build index e4665ce9c..b5f0c2fb4 100644 --- a/src/libflake-test/meson.build +++ b/src/libflake-test/meson.build @@ -49,21 +49,11 @@ add_project_arguments( '-include', 'config-util.h', '-include', 'config-store.h', '-include', 'config-expr.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'flakeref.cc', 'url-name.cc', diff --git a/src/libflake/meson.build b/src/libflake/meson.build index b0c172f0c..13541fc43 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -39,21 +39,11 @@ add_project_arguments( '-include', 'config-store.hh', # '-include', 'config-fetchers.h', '-include', 'config-expr.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'flake-settings.cc', 'flake/config.cc', diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build index b86209720..cd068fed2 100644 --- a/src/libstore-c/meson.build +++ b/src/libstore-c/meson.build @@ -46,21 +46,11 @@ add_project_arguments( # From C libraries, for our public, installed headers too '-include', 'config-util.h', '-include', 'config-store.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'nix_api_store.cc', ) diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build index 9c798e9cb..adf6f685e 100644 --- a/src/libstore-test-support/meson.build +++ b/src/libstore-test-support/meson.build @@ -33,21 +33,11 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-store.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'tests/derived-path.cc', 'tests/outputs-spec.cc', diff --git a/src/libstore-test/meson.build b/src/libstore-test/meson.build index 3ec7fbbd7..cb561977c 100644 --- a/src/libstore-test/meson.build +++ b/src/libstore-test/meson.build @@ -43,21 +43,11 @@ add_project_arguments( '-include', 'config-store.hh', '-include', 'config-util.h', '-include', 'config-store.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'common-protocol.cc', 'content-address.cc', diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 8ec12e42f..d2a5acb18 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -150,22 +150,11 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-store.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'binary-cache-store.cc', 'build-result.cc', diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build index b8c74bf11..6c316784d 100644 --- a/src/libutil-c/meson.build +++ b/src/libutil-c/meson.build @@ -42,22 +42,11 @@ add_project_arguments( # From C libraries, for our public, installed headers too '-include', 'config-util.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'nix_api_util.cc', ) diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build index 4239003c5..d63fabce5 100644 --- a/src/libutil-test-support/meson.build +++ b/src/libutil-test-support/meson.build @@ -30,22 +30,11 @@ add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'tests/hash.cc', 'tests/string_callback.cc', diff --git a/src/libutil-test/meson.build b/src/libutil-test/meson.build index 8d9d32151..43001ca68 100644 --- a/src/libutil-test/meson.build +++ b/src/libutil-test/meson.build @@ -38,22 +38,11 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-util.h', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'args.cc', 'canon-path.cc', diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 317b06da0..7a4dfaf50 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -111,22 +111,11 @@ add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', - '-Wno-deprecated-declarations', - '-Wimplicit-fallthrough', - '-Werror=switch', - '-Werror=switch-enum', - '-Werror=unused-result', - '-Wdeprecated-copy', - '-Wignored-qualifiers', - # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked - # at ~1% overhead in `nix search`. - # - # FIXME: remove when we get meson 1.4.0 which will default this to on for us: - # https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions - '-D_GLIBCXX_ASSERTIONS=1', language : 'cpp', ) +subdir('meson-utils/diagnostics') + sources = files( 'archive.cc', 'args.cc',