Using JustBuild with your favorite editor or IDE

2025-05-23 (last update) / (published at) 2025-05-23


To build with JustBuild, use it instead of Make. The default goal is "all".


Command line for:

  • Incremental build : justbuild or justbuild all
  • Clean : justbuild clean
  • DistClean : justbuild distclean
  • Rebuild : justbuild clean-all or justbuild rebuild or justbuild reall


The purpose of "distclean" is: to execute the "clean" commands and, in addition, to remove deployed files. Alternatively, in the JustBuild configuration, "clean" can be set to execute "distclean" instead.


Below is a list of example configurations for several editors and IDEs. For other IDEs, such as Visual Studio, Visual Studio Code, Qt Creator, CLion, Eclipse, etc.: change the "custom build" settings in a similar way.

For automatic updating of LSP files, enable regen4ide or use your preferred tool inside Just Build configuration.


Example: Start with regen4ide -h and look at --gen-lsp-file .clangd or --gen-lsp-file compile_flags.txt. If you are not familiar with clang LSP or just want a quick start, create a .clangd file with these lines:

CompileFlags:
  Compiler: clang++
  Add:
    - -I/some/dirs/adapted/to/current/projects
    - -xc++
Diagnostics:
  UnusedIncludes:  None
  MissingIncludes: None

Alternatively, use the regen4ide --gen-lsp-file compile_flags.txt variant where no template is required, but with no room for LSP fine-tuning options.

By default, regen4ide updates files based on what it finds on disk, so subsequent runs require no arguments.


Don't forget to update PATH so that all tools can be found at runtime.


JustBuild from Emacs

'(compile-command "justbuild ")
  • (optional) Install and use as usual: eglot, lsp-mode, flymake.
  • (optional) Install and use as usual: projectile.

JustBuild from Vim/Gvim/Nvim

set makeprg=justbuild
  • (optional) Activate LSP client.

JustBuild from Kate

  • / menu / Plugins : Build Plugin : true
  • / Build Output / Target Settings :
    • Build : justbuild all
    • Clean : justbuild clean
    • Rebuild : justbuild clean-all
  • (optional) / menu / Plugins : LSP Client : true

JustBuild from Notepad++

  • / menu / Plugins / NppExec / Execute NppExec Script :
    NPP_SAVE
    cd $(CURRENT_DIRECTORY)
    justbuild

JustBuild from CodeLite

General settings:

  • / menu / Settings / Build Settings / Make : justbuild

Project specific settings:

  • / menu / Project Settings / Customize / Enable custom build: true

    • Build : justbuild all
    • Clean : justbuild clean
    • Rebuild : justbuild clean-all
  • (optional) Activate LSP client.

JustBuild from Geany

  • / menu / Build / Set Build Commands :
    • Make All: justbuild all
    • Make Clean: justbuild clean

JustBuild from CodeBlocks

General settings:

  • / menu / Settings / Compiler / Toolchain executables :
    • Make program: justbuild

Project specific settings:

  • / menu / Project Settings / Project Build Options / "Make" commands:
    • Build project/target : justbuild all
    • Clean project/target : justbuild clean

Previous Article Next Article

..