branch: externals/beardbolt
commit 02a0bfbcdbe2120e8441dd4306dedf0653647950
Author: João Távora <joaotav...@gmail.com>
Commit: João Távora <joaotav...@gmail.com>
Add `beardbolt-ccj-extra-flags` option
* README.md: Mention new option.
* beardbolt.el (bb-ccj-extra-flags): New option.
(bb--guess-from-ccj): Use it.
---
README.md | 4 ++++
beardbolt.el | 8 ++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c4588751da..64cf727930 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,10 @@ instead. Beardbolt will pick them up immediately on each
run.
* `beardbolt-execute`: If non-nil, run the resulting program in the
compilation buffer. If a string, run with these arguments. If t
runs without arguments.
+
+* `beardbolt-ccj-extra-flags`: A string of extra compilation flags to
+ append to the compilation command devined from
+ `compile_commands.json`.
<a name="benchmarks"></a>
### Benchmarks vs RMSbolt
diff --git a/beardbolt.el b/beardbolt.el
index da41dae1e1..06423ad854 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -73,6 +73,9 @@ Passed directly to compiler or disassembler."
(bb--defoption bb-execute nil
"Non-nil to run resulting program with these arguments."
:type 'string :safe (lambda (v) (or (null v) (eq t v) (stringp v))))
+(bb--defoption bb-ccj-extra-flags nil
+ "Extra flags for compilation command devined from compile_commands.json."
+ :type 'string :safe (lambda (v) (or (null v) (stringp v))))
(defface bb-current-line-face
'((t (:weight bold :inherit highlight)))
@@ -705,8 +708,9 @@ With prefix argument, choose from starter files in
`bb-starter-files'."
return (plist-get e :command)))
(cmd (bb--split-rm-double cmd "-o"))
(cmd (bb--split-rm-double cmd "-c"))
- (cmd (bb--split-rm-single cmd "-flto" #'string-prefix-p)))
- cmd))
+ (cmd (bb--split-rm-single cmd "-flto" #'string-prefix-p))
+ (cmd (bb--split-rm-single cmd "-O" #'string-prefix-p)))
+ (list cmd bb-ccj-extra-flags)))
;;;###autoload
(define-minor-mode bb-mode