mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
4fe6d9b767
- unify the "build-..." targets - enable a debug build by default, to simplify development - bump vendor/DOtherSide - avoid DOtherSide checks for docs/tests-specific tools like Doxygen - switch to an in-place build for DOtherSide - silence the DOtherSide build when V=0, make it more verbose with V=1 - don't delete checked out submodules in the "clean" target - update build instructions in the README - centralise Nim compiler options in a top-level "config.nims" (except `-d:debug` which needs to be on the command line)
52 lines
1.8 KiB
Nim
52 lines
1.8 KiB
Nim
when defined(macosx):
|
|
import algorithm, strutils
|
|
|
|
if defined(release):
|
|
switch("nimcache", "nimcache/release/$projectName")
|
|
else:
|
|
switch("nimcache", "nimcache/debug/$projectName")
|
|
|
|
proc linkLib(name: string): string =
|
|
var resLib = name
|
|
|
|
when defined(macosx):
|
|
# In macOS Catalina, unversioned libraries may be broken stubs, so we need to
|
|
# find a versioned one: https://github.com/status-im/nim-status-client/pull/209
|
|
var matches: seq[string]
|
|
for path in listFiles("/usr/lib"):
|
|
# /usr/lib/libcrypto.0.9.8.dylib
|
|
let file = path[9..^1]
|
|
# libcrypto.0.9.8.dylib
|
|
if file.startsWith("lib" & name) and file != "lib" & name & ".dylib":
|
|
matches.add(path)
|
|
matches.sort(order = SortOrder.Descending)
|
|
if matches.len > 0:
|
|
resLib = matches[0]
|
|
# Passing "/usr/lib/libcrypto.44.dylib" directly to the linker works for
|
|
# dynamic linking.
|
|
return resLib
|
|
|
|
return "-l" & resLib
|
|
|
|
--threads:on
|
|
--opt:speed # -O3
|
|
--debugger:native # passes "-g" to the C compiler
|
|
--dynliboverrideall # don't use dlopen()
|
|
--define:ssl # needed by the stdlib to enable SSL procedures
|
|
|
|
if defined(macosx):
|
|
--tlsEmulation:off
|
|
# DYLD_LIBRARY_PATH doesn't seem to work with Qt5
|
|
switch("passL", "-rpath" & " " & getEnv("QT5_LIBDIR"))
|
|
switch("passL", "-lstdc++")
|
|
# dynamically link these libs, since we're opting out of dlopen()
|
|
switch("passL", linkLib("crypto"))
|
|
switch("passL", linkLib("ssl"))
|
|
# https://code.videolan.org/videolan/VLCKit/-/issues/232
|
|
switch("passL", "-Wl,-no_compact_unwind")
|
|
else:
|
|
switch("passL", linkLib("crypto") & " " & linkLib("ssl")) # dynamically link these libs, since we're opting out of dlopen()
|
|
switch("passL", "-Wl,-as-needed") # don't link libraries we're not actually using
|
|
|
|
--define:chronicles_line_numbers # useful when debugging
|