Removes automatic symbol check

This commit is contained in:
Ben 2024-05-16 10:43:21 +02:00
parent 3a30543705
commit 0371a85616
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1
11 changed files with 16 additions and 71 deletions

View File

@ -6,6 +6,8 @@ Original nim LevelDB wrapper: [HERE](https://github.com/zielmicha/leveldb.nim)
Replacing of system library dependency with self-contained C/CPP interoperability by (Codex.Storage)[https://codex.storage]
## Usage
Create a database:
```Nim
import leveldbstatic
@ -49,3 +51,13 @@ Iterate over subset of database content:
db.close()
```
## Compiling with optimizations
This library can be compiled with the following optimization options. By default these are disabled. Provide the following nim compiler flags to enable them:
- fdatasync from <unistd.h> `--passC:-DHAVE_FDATASYNC=1`
- F_FULLSYNC from <fcntl.h> `--passC:-DHAVE_FULLFSYNC=1`
- O_CLOEXEC from <fcntl.h> `--passC:-DHAVE_O_CLOEXEC=1`
- crc32c from <crc32c/crc32c.h> `--passC:-DHAVE_CRC32C=1`
- snappy from <snappy.h> `--passC:-DHAVE_SNAPPY=1`
- zstd from <zstd.h> `--passC:-DHAVE_ZSTD=1`

View File

@ -47,10 +47,9 @@ toast \
--includeDirs="${sourceDir}/helpers/memenv" \
--includeDirs="${sourceDir}/port" \
--includeDirs="${sourceDir}/include" \
--includeDirs="${buildDir}/include" \
--includeDirs="${root}/leveldbstatic/include" \
"${sourceDir}/include/leveldb/c.h" >> "${output}"
sed -i 's/\bpassC\b/passc/g' "${output}"
sed -i 's/{\.compile\:\ \"\./{\.compile\:\ root\ \&\ \"/g' "${output}"
sed -i 's/{\.passc\:\ \"-I\./{\.passc\:\ \"-I\"\ \&\ root\ \&\ \"/g' "${output}"

0
build/.keep Normal file
View File

View File

@ -1,9 +0,0 @@
#include <crc32c/crc32c.h>
int main(int argc, char** argv)
{
char* buffer;
size_t size;
::crc32c::Extend(0, buffer, size);
return 0;
}

View File

@ -1,7 +0,0 @@
#include <unistd.h>
int main(int argc, char** argv)
{
fdatasync(-1);
return 0;
}

View File

@ -1,7 +0,0 @@
#include <fcntl.h>
int main(int argc, char** argv)
{
int i = F_FULLSYNC;
return 0;
}

View File

@ -1,7 +0,0 @@
#include <fcntl.h>
int main(int argc, char** argv)
{
int i = O_CLOEXEC;
return 0;
}

View File

@ -1,10 +0,0 @@
#include <snappy.h>
int main(int argc, char** argv)
{
char* input;
size_t length;
size_t result;
snappy::GetUncompressedLength(input, length, &result);
return 0;
}

View File

@ -1,8 +0,0 @@
#include <zstd.h>
int main(int argc, char** argv)
{
size_t length;
ZSTD_compressBound(length);
return 0;
}

View File

@ -7,7 +7,7 @@
// Define to 1 if you have a definition for fdatasync() in <unistd.h>.
#if !defined(HAVE_FDATASYNC)
#define HAVE_FDATASYNC 1
#define HAVE_FDATASYNC 0
#endif // !defined(HAVE_FDATASYNC)
// Define to 1 if you have a definition for F_FULLFSYNC in <fcntl.h>.
@ -17,7 +17,7 @@
// Define to 1 if you have a definition for O_CLOEXEC in <fcntl.h>.
#if !defined(HAVE_O_CLOEXEC)
#define HAVE_O_CLOEXEC 1
#define HAVE_O_CLOEXEC 0
#endif // !defined(HAVE_O_CLOEXEC)
// Define to 1 if you have Google CRC32C.
@ -31,7 +31,7 @@
#endif // !defined(HAVE_SNAPPY)
// Define to 1 if you have Zstd.
#if !defined(HAVE_Zstd)
#if !defined(HAVE_ZSTD)
#define HAVE_ZSTD 0
#endif // !defined(HAVE_ZSTD)

View File

@ -3,7 +3,6 @@ import os
const root = currentSourcePath.parentDir.parentDir
const envWindows = root/"vendor"/"util"/"env_windows.cc"
const envPosix = root/"vendor"/"util"/"env_posix.cc"
const checkers = root/"checkers"
when defined(windows):
{.compile: envWindows.}
@ -14,20 +13,3 @@ when defined(windows):
when defined(posix):
{.compile: envPosix.}
{.passc: "-DLEVELDB_PLATFORM_POSIX".}
static:
proc doesCompile(cfile: string): int =
let rv = gorgeEx("gcc " & cfile)
if rv[1] == 0:
return 1
return 0
{.passc: "-DHAVE_FDATASYNC=" & $doesCompile(checkers/"check_fdatasync.c").}
{.passc: "-DHAVE_FULLFSYNC=" & $doesCompile(checkers/"check_fullfsync.c").}
{.passc: "-DHAVE_O_CLOEXEC=" & $doesCompile(checkers/"check_ocloexec.c").}
{.passc: "-DHAVE_CRC32C=" & $doesCompile(checkers/"check_crc32c.c").}
{.passc: "-DHAVE_SNAPPY=" & $doesCompile(checkers/"check_snappy.c").}
{.passc: "-DHAVE_ZSTD=" & $doesCompile(checkers/"check_zstd.c").}
{.passc: "-DHAVE_Zstd=" & $doesCompile(checkers/"check_zstd.c").}