From c3ba6466507bd35ae1d5a2d12e1da9d5c44a02b3 Mon Sep 17 00:00:00 2001 From: Rudi Schlatte Date: Tue, 23 Jul 2024 15:58:16 +0200 Subject: [PATCH] Specify Model API files when compiling --- CHANGELOG.md | 2 ++ abs-mode.el | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6d282..3843157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - It is now possible to “fold” (collapse) code. This is implemented via the built-in Emacs `outline-minor-mode`. +- The variables `abs-modelapi-index-file` and `abs-modelapi-static-dir` can be set as file- or directory-local variables, and will pass the corresponding options to the compiler. + ### Fixed ### Changed diff --git a/abs-mode.el b/abs-mode.el index 66069be..c1d3b74 100644 --- a/abs-mode.el +++ b/abs-mode.el @@ -484,6 +484,15 @@ buffer: (put 'abs-input-files 'safe-local-variable (lambda (list) (cl-every #'stringp list))) +(defvar abs-modelapi-index-file nil + "The Model API index file to compile into this model, if any.") +(put 'abs-modelapi-index-file 'safe-local-variable #'stringp) + +(defvar abs-modelapi-static-dir nil + "The Model API static directory containing to compile into this model, if any.") +(put 'abs-modelapi-static-dir 'safe-local-variable #'stringp) + + (defvar abs-compile-command nil "The compile command called by \\[abs-next-action]. The default behavior is to call \"make\" if a Makefile is in the @@ -588,6 +597,10 @@ Expects `abs-backend' to be bound to the desired backend." ;; FIXME: make it work with filenames with spaces (mapconcat (lambda (s) (concat "\"" s "\"")) (abs--input-files) " ") + (when abs-modelapi-index-file + (concat " --modelapi-index-file \"" abs-modelapi-index-file "\"")) + (when abs-modelapi-static-dir + (concat " --modelapi-static-dir \"" abs-modelapi-static-dir "\"")) (when (eql abs-backend 'maude) (concat " -o \"" (abs--maude-filename) "\"")) (when (and abs-java-output-jar-file (eql abs-backend 'java))