I am trying to create a CI/CD pipeline in gitlab that builds my project in the first stage and uses clang-tidy to run static analysis in the second stage. I soon realized that clang-tidy uses the compile_commands.json file (which is generated during build if CMake is used). I shifted gears to create a pipeline for the open-source project “Iceoryx” as they have all the necessary files (CMakeLists.txt
, .clangtidy
, etc.) already in the project and well documented. However, even though I am able to build and compile the Iceoryx project successfully, there is no compile_commands.json
file being generated.
I am currently trying to build the project locally (without the pipeline) to see if compile_commands.json
file is generated that way but have not had luck so far. I have included the directions I am following and the commands I am using at the moment. Would love some guidance as to what I might be doing wrong that is causing the compile_commands.json
file to not generate.
Directions (Windows) for project setup from the Iceoryx github repo:
https://github.com/eclipse-iceoryx/iceoryx/blob/main/doc/website/getting-started/installation.md
Build Commands:
cmake -Bbuild -Hiceoryx_meta -DBUILD_TEST=ON -DINTROSPECTION=OFF -DBINDING_C=ON -DEXAMPLES=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build -j 4
Dhruv Dighrasker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
Resolved: Based of the comment above, I realized that the compile_commands.json file can only be generated for Makefile ad Ninja generator. I then proceeded to use the MinGW Makefile generator and was able to successfully build and generate the necessary files!
Dhruv Dighrasker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.