The cscoco Command Manual Page

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
ARGUMENTS
EXAMPLE
SEE ALSO
AUTHOR

NAME

cscoco - generate CScout workspace from a compilation database

SYNOPSIS

cscoco [-h] [-n project_name] [compile_commands.json]

DESCRIPTION

cscoco reads a compilation database in the compile_commands.json format and translates each translation unit into a CScout workspace file (.cs). The generated workspace is written to standard output. Each C translation unit is mapped to a block containing preprocessor settings (defines and include paths) and processing directives. Only C source files (.c) are processed; C++ files are skipped.

The resulting workspace file can be passed to cscout(1) for static analysis.

For the location of the workaround headers, see csmake(1).

OPTIONS

-h, --help

Display a brief usage message and exit.

-n, --name project_name

An optional project name to use in the #pragma project directive. If not specified, the name of the directory above the build directory is used, or "project" if reading from standard input.

ARGUMENTS

compile_commands.json

The compilation database to read, typically generated by CMake or Meson. If not specified, or if specified as -, cscoco reads from standard input.

EXAMPLE

To generate a CScout workspace file from a CMake build:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build .
cscoco build/compile_commands.json > project.cs

Alternatively, from a Meson build:

meson setup build
cscoco build/compile_commands.json > project.cs

This will create a project.cs file, which can then be processed by CScout:

cscout project.cs

SEE ALSO

cscout(1), csmake(1), cssplit(1)

Clang JSON Compilation Database Format: https://clang.llvm.org/docs/JSONCompilationDatabase.html

AUTHOR

(C) Copyright 2026 Diomidis Spinellis and Ujjwal Aggarwal.