Skip to content

Commit

Permalink
Move -target to after target:, not before or in the middle
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Dec 10, 2024
1 parent 2d36f34 commit 57a87d7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
45 changes: 25 additions & 20 deletions src/gerbil/compiler/driver.ss
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,25 @@ namespace: gxc
(unless (string? srcpath)
(raise-compile-error "Invalid module source path" srcpath))

(let ((outdir (pgetq output-dir: opts))
(invoke-gsc? (pgetq invoke-gsc: opts))
(target (pgetq target: opts))
(gsc-options (pgetq gsc-options: opts))
(keep-scm? (pgetq keep-scm: opts))
(verbosity (pgetq verbose: opts))
(optimize (pgetq optimize: opts))
(debug (pgetq debug: opts))
(gen-ssxi (pgetq generate-ssxi: opts))
(parallel? (pgetq parallel: opts)))
(let* ((outdir (pgetq output-dir: opts))
(invoke-gsc? (pgetq invoke-gsc: opts))
(target (or (pgetq target: opts) 'C))
(gsc-options (append
["-target" (symbol->string target)]
(or (pgetq gsc-options: opts) [])))
(keep-scm? (pgetq keep-scm: opts))
(verbosity (pgetq verbose: opts))
(optimize (pgetq optimize: opts))
(debug (pgetq debug: opts))
(gen-ssxi (pgetq generate-ssxi: opts))
(parallel? (pgetq parallel: opts)))

(when outdir
(with-driver-mutex (create-directory* outdir)))
(when optimize
(with-driver-mutex (optimizer-info-init!)))
(parameterize ((current-compile-output-dir outdir)
(current-compilation-target (or target 'C))
(current-compilation-target target)
(current-compile-invoke-gsc invoke-gsc?)
(current-compile-gsc-options gsc-options)
(current-compile-keep-scm keep-scm?)
Expand All @@ -119,19 +122,21 @@ namespace: gxc
(unless (string? srcpath)
(raise-compile-error "Invalid module source path" srcpath))

(let ((outdir (pgetq output-dir: opts))
(invoke-gsc? (pgetq invoke-gsc: opts))
(target (pgetq target: opts))
(gsc-options (pgetq gsc-options: opts))
(keep-scm? (pgetq keep-scm: opts))
(verbosity (pgetq verbose: opts))
(debug (pgetq debug: opts))
(parallel? (pgetq parallel: opts)))
(let* ((outdir (pgetq output-dir: opts))
(invoke-gsc? (pgetq invoke-gsc: opts))
(target (or (pgetq target: opts) 'C))
(gsc-options (append
["-target" (symbol->string target)]
(or (pgetq gsc-options: opts) [])))
(keep-scm? (pgetq keep-scm: opts))
(verbosity (pgetq verbose: opts))
(debug (pgetq debug: opts))
(parallel? (pgetq parallel: opts)))
(when outdir
(with-driver-mutex (create-directory* outdir)))
(parameterize ((current-compile-output-dir outdir)
(current-compile-invoke-gsc invoke-gsc?)
(current-compilation-target (or target 'C))
(current-compilation-target target)
(current-compile-gsc-options gsc-options)
(current-compile-keep-scm keep-scm?)
(current-compile-verbose verbosity)
Expand Down
1 change: 0 additions & 1 deletion src/gerbil/gxc-main.ss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
(("-target")
(match rest
([opt . rest]
(add-gsc-option! ["-target" opt])
(set! target (string->symbol opt))
(lp rest))
(else
Expand Down

0 comments on commit 57a87d7

Please sign in to comment.