Skip building leveldb if already built

This commit is contained in:
Ben 2024-08-15 10:33:33 +02:00
parent 9e89afa856
commit 3805148c2f
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 16 additions and 2 deletions

View File

@ -16,7 +16,11 @@ const
LevelDbDir {.strdefine.} = $(root/"vendor") LevelDbDir {.strdefine.} = $(root/"vendor")
buildDir = $(root/"build") buildDir = $(root/"build")
static: proc buildLevelDb() =
if fileExists(buildDir/"Makefile"):
echo "LevelDB already build. Delete '" & buildDir & "' to force rebuild."
return
echo "Initializing submodule..." echo "Initializing submodule..."
discard gorge "git submodule deinit -f \"" & root & "\"" discard gorge "git submodule deinit -f \"" & root & "\""
discard gorge "git submodule update --init --recursive --checkout \"" & root & "\"" discard gorge "git submodule update --init --recursive --checkout \"" & root & "\""
@ -33,6 +37,9 @@ static:
echo output echo output
raise (ref Defect)(msg: "Failed to build LevelDB") raise (ref Defect)(msg: "Failed to build LevelDB")
static:
buildLevelDb()
when defined(windows): when defined(windows):
{.compile: envWindows.} {.compile: envWindows.}
{.passc: "-DLEVELDB_PLATFORM_WINDOWS".} {.passc: "-DLEVELDB_PLATFORM_WINDOWS".}

View File

@ -16,7 +16,11 @@ const
LevelDbDir {.strdefine.} = $(root/"vendor") LevelDbDir {.strdefine.} = $(root/"vendor")
buildDir = $(root/"build") buildDir = $(root/"build")
static: proc buildLevelDb() =
if fileExists(buildDir/"Makefile"):
echo "LevelDB already build. Delete '" & buildDir & "' to force rebuild."
return
echo "Initializing submodule..." echo "Initializing submodule..."
discard gorge "git submodule deinit -f \"" & root & "\"" discard gorge "git submodule deinit -f \"" & root & "\""
discard gorge "git submodule update --init --recursive --checkout \"" & root & "\"" discard gorge "git submodule update --init --recursive --checkout \"" & root & "\""
@ -33,6 +37,9 @@ static:
echo output echo output
raise (ref Defect)(msg: "Failed to build LevelDB") raise (ref Defect)(msg: "Failed to build LevelDB")
static:
buildLevelDb()
when defined(windows): when defined(windows):
{.compile: envWindows.} {.compile: envWindows.}
{.passc: "-DLEVELDB_PLATFORM_WINDOWS".} {.passc: "-DLEVELDB_PLATFORM_WINDOWS".}