]> git.mdlowis.com Git - proto/labwc.git/commitdiff
CI: enable gcc static analyzer
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 8 Apr 2024 15:32:16 +0000 (17:32 +0200)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 10 Apr 2024 06:14:59 +0000 (08:14 +0200)
.github/workflows/build.yml
meson.build
meson_options.txt

index db5621c2a5ccc9f84705cb88601998b798695ec1..7f91f07dc9515dfcac8eca13251b8ded4b9341bd 100644 (file)
@@ -155,6 +155,17 @@ jobs:
             meson compile -C build-gcc-release
           ' | $TARGET
 
+      - name: Build with gcc - static analyzer
+        run: |
+          echo '
+            cd "$GITHUB_WORKSPACE"
+            export CC=gcc
+            meson setup build-gcc-static_analyzer -Dxwayland=enabled \
+              -Dstatic_analyzer=enabled --werror
+            meson compile -C build-gcc-static_analyzer
+          ' | $TARGET
+
+
       # Runtime tests, these run on Debian and Void only (the later due to libmusl being used)
       - name: Build with clang - release
         run: |
index adbd54557ff401b2814efb0f5ed21ae6e8c61021..25e050fd25c77dac6b73875f65c8a0ed77392efa 100644 (file)
@@ -87,6 +87,10 @@ else
 endif
 conf_data.set10('HAVE_RSVG', have_rsvg)
 
+if get_option('static_analyzer').enabled()
+  add_project_arguments(['-fanalyzer'], language: 'c')
+endif
+
 msgfmt = find_program('msgfmt', required: get_option('nls'))
 if msgfmt.found()
   source_root = meson.current_source_dir()
index 9104ec9ad4c1ede61975877ed5ee2d9e6a1fc59b..d9cb73a86c0ff8cd958117c413c4a9b91260aab2 100644 (file)
@@ -2,3 +2,4 @@ option('man-pages', type: 'feature', value: 'auto', description: 'Generate and i
 option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
 option('svg', type: 'feature', value: 'enabled', description: 'Enable svg window buttons')
 option('nls', type: 'feature', value: 'auto', description: 'Enable native language support')
+option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer')