currently, CMake does not create the file
compile_commands.json if the project has no compile commands:
cmake_minimum_required( VERSION 3.17.0 ) project(ExportCompileCommands) # workaround for CMake 3.17.0 set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
as a first time user of this feature I did not expect this.
CMAKE_EXPORT_COMPILE_COMMANDS is enabled and no commands exist I suggest that
compile_commands.json should still be generated. For both human and machine processing the expected file content should be