Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using of different compilation commands #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow using of different compilation commands #26

wants to merge 1 commit into from

Conversation

byon
Copy link

@byon byon commented Jul 12, 2014

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. :)

@redguardtoo
Copy link
Owner

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?

@byon
Copy link
Author

byon commented Jul 13, 2014

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.

@redguardtoo
Copy link
Owner

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
Copy link
Owner

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

@byon
Copy link
Author

byon commented Jul 16, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants