lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
304 stars 82 forks source link

autowrap.lisp - clang path outdated ? #171

Open rpx99 opened 3 weeks ago

rpx99 commented 3 weeks ago

The path (cl:list "/usr/lib/clang/13.0.1/include/") seems outdated ?

On my system I have version 16, i.e. "/usr/lib/clang/16/include/"

Maybe get / set it dynamically depending on the machine it runs ?

Not sure it works but something like this ?

(defun get-clang-version ()
  (let ((output (uiop:run-program '("clang" "--version") :output :string)))
    (when (string-match "clang version \\([0-9]+\\)" output)
      (match-string 1 output))))

(defun find-clang-include-path ()
  (let ((clang-version (get-clang-version)))
    (when clang-version
      (concatenate 'string "/usr/lib/clang/" clang-version "/include/"))))

...
(list (find-clang-include-path))
...