From a26488497cc765890dd5dff122a1f08ca6c5ca95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 2 Sep 2022 00:07:36 +0200 Subject: Improve build system. --- eb.el | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'eb.el') diff --git a/eb.el b/eb.el index ec9557e..904da3a 100644 --- a/eb.el +++ b/eb.el @@ -29,7 +29,6 @@ (2 (list 'face dired-header-face))))) (font-lock-add-keywords 'dired-mode eb--truncate-dired-headers--keywords) -;; (font-lock-remove-keywords 'dired-mode eb--truncate-dired-headers--keywords) ;;;###autoload (define-minor-mode eb--dired-truncate-headers-mode @@ -78,7 +77,6 @@ (setq eb--fleeting--close ',close) ,open (eb--fleeting-minor-mode 1) - (message "%s" eb--fleeting-minor-mode) (setq eb--fleeting--direction ',dir)) window))))) @@ -98,8 +96,6 @@ (setq eb--fleeting--window (and eb--fleeting-minor-mode (get-buffer-window)))) (add-hook 'pre-command-hook #'eb--fleeting--pre-command-hook) -(define-key global-map [f12] (lambda () (interactive) (message "%s" eb--fleeting--buffer))) - (defun eb--fleeting--window-hook (&rest r) (let ((fleeting-buffer eb--fleeting--buffer) (fleeting-window eb--fleeting--window) @@ -232,8 +228,20 @@ :type '(radio (const "mingw") (const "vs2019"))) ;;;###autoload -(defcustom eb-config "Debug" - "Build configuration type." +(defcustom eb-vs-toolset "v142" + "Visual Studio toolset." + :group 'eb + :type '(radio (const "v142") (const "v141_xp"))) + +;;;###autoload +(defcustom eb-vs-platform "x64" + "Visual Studio platform." + :group 'eb + :type '(radio (const "Win32") (const "x64"))) + +;;;###autoload +(defcustom eb-vs-config "Debug" + "Visual Studio configuration." :group 'eb :type '(radio (const "Debug") (const "Release"))) @@ -243,19 +251,30 @@ :group 'eb :type 'directory) +(defun eb--cmake-path () + (require 'projectile) + (cond + ((string-equal eb-system "mingw") + (concat (projectile-project-root) "/b/mingw/")) + ((string-equal eb-system "vs2019") + (concat (projectile-project-root) "/b/vs2019-" eb-vs-toolset "-" eb-vs-platform "/")) + (t (error "eb-system `%s' not supported" eb-system)))) + +(defun eb--exe () + (cond + ((string-equal eb-system "mingw") + (concat (eb--cmake-path) "b/mingw/EpisodeBrowser.exe")) + ((string-equal eb-system "vs2019") + (concat (eb--cmake-path) eb-vs-config "/EpisodeBrowser.exe")) + (t (error "eb-system `%s' not supported" eb-system)))) + ;;;###autoload (defun eb-run () "Launch built executable, displaying its output in a buffer." (interactive) (require 'projectile) (let ((buf (get-buffer-create "*eb-run*")) - (exe (concat (projectile-project-root) - "/b/" - eb-system "/" - (if (not (string-equal eb-system "mingw")) - (concat eb-config "/") - "") - "EpisodeBrowser.exe")) + (exe (eb--exe)) (default-directory eb-cwd)) (with-current-buffer buf (compilation-mode)) @@ -275,7 +294,10 @@ (quit-window)) (if (projectile-project-p) (let ((compilation-read-command nil) - (command (concat "make SYSTEM=" eb-system " CONFIG=" eb-config))) + (command (concat "make SYSTEM=" eb-system + " VS_CONFIG=" eb-vs-config + " VS_TOOLSET=" eb-vs-toolset + " VS_PLATFORM=" eb-vs-platform))) (projectile--run-project-cmd command nil :show-prompt nil :prompt-prefix "Compile command: " -- cgit v1.2.3