diff options
author | David Robillard <d@drobilla.net> | 2023-05-02 15:57:51 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-05-02 20:22:54 -0400 |
commit | b759f6750645d32742e8c224f93063e692b4b278 (patch) | |
tree | 5e7f4b06425d80be191cbc23d67aee14c6eaa1dc | |
parent | a09a60a814346b58a75a509f5bc5a41e543bae2c (diff) | |
download | drobillad-b759f6750645d32742e8c224f93063e692b4b278.tar.gz drobillad-b759f6750645d32742e8c224f93063e692b4b278.tar.bz2 drobillad-b759f6750645d32742e8c224f93063e692b4b278.zip |
Replace strict option with new meson warning level
-rw-r--r-- | .gitlab-ci.yml | 21 | ||||
-rw-r--r-- | meson.build | 5 | ||||
-rw-r--r-- | meson/warnings/meson.build | 256 | ||||
-rw-r--r-- | meson_options.txt | 10 | ||||
m--------- | subprojects/blop.lv2 | 0 | ||||
m--------- | subprojects/fomp.lv2 | 0 | ||||
m--------- | subprojects/ganv | 0 | ||||
m--------- | subprojects/ingen | 0 | ||||
m--------- | subprojects/jalv | 0 | ||||
m--------- | subprojects/lv2kit | 0 | ||||
m--------- | subprojects/mda.lv2 | 0 | ||||
m--------- | subprojects/patchage | 0 | ||||
m--------- | subprojects/raul | 0 |
13 files changed, 16 insertions, 276 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22cc955..c618786 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ dev: stage: build image: lv2plugin/debian-x64-big script: - - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=3 -Dwerror=true - ninja -C build test - meson configure -Dbuildtype=release -Db_coverage=false build - ninja -C build test @@ -27,14 +27,14 @@ static: stage: build image: lv2plugin/debian-x64-big script: - - meson setup build --wrap-mode=forcefallback -Ddefault_library=static -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Ddefault_library=static -Ddocs=disabled -Dwarning_level=3 -Dwerror=true - ninja -C build test sanitize: stage: build image: lv2plugin/debian-x64-clang script: - - meson setup build --wrap-mode=forcefallback -Db_lundef=false -Dbuildtype=plain -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Db_lundef=false -Dbuildtype=plain -Ddocs=disabled -Dwarning_level=3 -Dwerror=true - ninja -C build test variables: CC: "clang" @@ -49,10 +49,11 @@ fedora: stage: build image: lv2plugin/fedora-dev script: - - meson setup build --wrap-mode=forcefallback -Dbuildtype=plain -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Dbuildtype=plain -Dwarning_level=3 -Dwerror=true - ninja -C build test variables: CFLAGS: -O2 -D_FORTIFY_SOURCE=2 + CXXFLAGS: -O2 -D_FORTIFY_SOURCE=2 # Linux Platforms @@ -60,7 +61,7 @@ arm32: stage: build image: lv2plugin/debian-arm32 script: - - meson setup build --wrap-mode=forcefallback --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=3 -Dwerror=true - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test @@ -69,7 +70,7 @@ arm64: stage: build image: lv2plugin/debian-arm64 script: - - meson setup build --wrap-mode=forcefallback --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=3 -Dwerror=true - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test @@ -78,7 +79,7 @@ x32: stage: build image: lv2plugin/debian-x32 script: - - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test @@ -89,7 +90,7 @@ freebsd: stage: build tags: [freebsd,meson] script: - - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true -Ddocs=disabled - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test @@ -98,7 +99,7 @@ mac: stage: build tags: [macos] script: - - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test @@ -107,7 +108,7 @@ win: stage: build tags: [windows,meson] script: - - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dstrict=true -Dwerror=true + - meson setup build --wrap-mode=forcefallback -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true - ninja -C build test - meson configure -Dbuildtype=release build - ninja -C build test diff --git a/meson.build b/meson.build index e03cdf3..080143a 100644 --- a/meson.build +++ b/meson.build @@ -18,11 +18,6 @@ pkg = import('pkgconfig') cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') -# Set global warning flags -if get_option('strict') and not meson.is_subproject() - subdir('meson/warnings') -endif - ########################## # LV2 Path Configuration # ########################## diff --git a/meson/warnings/meson.build b/meson/warnings/meson.build deleted file mode 100644 index 9746c9c..0000000 --- a/meson/warnings/meson.build +++ /dev/null @@ -1,256 +0,0 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> -# SPDX-License-Identifier: 0BSD OR ISC - -# General code to enable approximately all warnings in GCC 12, clang, and MSVC. -# -# This is trivial for clang and MSVC, but GCC doesn't have an "everything" -# option, so we need to enable everything we want explicitly. Wall is assumed, -# but Wextra is not, for stability. -# -# These are collected from common.opt and c.opt in the GCC source, and manually -# curated with the help of the GCC documentation. Warnings that are -# application-specific, historical, or about compatibility between specific -# language revisions are omitted. The intent here is to have roughly the same -# meaning as clang's Weverything: extremely strict, but general. Specifically -# omitted are: -# -# General: -# -# Wabi= -# Waggregate-return -# Walloc-size-larger-than=BYTES -# Walloca-larger-than=BYTES -# Wframe-larger-than=BYTES -# Wlarger-than=BYTES -# Wstack-usage=BYTES -# Wsystem-headers -# Wtraditional -# Wtraditional-conversion -# Wtrampolines -# Wvla-larger-than=BYTES -# -# Build specific: -# -# Wpoison-system-directories -# -# C Specific: -# -# Wc11-c2x-compat -# Wc90-c99-compat -# Wc99-c11-compat -# Wdeclaration-after-statement -# Wtraditional -# Wtraditional-conversion -# -# C++ Specific: -# -# Wc++0x-compat -# Wc++1z-compat -# Wc++2a-compat -# Wctad-maybe-unsupported -# Wnamespaces -# Wtemplates - -# GCC warnings that apply to all C-family languages -gcc_common_warnings = [ - '-Walloc-zero', - '-Walloca', - '-Wanalyzer-too-complex', - '-Warith-conversion', - '-Warray-bounds=2', - '-Wattribute-alias=2', - '-Wbidi-chars=ucn', - '-Wcast-align=strict', - '-Wcast-function-type', - '-Wcast-qual', - '-Wclobbered', - '-Wconversion', - '-Wdate-time', - '-Wdisabled-optimization', - '-Wdouble-promotion', - '-Wduplicated-branches', - '-Wduplicated-cond', - '-Wempty-body', - '-Wendif-labels', - '-Wfloat-equal', - '-Wformat-overflow=2', - '-Wformat-signedness', - '-Wformat-truncation=2', - '-Wformat=2', - '-Wignored-qualifiers', - '-Wimplicit-fallthrough=3', - '-Winit-self', - '-Winline', - '-Winvalid-pch', - '-Wlogical-op', - '-Wmissing-declarations', - '-Wmissing-field-initializers', - '-Wmissing-include-dirs', - '-Wmultichar', - '-Wnormalized=nfc', - '-Wnull-dereference', - '-Wopenacc-parallelism', - '-Woverlength-strings', - '-Wpacked', - '-Wpacked-bitfield-compat', - '-Wpadded', - '-Wpointer-arith', - '-Wredundant-decls', - '-Wshadow', - '-Wshift-negative-value', - '-Wshift-overflow=2', - '-Wstack-protector', - '-Wstrict-aliasing=3', - '-Wstrict-overflow=5', - '-Wstring-compare', - '-Wstringop-overflow=3', - '-Wsuggest-attribute=cold', - '-Wsuggest-attribute=const', - '-Wsuggest-attribute=format', - '-Wsuggest-attribute=malloc', - '-Wsuggest-attribute=noreturn', - '-Wsuggest-attribute=pure', - '-Wswitch-default', - '-Wswitch-enum', - '-Wtrampolines', - '-Wtrivial-auto-var-init', - '-Wtype-limits', - '-Wundef', - '-Wuninitialized', - '-Wunsafe-loop-optimizations', - '-Wunused', - '-Wunused-const-variable=2', - '-Wunused-macros', - '-Wvector-operation-performance', - '-Wvla', - '-Wwrite-strings', -] - -##### -# C # -##### - -if is_variable('cc') - # Set all_c_warnings for the current C compiler - all_c_warnings = [] - - if get_option('strict') - if cc.get_id() == 'clang' - all_c_warnings += ['-Weverything'] - - if not meson.is_cross_build() - all_c_warnings += [ - '-Wno-poison-system-directories', - ] - endif - - elif cc.get_id() == 'gcc' - all_c_warnings += gcc_common_warnings + [ - '-Wabsolute-value', - '-Wbad-function-cast', - '-Wc++-compat', - '-Wenum-conversion', - '-Wjump-misses-init', - '-Wmissing-parameter-type', - '-Wmissing-prototypes', - '-Wnested-externs', - '-Wold-style-declaration', - '-Wold-style-definition', - '-Woverride-init', - '-Wsign-compare', - '-Wstrict-prototypes', - '-Wunsuffixed-float-constants', - ] - - elif cc.get_id() == 'msvc' - all_c_warnings += [ - '/Wall', - '/experimental:external', - '/external:W0', - '/external:anglebrackets', - ] - endif - endif - - all_c_warnings = cc.get_supported_arguments(all_c_warnings) - add_global_arguments(all_c_warnings, language: ['c']) -endif - -####### -# C++ # -####### - -if is_variable('cpp') - # Set all_cpp_warnings for the current C++ compiler - all_cpp_warnings = [] - - if get_option('strict') - if cpp.get_id() == 'clang' - all_cpp_warnings += [ - '-Weverything', - '-Wno-c++98-compat', - '-Wno-c++98-compat-pedantic', - ] - - if not meson.is_cross_build() - all_cpp_warnings += [ - '-Wno-poison-system-directories', - ] - endif - - elif cpp.get_id() == 'gcc' - all_cpp_warnings += gcc_common_warnings + [ - '-Wabi-tag', - '-Waligned-new=all', - '-Wcatch-value=3', - '-Wcomma-subscript', - '-Wconditionally-supported', - '-Wctor-dtor-privacy', - '-Wdelete-non-virtual-dtor', - '-Wdeprecated', - '-Wdeprecated-copy', - '-Wdeprecated-copy-dtor', - '-Wdeprecated-enum-enum-conversion', - '-Wdeprecated-enum-float-conversion', - '-Weffc++', - '-Wexpansion-to-defined', - '-Wextra-semi', - '-Wimport', - '-Winvalid-imported-macros', - '-Wmismatched-tags', - '-Wmultiple-inheritance', - '-Wnoexcept', - '-Wnoexcept-type', - '-Wnon-virtual-dtor', - '-Wold-style-cast', - '-Woverloaded-virtual', - '-Wplacement-new=2', - '-Wredundant-move', - '-Wredundant-tags', - '-Wregister', - '-Wsign-compare', - '-Wsign-promo', - '-Wsized-deallocation', - '-Wstrict-null-sentinel', - '-Wsuggest-final-methods', - '-Wsuggest-final-types', - '-Wsuggest-override', - '-Wuseless-cast', - '-Wvirtual-inheritance', - '-Wvolatile', - '-Wzero-as-null-pointer-constant', - ] - - elif cpp.get_id() == 'msvc' - all_cpp_warnings += [ - '/Wall', - '/experimental:external', - '/external:W0', - '/external:anglebrackets', - ] - endif - endif - - all_cpp_warnings = cpp.get_supported_arguments(all_cpp_warnings) - add_global_arguments(all_cpp_warnings, language: ['cpp']) -endif diff --git a/meson_options.txt b/meson_options.txt index 6002087..a5c3a32 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,8 +1,8 @@ # Copyright 2021-2022 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -option('checks', type: 'boolean', value: true, yield: true, - description: 'Check for features with the build system') +option('checks', type: 'feature', value: 'enabled', yield: true, + description: 'Check for platform-specific features') option('docs', type: 'feature', value: 'auto', description: 'Build documentation') @@ -16,6 +16,9 @@ option('ingen', type: 'feature', value: 'auto', option('jalv', type: 'feature', value: 'auto', description: 'Build jalv') +option('lint', type: 'boolean', value: false, yield: true, + description: 'Run code quality checks') + option('lv2dir', type: 'string', value: '', yield: true, description: 'LV2 bundle installation directory') @@ -31,8 +34,5 @@ option('plugins', type: 'feature', value: 'auto', option('raul', type: 'feature', value: 'auto', description: 'Build raul') -option('strict', type: 'boolean', value: false, yield: true, - description: 'Enable ultra-strict warnings') - option('tests', type: 'feature', value: 'auto', yield: true, description: 'Build tests') diff --git a/subprojects/blop.lv2 b/subprojects/blop.lv2 -Subproject a9ea9497cbcd3cbb67411f8a9755ad15dbfac09 +Subproject 68f5536daf01d4bc8a253c913a735994dbf7085 diff --git a/subprojects/fomp.lv2 b/subprojects/fomp.lv2 -Subproject 0d14d749f7cb6c5fb98a9f506936dec3315fe93 +Subproject a443f4d071522815ed59dfaf0692d2d1f408ac3 diff --git a/subprojects/ganv b/subprojects/ganv -Subproject 8570dca811848ce9da417a367321f2e0087b05c +Subproject 98bfa2664067a2274c40431d94dc00b8f5e52f8 diff --git a/subprojects/ingen b/subprojects/ingen -Subproject 8035015f9e583f483279d306b9bae6096c0bd35 +Subproject fce7b27e0a1e69decdef07e751de06089ed6312 diff --git a/subprojects/jalv b/subprojects/jalv -Subproject c14e8453649b002ecd9e31f63f3af3ee782a2aa +Subproject 94579ca4070b40cf7e690ee41bfdde16404df38 diff --git a/subprojects/lv2kit b/subprojects/lv2kit -Subproject 2f552152a882e127eca57925ab25ded9a2bca7d +Subproject b4ce7565f6d7e4bc168b1d254f469f240aeca49 diff --git a/subprojects/mda.lv2 b/subprojects/mda.lv2 -Subproject 3a4e73ea217e91e44002dc23cef7b08b772fa8f +Subproject 6caf63f4663687ea3816d99a279c97fb5585edf diff --git a/subprojects/patchage b/subprojects/patchage -Subproject beb23867f8cfd5bc0c58b8044de3433b40c2b3e +Subproject 8987e2ab771b8494269387e57e670866307fe1b diff --git a/subprojects/raul b/subprojects/raul -Subproject 32a95bd5024623befa3ed445400075a6faae752 +Subproject 59ae4ffb41e381f794251297e46ffaaaad74840 |