Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
building:advanced [2026/05/29 08:33] – created alexxconsbuilding:advanced [2026/07/21 20:11] (current) – Add key syntax for keyboard commands kevinbowen
Line 25: Line 25:
   thread apply all bt   thread apply all bt
  
-===== Build with scan-build =====+===== Build with documentation ===== 
 + 
 +  meson setup --reconfigure -Dgtk-doc=true build 
 +  meson compile -C build 
 + 
 +Documentation can be found below ''build/docs'' 
 + 
 +===== Use introspection / GtkInspector ===== 
 + 
 +''GtkInspector'' is a very nice tool to debug visual things during runtime. First you need to build the project with introspection support:  
 + 
 +Pre requirements: 
 + 
 +  * install package libgirepository1.0-dev 
 +  * gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true 
 + 
 +Building: 
 + 
 +  meson setup --reconfigure -Dintrospection=true build 
 +  meson compile -C build 
 +   
 +Then you can start ''GtkInspector'' for the application by pressing {key>Ctrl+Shift+D} or {key>Ctrl+Shift+I} during runtime 
 + 
 +[[https://developer.gnome.org/documentation/tools/inspector.html|Here some general gtk inspector information]] 
 + 
 +===== Static analysis ===== 
 + 
 +==== Build with scan-build ====
  
 ''scan-build'' does some static code analysis for a project. It can be used like this: ''scan-build'' does some static code analysis for a project. It can be used like this:
Line 38: Line 65:
 The reports are in HTML and can be viewed with a browser The reports are in HTML and can be viewed with a browser
  
-===== Build with documentation =====+==== Build with gcc static analyzer ====
  
-  meson setup --reconfigure -Dgtk-doc=true build+  rm -rf build 
 +  CPPFLAGS=-fanalyzer meson setup build
   meson compile -C build   meson compile -C build
  
-Documentation can be found below ''build/docs''+==== Run cppcheck ====
  
-===== Use introspection GtkInspector =====+You need to have xfce4-dev-tools >4.21.2 installed for this to work, so cppcheck founds the file ''$cppcheck_cfg_prefix/cppcheck/cfg/xfce.cfg''. If the default ''$cppcheck_cfg_prefix'' (''$libdir'') doesn't work for you (it works on ubuntu, so probably on any debian derived distro), you'll have to set it at configure time when building xfce4-dev-tools using the ''<nowiki>--with-cppcheck-cfg-prefix</nowiki>'' command line option.
  
-''GtkInspector'' is a very nice tool to debug visual things during runtimeFirst you need to build the project with introspection support: +See also the comment in the cppcheck job in [[https://gitlab.xfce.org/xfce/xfce4-dev-tools/-/blob/master/ci/build_project.yml|xfce4-dev-tools/ci/build_project.yml]] for more info on how to populate the file ''.cppcheck-false-positives'', and [[https://gitlab.xfce.org/xfce/xfce4-dev-tools/-/blob/master/ci/xfce.cfg|xfce4-dev-tools/ci/xfce.cfg]] as an example for the file ''.cppcheck.cfg'' if necessary.
  
-  meson setup --reconfigure -Dintrospection=true build +  cppcheck -i build -j $(nproc) $([ -f .cppcheck.cfg ] && echo --library=.cppcheck.cfg) --library=gtk --library=xfce -I . \ 
-  meson compile -C build +    --suppressions-list=<(awk -F : '{print $1 ":" $2}$(-f .cppcheck-false-positives && echo .cppcheck-false-positives || echo /dev/null) | sort -u) \ 
-   +    --enable=style --suppress=variableScope --suppress=constParameterPointer --suppress=constVariablePointer --suppress=constParameterCallback \ 
-Then you can start ''GtkInspector'' for the application by pressing [CTRL][SHIFT][D] during runtime+    --enable=information --check-level=exhaustive --force --suppress=unmatchedSuppression \ 
 +    --enable=warning,performance,portability --error-exitcode=1 $CPPCHECK_ARGS --quiet .