SERVER-37542 Add support for building wt tool through SCons.

This commit is contained in:
Max Hirschhorn
2018-10-10 11:38:37 -04:00
parent 0d4e8a8b21
commit 6d2dc9439e
3 changed files with 29 additions and 0 deletions

View File

@@ -271,6 +271,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
executable_name("mongobridge"),
executable_name("mongoebench"),
executable_name("mongoed"),
executable_name("wt"),
"build/integration_tests.txt",
]
with tarfile.open(filename, "r:gz") as tar:

View File

@@ -3455,6 +3455,7 @@ tasks:
cat build/integration_tests.txt | xargs ${strip_command|/usr/bin/strip}
${strip_command|/usr/bin/strip} dbtest
${strip_command|/usr/bin/strip} mongobridge
${strip_command|/usr/bin/strip} wt
fi
@@ -3506,6 +3507,7 @@ tasks:
- "./mongobridge*"
- "./mongoebench*"
- "./mongoed*"
- "./wt*"
- "buildscripts/**"
- "*Example"
- "*Test"

View File

@@ -196,6 +196,7 @@ wtlib = env.Library(
source=wtsources,
LIBDEPS=[
'wiredtiger_checksum',
'$BUILD_DIR/third_party/shim_allocator',
'$BUILD_DIR/third_party/shim_snappy',
'$BUILD_DIR/third_party/shim_zlib',
],
@@ -205,3 +206,28 @@ wtlib = env.Library(
)
env.Depends([cslib, wtlib], [filelistfile, version_file])
wtbinEnv = env.Clone()
if wtbinEnv.TargetOSIs("windows"):
# C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++
# conformant name: _strdup. See online help for details.
wtbinEnv.Append(CFLAGS=["/wd4996"])
wtbin = wtbinEnv.Program(
target="wt",
source=Glob("src/utilities/*.c"),
LIBDEPS=["wiredtiger"],
# SCons's smart_link() decides to try and link as C because all of the file extensions are .c;
# however, we must link with snappy, etc. as C++. The smart_link() function isn't used by
# default on Windows, so we leave the value unchanged on other platforms.
LINK="$CXX" if wtbinEnv["LINK"] == "$SMARTLINK" else wtbinEnv["LINK"],
INSTALL_ALIAS=[
"tools",
],
)
hygienic = get_option("install-mode") == "hygienic"
if not hygienic:
wtbinEnv.Alias("tools", wtbinEnv.Install("#/", wtbin))