Some small compatibility fixes for FreeBSD (#190)
This commit is contained in:
parent
40c8e757aa
commit
82ca3bd37b
2 changed files with 4 additions and 4 deletions
|
|
@ -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.]*"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue