-
Notifications
You must be signed in to change notification settings - Fork 4
Autocompile / melpa compatibility #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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\\)$")))) | ||
|
Shizcow marked this conversation as resolved.
Outdated
|
||
| )) | ||
| (when (not (featurep 'ob-glsl-module)) | ||
| (ob-glsl-compile)) | ||
|
Comment on lines
+18
to
+19
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: does this mean this code will always attempt to compile if the module is not yet loaded, even when it's already compiled and available?
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in order to minimize the loading latency, we would only want to run the compilation when the dynamic module is not available (or better, check if it is out of date).
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good points here. Are there any well established references for automatically compiling modules? Vterm detects when its module is out of date (I haven't looked into the implementation), but doesn't do so automatically. If lazy loading is done properly, then this may be enough. It'd help with debugging problems in compilation (eg a dependency isn't installed). I don't know of any emacs packages with modules that automatically compile on install/load, but I haven't exactly looked too much.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just perform a quick check of the existence of the dynamic module, or just attempt to load it, and only run the compilation when the file does not already exist or failed to load? |
||
|
|
||
| (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 | ||
Uh oh!
There was an error while loading. Please reload this page.