Skip to content

Commit

Permalink
fix(macos): followup on #434 try to fix nim-lang/Nim#23801
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Jul 17, 2024
1 parent b718b7f commit 9bf1232
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions constantine.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ proc releaseBuildOptions(buildMode = bmBinary): string =
" --passC:-Wno-stringop-overflow --passL:-Wno-stringop-overflow " &
" --passC:-Wno-alloc-size-larger-than --passL:-Wno-alloc-size-larger-than "

let apple = defined(macos) or defined(macox) or defined(ios)
let apple = defined(macos) or defined(macosx) or defined(ios)
let ltoOptions = if useLtoDefault:
if apple: ""
elif buildMode == bmStaticLib: ""
Expand Down Expand Up @@ -223,9 +223,12 @@ proc genDynamicLib(outdir, nimcache: string) =
proc compile(libName: string, flags = "") =
echo &"Compiling dynamic library: {outdir}/" & libName

let config = flags &
releaseBuildOptions(bmDynamicLib)
echo &" compiler config: {config}"

exec "nim c " &
flags &
releaseBuildOptions(bmDynamicLib) &
config &
" --threads:on " &
" --noMain --app:lib " &
&" --nimMainPrefix:ctt_init_ " & # Constantine is designed so that NimMain isn't needed, provided --mm:arc -d:useMalloc --panics:on -d:noSignalHandler
Expand All @@ -250,10 +253,14 @@ proc genStaticLib(outdir, nimcache: string, extFlags = "") =
proc compile(libName: string, flags = "") =
echo &"Compiling static library: {outdir}/" & libName

let config = flags &
extFlags &
releaseBuildOptions(bmDynamicLib)

echo &" compiler config: {config}"

exec "nim c " &
flags &
extFlags &
releaseBuildOptions(bmStaticLib) &
config &
" --threads:on " &
" --noMain --app:staticlib " &
&" --nimMainPrefix:ctt_init_ " & # Constantine is designed so that NimMain isn't needed, provided --mm:arc -d:useMalloc --panics:on -d:noSignalHandler
Expand Down

0 comments on commit 9bf1232

Please sign in to comment.