diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-08 06:35:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-08 06:35:16 +0200 |
commit | e9a2eb940d6de2afdb70acba1da0e5a412637906 (patch) | |
tree | 0c831ec8a22f9fac05134550efb5573319c33aee | |
parent | 9771466fc4f95df639e76c8bd511856c4300af02 (diff) |
-rw-r--r-- | bdep/new.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx index 7c0f6f5..be31121 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -1887,9 +1887,23 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) << "*.pc" << '\n'; } + // In the future we could use the language specified for an empty + // project type to decide whether to add compile_commands.json to + // .gitignore (which only makes sense for the C and C++ languages). + // + bool cdb (true); + if (cdb) + { + if (!pkg || t != type::empty) + os << '\n'; + os << "# Compilation database." << '\n' + << "#" << '\n' + << "compile_commands.json" << '\n'; + } + // Only print the newline if anything is printed. // - if (newline && (!pkg || t != type::empty)) + if (newline && (!pkg || t != type::empty || cdb)) os << '\n'; }; |