Issue with ede-ninja-project and CMake

Alastair Rankine <[email protected]> Sun, 20 Sep 2015 21:38:47 -0400
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
I discovered recently that a change in CMake has broken compatibility with ede-ninja-project.

Basically ede-ninja-project uses the native capability of the ninja build tool to generate a compilation database on the fly. In order to do this we need to specify the name of the appropriate build rules which we want to see in the output. By default, the ede-ninja-project type uses the rule names “C_COMPILER” and “CXX_COMPILER”, which were until recently the default rule names for CMake.

In the recent 3.2 release (or possibly earlier) of CMake, a change was made to the names of the build rules it generated within ninja’s build file. Instead of “CXX_COMPILER”, it will now generate build rules with names such as “CXX_COMPILER__proj”. In other words, the build rule names are no longer stable, and hence cannot easily be used with ede-ninja-project.

Workaround: For now I suggest using CMake’s CMAKE_EXPORT_COMPILE_COMMANDS variable to export a compile_commands.json file, which can be used with the regular ede-compdb-project type.

I think this is ultimately a Ninja problem, and I have raised it with them, see here: https://github.com/martine/ninja/issues/1024 <https://github.com/martine/ninja/issues/1024>

I have also added an expected failure for the affected ninja unit test within CEDET. This is intended to allow the unit tests to execute cleanly when a recent version of CMake is installed. Unfortunately there is something about the CEDET utest environment which prevents it from working correctly - instead of recording a test failure it records an aborted test case. I looked into this briefly but couldn’t work out why it was behaving like this - any advice appreciated.

By the way, I still intend to remove the runtime dependency on cmake and ninja for the unit tests of compdb - which should also fix the expected failure.

------------------------------------------------------------------------------

_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel