mirror of
https://github.com/janet-lang/janet
synced 2025-01-23 21:56:52 +00:00
jpm: Read :lflags from meta file when linking.
Let us link in native code that itself neads to be linked to native code when creating standalone executables.
This commit is contained in:
parent
1b283c47b4
commit
940860755c
@ -2,6 +2,8 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## Unreleased
|
||||
- Fix some linking issues when creating executables with native dependencies.
|
||||
- jpm now runs each test script in a new interpreter.
|
||||
- Fix an issue that prevent some valid programs from compiling.
|
||||
- Add `mean` to core.
|
||||
- Allow (length x) on typed arrays an other abstract types that implement
|
||||
|
@ -385,6 +385,7 @@
|
||||
# Load entry environment and get main function.
|
||||
(def entry-env (dofile source))
|
||||
(def main ((entry-env 'main) :value))
|
||||
(def dep-lflags @[])
|
||||
|
||||
# Create marshalling dictionary
|
||||
(def mdict (invert (env-lookup root-env)))
|
||||
@ -416,6 +417,8 @@
|
||||
" janet_env_lookup_into(lookup, temptab, \""
|
||||
prefix
|
||||
"\", 0);\n\n")
|
||||
(when-let [lfs (meta :lflags)]
|
||||
(array/concat dep-lflags lfs))
|
||||
(buffer/push-string declarations
|
||||
"extern void "
|
||||
(meta :static-entry)
|
||||
@ -500,7 +503,7 @@ int main(int argc, const char **argv) {
|
||||
#default
|
||||
["-lm"]))
|
||||
(def cc (opt opts :compiler default-compiler))
|
||||
(def lflags [;(opt opts :lflags default-lflags) ;extra-lflags])
|
||||
(def lflags [;dep-lflags ;(opt opts :lflags default-lflags) ;extra-lflags])
|
||||
(def cflags (getcflags opts))
|
||||
(def defines (make-defines (opt opts :defines {})))
|
||||
(print "compiling and linking " dest "...")
|
||||
|
Loading…
Reference in New Issue
Block a user