Re: [CEDET-devel] Set executable within ede-cpp-root-project
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2010-11-23 01:08:23
|
On 11/22/2010 09:25 AM, Maximilian Matthe wrote: > Well, with the generic project I dont even get it to compile: C-c . c > gives: ede-target: compile-target not supported by > #<ede-generic-target-c-cpp ede-generic-target-c-cpp> > > Maybe if I manage to set compiling up, I can try to add another command > although I have never programmed more than 10lines in ELisp. > > Could you give me any advice? Hi, I looked through my old code, I notice that the compile and debug methods were never implemented even though I had placed the right configuration features in. The attached patch is a quick hack that adds in the features you mentioned, plus the ones that should have been there. Unfortunately, I don't have time to test them out much today. Perhaps you can try them out, and tweak them as needed. If they work, let me know and we can update them. Templates I used to create these are from ede-proj-program, and you may need to add back in some of the code I cut out when I transcribed the ideas over. Eric === modified file 'ede/ede-generic.el' *** ede/ede-generic.el 2010-07-25 14:12:11 +0000 --- ede/ede-generic.el 2010-11-23 01:04:24 +0000 *************** *** 104,109 **** --- 104,116 ---- :group (default build) :documentation "Command used for debugging this project.") + (run-command :initarg :debug-command + :initform nil + :type (or null string) + :custom string + :group (default build) + :documentation + "Command used to run something related to this project.") ;; C target customixations (c-include-path :initarg :c-include-path :initform nil *************** *** 321,326 **** --- 328,369 ---- (config (ede-generic-get-configuration proj))) (oref config c-include-path))) + ;;; Commands + ;; + (defmethod project-compile-project ((proj ede-generic-project) &optional command) + "Compile the entire current project PROJ. + Argument COMMAND is the command to use when compiling." + (let* ((config (ede-generic-get-configuration proj)) + (comp (oref config :build-command))) + (compile comp))) + + (defmethod project-compile-target ((obj ede-generic-target) &optional command) + "Compile the current target OBJ. + Argument COMMAND is the command to use for compiling the target." + (project-compile-project (ede-current-project) command)) + + (defmethod project-debug-target ((proj ede-generic-target)) + "Run the current project target OBJ in a debugger." + (let* ((config (ede-generic-get-configuration proj)) + (debug (oref config :debug-command)) + (cmd (read-from-minibuffer + "Run (like this): " + debug)) + (cmdsplit (split-string cmd " " t)) + ;; @TODO - this depends on the user always typing in something good + ;; like "gdb" or "dbx" which also exists as a useful Emacs command. + ;; Is there a better way? + (cmdsym (intern-soft (car cmdsplit)))) + (apply cmdsym (cdr cmdsplit)))) + + (defmethod project-run-target ((proj ede-generic-target)) + "Run the current project target OBJ." + (require 'ede-shell) + (let* ((config (ede-generic-get-configuration proj)) + (run (oref config :run-command)) + (cmd (read-from-minibuffer "Run (like this): " run))) + (ede-shell-run-something proj cmd))) + ;;; Customization ;; (defmethod ede-customize ((proj ede-generic-project)) |