Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/util/util.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
(setf (uiop:getenv "LC_ALL") lc-all))))))


(defun list-system-paths (language triple features)
(defun list-system-paths (language triple features system-include-type)
(flet ((%process-paths (paths)
(mapcar (lambda (path)
(uiop:native-namestring (uiop:truename* path)))
Expand All @@ -339,8 +339,12 @@
(unwind-protect
(%process-paths
(cond
((not (emptyp (dump-gcc-version clang-name)))
((and (member system-include-type '(:default :clang))
(not (emptyp (dump-gcc-version clang-name))))
(dump-include-paths lang clang-name triple))
((eq system-include-type :clang)
(error "system-include-type is :clang, but ~A is not on $PATH"
clang-name))

((windows-target-p)
(if (not (emptyp (dump-gcc-version (string+ "x86_64-w64-mingw32-" gcc-name))))
Expand All @@ -352,9 +356,9 @@
(setf (uiop:getenv "LC_ALL") lc-all)))))))


(defun list-system-include-paths (language triple features)
(defun list-system-include-paths (language triple features system-include-type)
(remove-if #'%darwin-framework-path-p
(list-system-paths language triple features)))
(list-system-paths language triple features system-include-type)))


(defun list-default-resource-paths ()
Expand All @@ -363,12 +367,12 @@
(list resource-path))))


(defun list-framework-paths (language triple features)
(defun list-framework-paths (language triple features system-include-type)
(flet ((cut-darwin-postfix (path)
(subseq path 0 (- (length path) (length +stupid-darwin-framework-postfix+)))))
(mapcar #'cut-darwin-postfix
(remove-if (complement #'%darwin-framework-path-p)
(list-system-paths language triple features)))))
(list-system-paths language triple features system-include-type)))))

(defun dump-gcc-version (&optional (executable "gcc"))
(handler-case
Expand Down
15 changes: 12 additions & 3 deletions src/wrap/wrapper.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
framework-includes
defines
intrinsics
system-include-type
system-includes)


Expand All @@ -64,9 +65,13 @@
framework-includes
defines
intrinsics
(system-include-type '(:default))
system-includes
&allow-other-keys)
(alist-plist opts)
(unless (member (car system-include-type) '(:default :clang :gcc))
(error ":system-include-type must be one of (:default :clang :gcc), not ~S"
(car system-include-type)))
(with-evaluated-variables (language
standard)
(with-evaluated-lists (headers
Expand All @@ -92,6 +97,7 @@
:headers headers
:includes includes
:framework-includes framework-includes
:system-include-type (car system-include-type)
:system-includes system-includes
:defines defines
:intrinsics intrinsics
Expand Down Expand Up @@ -263,7 +269,8 @@
(%parse-opt 'standard target-parse-opts)
(%parse-opt 'standard common-parse-opts)))
(features (target-options-features target-opts))
(triple (target-options-triple target-opts)))
(triple (target-options-triple target-opts))
(system-include-type (%parse-opt 'system-include-type common-parse-opts)))
(make-parse-options :include-sources
(append
(%parse-opt 'include-sources common-parse-opts)
Expand Down Expand Up @@ -312,12 +319,14 @@
(or (append
(%parse-opt 'system-includes target-parse-opts)
(%parse-opt 'system-includes common-parse-opts))
(list-system-include-paths language triple features))
(list-system-include-paths language triple features
system-include-type))
:framework-includes
(or (append
(%parse-opt 'framework-includes target-parse-opts)
(%parse-opt 'framework-includes common-parse-opts))
(list-framework-paths language triple features))
(list-framework-paths language triple features
system-include-type))
:defines
(append
(%parse-opt 'defines common-parse-opts)
Expand Down