Skip to content

Commit

Permalink
Fix macOS support in cc.janet
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrmont committed Jul 30, 2024
1 parent 70f1a47 commit f806187
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spork/cc.janet
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,24 @@
(defn- rpath
[]
(if (dyn *use-rpath* true)
[(string "-Wl,-rpath=" (lib-path))
(string "-Wl,-rpath=" (dyn *syspath* "."))]
[(string "-Wl,-rpath," (lib-path))
(string "-Wl,-rpath," (dyn *syspath* "."))]
[]))
(defn- smart-libs []
(def dflt (index-of (target-os) [:linux :macos]))
(def dflt (index-of (target-os) [:linux]))
(dyn *smart-libs* dflt))
(defn- libs []
(def sg (if (smart-libs) ["-Wl,--start-group"] []))
(def eg (if (smart-libs) ["-Wl,--end-group"] []))
(def bs (if (not= (target-os) :macos) ["-Wl,-Bstatic"] []))
(def bd (if (not= (target-os) :macos) ["-Wl,-Bdynamic"] []))
[;(lflags)
;sg
;(default-libs)
"-Wl,-Bstatic" ;(static-libs)
"-Wl,-Bdynamic" ;(dynamic-libs)
;bs
;(static-libs)
;bd
;(dynamic-libs)
;eg
;(rpath)])
(defn- rdynamic
Expand Down

0 comments on commit f806187

Please sign in to comment.