Skip to content

How to analyze CMake projects

Xiao Jia edited this page May 24, 2022 · 8 revisions
  1. Prepare your project (with CMakeLists.txt in project root) or run the following command:

    git clone https://github.com/naivesystems/analyze-demo.git
    cd analyze-demo && mkdir -p output
  2. Prepare check_rules in the .naivesystems subdirectory (e.g. .naivesystems/check_rules). If you are using analyze-demo, this step can be skipped.

    Example: https://github.com/naivesystems/analyze-demo/blob/master/.naivesystems/check_rules

  3. Run NaiveSystems™ Analyze with Podman (suppose $PWD is your project root):

    podman run -v $PWD/.naivesystems/config:/config:Z \
      -v $PWD:/src:O -v $PWD/output:/output:Z -w /src \
      ccr.ccs.tencentyun.com/naivesystems/analyze:2022.1.0.515002 \
      /opt/naivesystems/misra_analyzer \
      --show_results --project_type=cmake