jalcine / cmake.vim

:hammer: CMake functionality within Vim.
https://jalcine.github.io/cmake.vim
MIT License
74 stars 11 forks source link

Add Ninja support #26

Closed bchretien closed 9 years ago

bchretien commented 10 years ago

Ninja is a fast alternative to make, and CMake supports it. If you have never tried it, you should definitely check it out, it's really cool. cmake.vim could benefit from this. To generate Ninja files, this is simply:

$ cmake -GNinja ..

I guess you'd need to adapt this part, and make sure that ninja is called instead of make. FYI, I currently use ninja with vim-dispatch by simply setting makeprg accordingly.

jalcine commented 10 years ago

Sounds like a plan, but probably would want to slate this as a breaking chance since a lot of the other commands use make directly. I've been meaning to use CMake's wrapper commands on that (and also do some version checking on CMake to invoke the right commands for the right version).

jalcine commented 10 years ago

Added e1dbf54; that's like one segway for this. My visions is to eventually whatever the commands necessary for a build transparent (by means of using cmake in place of all make commands).

bchretien commented 10 years ago

For the build process itself, vim-dispatch makes a really good job, so makeprg could be set to the proper value here (make or ninja) to make things more transparent. Then you'd just need to replace the explicit make in your code to use that variable, and you can still offer some simple compilation functions for people who do not need asynchronous builds, tmux integration etc.

jalcine commented 10 years ago

I'd want to remove those references from the project altogether. I know that cmake has a way to invoke make build or ninja build without one having to know those specific commands. This is something I'll be researching tonight and aim to incorporate as a beta bump for 0.5.0.

jalcine commented 9 years ago

So, I've started the work for this (at least from the makeprg standpoint) in a separate branch (pushing after I commit, probably would update this comment as well. I'm reading the docs for ninja as well; its generated files look really nice!

jalcine commented 9 years ago

This officially works for me in ec5e102. It's going to be a moment before it's in master but after a bit of a sanity-check, it'd be in develop.

jalcine commented 9 years ago

Merging this into master now.

jalcine commented 9 years ago

Er, develop, sorry. Please feel free to check it out. I'm confident that'll fail because the code still uses the GNU make file layout to find the files for a project. Going to open another PR to handle the work to find files using Ninja.

jalcine commented 9 years ago

Ninja support is a complete go now! Really excited for the upcoming release.

bchretien commented 9 years ago

Nice! I'll test it ASAP.