diff options
| author | BarrOff <58253563+BarrOff@users.noreply.github.com> | 2020-04-21 06:41:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-20 23:41:16 -0500 |
| commit | 82ca3bd37b1587e3c39708e51ed44375b322c111 (patch) | |
| tree | adae509027ceacae58321f67e06015cae2d99cba | |
| parent | 40c8e757aa5188618b7bc8abf3e913b08269dd28 (diff) | |
| download | nimterop-82ca3bd37b1587e3c39708e51ed44375b322c111.tar.gz nimterop-82ca3bd37b1587e3c39708e51ed44375b322c111.zip | |
Some small compatibility fixes for FreeBSD (#190)
| -rw-r--r-- | nimterop/build.nim | 6 | ||||
| -rw-r--r-- | nimterop/cimport.nim | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/nimterop/build.nim b/nimterop/build.nim index cc6dc22..a025dc0 100644 --- a/nimterop/build.nim +++ b/nimterop/build.nim @@ -358,7 +358,7 @@ proc findFile*(file: string, dir: string, recurse = true, first = false, regex = "nimgrep --filenames --oneline --nocolor $1 \"$2\" $3" elif defined(linux): "find $3 $1 -regextype egrep -regex $2" - elif defined(osx): + elif defined(osx) or defined(FreeBSD): "find -E $3 $1 -regex $2" recursive = "" @@ -754,7 +754,7 @@ proc getNumProcs(): string = getEnv("NUMBER_OF_PROCESSORS").strip() elif defined(linux): execAction("nproc").output.strip() - elif defined(macosx): + elif defined(macosx) or defined(FreeBSD): execAction("sysctl -n hw.ncpu").output.strip() else: "1" @@ -830,7 +830,7 @@ proc buildLibrary(lname, outdir, conFlags, cmakeFlags, makeFlags: string): strin proc getDynlibExt(): string = when defined(windows): result = ".dll" - elif defined(linux): + elif defined(linux) or defined(FreeBSD): result = ".so[0-9.]*" elif defined(macosx): result = ".dylib[0-9.]*" diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim index 382c034..52d1892 100644 --- a/nimterop/cimport.nim +++ b/nimterop/cimport.nim @@ -82,7 +82,7 @@ proc getFileDate(fullpath: string): string = &"cmd /c for %a in ({fullpath.sanitizePath}) do echo %~ta" elif defined(Linux): &"stat -c %y {fullpath.sanitizePath}" - elif defined(OSX): + elif defined(OSX) or defined(FreeBSD): &"stat -f %m {fullpath.sanitizePath}" (result, ret) = execAction(cmd) |
