Skip to content

Commit

Permalink
Attempt to run cmake on every build
Browse files Browse the repository at this point in the history
  • Loading branch information
benbierens committed May 20, 2024
1 parent c866092 commit 37af6e5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 70 deletions.
55 changes: 0 additions & 55 deletions build.sh

This file was deleted.

Empty file removed build/.keep
Empty file.
15 changes: 0 additions & 15 deletions leveldbstatic/prelude.nim

This file was deleted.

29 changes: 29 additions & 0 deletions leveldbstatic/raw.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ const root = currentSourcePath.parentDir.parentDir
const envWindows = root/"vendor"/"util"/"env_windows.cc"
const envPosix = root/"vendor"/"util"/"env_posix.cc"

const
LevelDbCmakeFlags {.strdefine.} =
when defined(macosx):
"-DCMAKE_BUILD_TYPE=Release"
elif defined(windows):
"-G\"MSYS Makefiles\" -DCMAKE_BUILD_TYPE=Release"
else:
"-DCMAKE_BUILD_TYPE=Release"

LevelDbDir {.strdefine.} = $(root/"vendor")
buildDir = $(root/"build")

static:
echo "Initialize submodule"

discard gorge "git submodule deinit -f \"" & root & "\""
discard gorge "git submodule update --init --recursive --checkout \"" & root & "\""

echo "Clean dir: \"" & buildDir & "\""
discard gorge "rm -rf " & buildDir
discard gorge "mkdir -p " & buildDir
let cmd = "cmake -S \"" & LevelDbDir & "\" -B \"" & buildDir & "\" " & LevelDbCmakeFlags
echo "\nBuilding LevelDB: " & cmd
let (output, exitCode) = gorgeEx cmd
echo output
if exitCode != 0:
discard gorge "rm -rf " & buildDir
raise (ref Defect)(msg: "Failed to build LevelDB")

when defined(windows):
{.compile: envWindows.}
{.passc: "-DLEVELDB_PLATFORM_WINDOWS".}
Expand Down

0 comments on commit 37af6e5

Please sign in to comment.