This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: Can CCS use compile_commands.json for Indexer?



Tool/software: Code Composer Studio

Hello,

We use CMake to govern how projects are organized, compiled etc. The project is not created as a CCS project, but it is written for TI C2000 platform.

I managed to import the project to CCS and setup the build procedure, but I am having problems with Indexer. When I try to navigate through the code, CCS does not know which source to use as it does not understand CMakeLists.txt.

However, when I do build, the compile_commands.json is created in the build directory with information on all dependencies and compile symbols in the file. Can CCS Indexer somehow use this file to properly navigate through the project?

Thank you!
Marko.

  • Hello Marko,

    Your issue and request seems like a common one:

    https://www.eclipse.org/forums/index.php?t=msg&th=1094239&goto=1792615&#msg_1792615

    However, after some searching, I still have not found a definite answer on if this is possible. I have yet to find a workaround but if I do, I will let you know.

    ki

  • In the last post of the thread I mentioned, someone does offer a potential solution using an Eclipse plugin. That is one possibility.

  • I am aware of the cmake4eclipse plugin, but I still have not managed to set it up properly.

    I was hoping for some native support for compile_commands.json file. I mean it should not be that difficult, it is just parsing the json file to a known Eclipse format.

    I will keep trying with cmake4eclipse plugin and post a working solution if I manage to solve it.

    Please let me know if you come up with some simpler solution that does not include cmake4eclipse.

    Thank you!

  • Marko Gulin said:
    I was hoping for some native support for compile_commands.json file. I mean it should not be that difficult, it is just parsing the json file to a known Eclipse format.

    Yes, I am looking to see if there is some fix for that. The issue is that the fix would have to come from the Eclipse CDT community since this functionality is from stock Eclipse CDT

  • Marko Gulin said:
    I managed to import the project to CCS and setup the build procedure, but I am having problems with Indexer. When I try to navigate through the code, CCS does not know which source to use as it does not understand CMakeLists.txt.

    https://github.com/Chester-Gillon/AM3352-SOM-EVB_bare_metal is an example of a project which uses CMake for the build, and CCS can be used to browse/edit/build/debug.

    Initially CMake was used to create the Eclipse project files, but that had issues with Eclipse not showing the git status of the source files since the CMake project generator created the project using linked resources (which by design Eclipse doesn't consider as under configuration control).

    For the current version a "makefile project with existing code" Eclipse project was created to allow CCS to browse, edit and debug the project, with the .project and .cproject files placed under configuration control.

    To get the indexer to work the GCC ARM compiler and TI StarterWare used by this example project, the source/setup_cmake.sh (Linux) and source/setup_cmake.bat (Windows) create a script/batch file to launch CCS to open the project with environment variables set to allow the indexer to find the include files in the compiler / StarterWare library. From memory, in the manually created Eclipse project symbols and include paths were set to match those used by the CMake build.

    Also, when creating a standard Eclipse project, you have to enable Code Composer Studio Breakpoints Support to get CCS breakpoints by default - see https://e2e.ti.com/support/tools/ccs/f/81/p/699170/2589253#2589253