1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-15 09:55:40 +00:00

Add -flto to jpm builds as well.

This commit is contained in:
Calvin Rose 2020-01-20 13:28:57 -06:00
parent 2dd852da54
commit 99c94a78d6

View File

@ -125,11 +125,11 @@
(def threads? (not (not (env 'thread/new)))) (def threads? (not (not (env 'thread/new))))
# Default flags for natives, but not required # Default flags for natives, but not required
(def default-lflags (if is-win ["/nologo"] [])) (def default-lflags (if is-win ["/nologo"] ["-flto"]))
(def default-cflags (def default-cflags
(if is-win (if is-win
["/nologo" "/MD"] ["/nologo" "/MD"]
["-std=c99" "-Wall" "-Wextra"])) ["-std=c99" "-Wall" "-Wextra" "-flto"]))
# Link to pthreads # Link to pthreads
@ -140,13 +140,13 @@
(def- dynamic-cflags (def- dynamic-cflags
(if is-win (if is-win
["/LD"] ["/LD"]
["-fPIC"])) ["-fPIC" "-flto"]))
(def- dynamic-lflags (def- dynamic-lflags
(if is-win (if is-win
["/DLL" ;thread-flags] ["/DLL" ;thread-flags]
(if is-mac (if is-mac
["-shared" "-undefined" "dynamic_lookup" ;thread-flags] ["-shared" "-undefined" "dynamic_lookup" "-flto" ;thread-flags]
["-shared" ;thread-flags]))) ["-shared" "-flto" ;thread-flags])))
(defn- opt (defn- opt
"Get an option, allowing overrides via dynamic bindings AND some "Get an option, allowing overrides via dynamic bindings AND some