Xfce Wiki

Sub domains
 

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
building:advanced [2026/05/29 10:07] – [Use introspection / GtkInspector] alexxconsbuilding:advanced [2026/12/05 03:04] (current) – add footer links and back link to docs.x.o. build page kevinbowen
Line 1: Line 1:
 ====== Advanced Building and Debugging Information for Xfce components ====== ====== Advanced Building and Debugging Information for Xfce components ======
  
-While the basic build steps are explained here, this page provides some information about build specifics you probably will need on special occasions.+While the basic build steps are explained [[https://docs.xfce.org/xfce/building#package_specific_dependencies|here]], this page provides some addional information about build specifics you may need on special occasions.
  
 ===== Debugging with gdb ===== ===== Debugging with gdb =====
Line 24: Line 24:
  
   thread apply all bt   thread apply all bt
- 
-===== Build with scan-build ===== 
- 
-''scan-build'' does some static code analysis for a project. It can be used like this: 
- 
-  # using --reconfigure won't work ... you need to remove the build folder! 
-  rm -rf build 
-   
-  # setup and build the project ... the concrete version of scan-build to use can differ 
-  CC=clang scan-build-19 --use-cc=clang meson setup build 
-  CC=clang scan-build-19 --use-cc=clang meson compile -C build 
- 
-The reports are in HTML and can be viewed with a browser 
  
 ===== Build with documentation ===== ===== Build with documentation =====
Line 59: Line 46:
   meson compile -C build   meson compile -C build
      
-Then you can start ''GtkInspector'' for the application by pressing [CTRL][SHIFT][D] during runtime+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: 
 + 
 +  # using --reconfigure won't work ... you need to remove the build folder! 
 +  rm -rf build 
 +   
 +  # setup and build the project ... the concrete version of scan-build to use can differ 
 +  CC=clang scan-build-19 --use-cc=clang meson setup build 
 +  CC=clang scan-build-19 --use-cc=clang meson compile -C build 
 + 
 +The reports are in HTML and can be viewed with a browser 
 + 
 +==== Build with gcc static analyzer ==== 
 + 
 +  rm -rf build 
 +  CPPFLAGS=-fanalyzer meson setup build 
 +  meson compile -C build 
 + 
 +==== Run cppcheck ==== 
 + 
 +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. 
 + 
 +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. 
 + 
 +  cppcheck -i build -j $(nproc) $([ -f .cppcheck.cfg ] && echo --library=.cppcheck.cfg) --library=gtk --library=xfce -I . \ 
 +    --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 \ 
 +    --enable=information --check-level=exhaustive --force --suppress=unmatchedSuppression \ 
 +    --enable=warning,performance,portability --error-exitcode=1 $CPPCHECK_ARGS --quiet . 
 + 
 +==== Test building strings for translation ==== 
 + 
 +In the main project directory: 
 + 
 +  xgettext --files-from=po/POTFILES.in --from-code=UTF-8 -o messages.pot 
 + 
 +Note that some projects do use .its/.loc file to apply different rules to specific file types. TOOO: Add info on how these are considered 
 + 
 +---- 
 + 
 +[[https://docs.xfce.org/xfce/building|Return to Building Xfce from Source page]] 
  
-[[https://wiki.gnome.org/action/show/Projects/GTK/Inspector?action=show&redirect=Projects%2FGTK%2B%2FInspector|Here some general gtk inspector information]]+[[:start|Return to Main Xfce Wiki Page]]