Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead, use a build-app.lisp file to load quilc and save the quilc application binary.
- Loading branch information
1 parent
c20a287
commit a4dcd16
Showing
4 changed files
with
65 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
;;;; build-app.lisp | ||
;;;; | ||
;;;; This file is loaded by the Makefile to produce a quilc[.exe] binary. | ||
;;;; | ||
|
||
(unless *load-truename* | ||
(error "This file is meant to be loaded.")) | ||
|
||
(pushnew :hunchentoot-no-ssl *features*) | ||
|
||
(require 'asdf) | ||
|
||
(let ((*default-pathname-defaults* (make-pathname :type nil | ||
:name nil | ||
:defaults *load-truename*)) | ||
(output-file (make-pathname :name "quilc" | ||
:type #+windows "exe" #-windows nil)) | ||
(system-table (make-hash-table :test 'equal)) | ||
(entry-point "quilc::entry-point")) | ||
(flet ((option-present-p (name) | ||
(find name sb-ext:*posix-argv* :test 'string=)) | ||
(make-toplevel-function (entry) | ||
(lambda () | ||
(with-simple-restart (abort "Abort") | ||
(funcall (read-from-string entry) | ||
sb-ext:*posix-argv*)))) | ||
(load-systems-table () | ||
(unless (probe-file "system-index.txt") | ||
(error "Generate system-index.txt with 'make system-index.txt' first.")) | ||
(setf (gethash "quilc" system-table) (merge-pathnames "quilc.asd")) | ||
(with-open-file (stream "system-index.txt") | ||
(loop | ||
:for system-file := (read-line stream nil) | ||
:while system-file | ||
:do (setf (gethash (pathname-name system-file) system-table) | ||
(merge-pathnames system-file))))) | ||
(local-system-search (name) | ||
(values (gethash name system-table)))) | ||
(load-systems-table) | ||
(push #'local-system-search asdf:*system-definition-search-functions*) | ||
(asdf:load-system "quilc") | ||
(funcall (read-from-string "quilc::zap-info")) | ||
(funcall (read-from-string "quilc::setup-debugger")) | ||
(when (option-present-p "--quilc-sdk") | ||
(load "app/src/mangle-shared-objects.lisp")) | ||
(when (option-present-p "--unsafe") | ||
(format t "~&Using unsafe entry point~%") | ||
(setf entry-point "quilc::%entry-point")) | ||
(force-output) | ||
(sb-ext:save-lisp-and-die output-file | ||
:compression t | ||
:save-runtime-options t | ||
:executable t | ||
:toplevel (make-toplevel-function entry-point)))) | ||
|