cpputils-cmake icon indicating copy to clipboard operation
cpputils-cmake copied to clipboard

Allow using of different compilation commands

Open byon opened this issue 11 years ago • 5 comments

Hello,

here's a change to allow users to use different compilation commands with cpputils-cmake. A user could use this for example like here:

(eval-after-load "cpputils-mode"
  (defun cppcm-create-compilation-command (target-path)
     (concat "ninja -C " target-path)))

This may be sufficient for issue #19 (it would be for my use case).

Thanks,

-Marko

P.S. I am not yet all that familiar with elisp or pull requests. Please feel free to offer suggestions on either one. :)

byon avatar Jul 12 '14 14:07 byon

a little more complicated than changing build tool name.

Let me handle this. This could take a few days, because I need figure out how to extract pre-process flags.

Can I assume the "-I" and "-D" flags are only defined in build.ninja of root directory?

redguardtoo avatar Jul 13 '14 11:07 redguardtoo

Sure. I did not realize that there is more complex preprocessor related logic within cpputils-cmake.

As far as I know, yes, the compilation and linking flags are defined in build.ninja file. But of course the flags may be different for different compilation tools (e.g., Visual Studio on Windows, and gcc on Linux).

Thanks for looking into this, especially as I assume you are not using Ninja yourself.

byon avatar Jul 13 '14 12:07 byon

what cpputils-cmake has done is technically easy. find those produced build files (Makefile or build.ninja), use regular expression to extract the full paths of c++ headers, APPEND them to the existing global variables from Emacs itself or other plugins.

redguardtoo avatar Jul 14 '14 02:07 redguardtoo

I will solve this next weekend. It will be v0.5.0.

redguardtoo avatar Jul 16 '14 01:07 redguardtoo

Thank you. Greatly appreciated. But no need to rush from my part. I am away from home (and computer) for a week anyway.

byon avatar Jul 16 '14 18:07 byon