From 1b66e4d5f81fbea039dab64d5353252c977be68c Mon Sep 17 00:00:00 2001 From: Devin Pohl Date: Sat, 27 Nov 2021 22:42:15 -0700 Subject: [PATCH 1/2] Added a basic bootstrap compile --- ob-glsl.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ob-glsl.el b/ob-glsl.el index 0fd7441..312e25a 100644 --- a/ob-glsl.el +++ b/ob-glsl.el @@ -1,4 +1,23 @@ +;;; ob-glsl.el --- description pending -*- lexical-binding: t; -*- + +(defcustom ob-glsl-make-command "cmake -G \"Ninja\" . && ninja" + "build command used when compiling ob-glsl" + :type 'string + :group 'ob-glsl) + (require 'ob) + +;; setup +(defun ob-glsl-compile () + (let ((default-directory (file-name-directory load-file-name))) + (shell-command ob-glsl-make-command) + (load-file + (concat default-directory + (car (directory-files default-directory nil "^ob-glsl-module\\.\\(so\\|dll\\)$")))) + )) +(when (not (featurep 'ob-glsl-module)) + (ob-glsl-compile)) + (require 'ob-glsl-module) (defvar org-babel-default-header-args:glsl @@ -37,3 +56,4 @@ This function is called by `org-babel-execute-src-block'." (error "glsl does not support sessions")) (provide 'ob-glsl) +;;; ob-glsl.el ends here From e389cfe4c6f5115c54983a7445b3ae4061e65086 Mon Sep 17 00:00:00 2001 From: Devin Pohl <29494099+Shizcow@users.noreply.github.com> Date: Tue, 30 Nov 2021 13:50:32 -0700 Subject: [PATCH 2/2] Handle dylib on macos Consider automatically pulling the file output type from ninja -- more compatibility? Co-authored-by: finalpatch --- ob-glsl.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ob-glsl.el b/ob-glsl.el index 312e25a..c02ae67 100644 --- a/ob-glsl.el +++ b/ob-glsl.el @@ -13,7 +13,7 @@ (shell-command ob-glsl-make-command) (load-file (concat default-directory - (car (directory-files default-directory nil "^ob-glsl-module\\.\\(so\\|dll\\)$")))) + (car (directory-files default-directory nil "^ob-glsl-module\\.\\(so\\|dll\\|dylib\\)$")))) )) (when (not (featurep 'ob-glsl-module)) (ob-glsl-compile))