diff --git a/CHANGELOG.md b/CHANGELOG.md index 28d79a9d..fb869e3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.36.0 - TBD + +Bug Fixes + +- Pass append and prepend directories when compiling dependent libraries of a program. This prevents issues where the directories are not made available to any `include` directives within such libraries. + ## 0.35.0 - August 25, 2022 Features diff --git a/cyclone.scm b/cyclone.scm index d0465f39..7186b231 100644 --- a/cyclone.scm +++ b/cyclone.scm @@ -295,6 +295,8 @@ (when (recompile? lib-dep append-dirs prepend-dirs) (let ((result (system (string-append (calling-program) " " + (dirs->args "-A" append-dirs) " " + (dirs->args "-I" prepend-dirs) " " (lib:import->filename lib-dep ".sld" append-dirs prepend-dirs))))) (when (> result 0) (error "Unable to compile library" lib-dep))))) @@ -986,6 +988,17 @@ (list #f) args))) +;; Convert a list of directories to a string of arguments. +;; EG: (dirs->args "-I" '("dir-1" "dir-2")) => +;; " -I dir-1 -I dir-2 " +(define (dirs->args prefix dirs) + (apply + string-append + (map + (lambda (dir) + (string-append " " prefix " " dir " ")) + dirs))) + ;; Handle command line arguments (let* ((args (command-line-arguments)) (non-opts