diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-03 12:51:38 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-03 12:51:38 +1000 |
commit | f154e2e2ecc158140d338b0debb9664c0d5ba509 (patch) | |
tree | 9d4250ef2e62e15eb68c52fda942fd147679c50e | |
parent | 319cde4da32021455c56deb100401ee05020990e (diff) | |
download | mongo-f154e2e2ecc158140d338b0debb9664c0d5ba509.tar.gz |
SERVER-24334 Support conditional files in WiredTiger build.
-rw-r--r-- | src/third_party/wiredtiger/SConscript | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript index 50ce293f7c3..1e52c00221e 100644 --- a/src/third_party/wiredtiger/SConscript +++ b/src/third_party/wiredtiger/SConscript @@ -130,14 +130,27 @@ env.Alias('generated-sources', "wiredtiger.h") # # WiredTiger library # -filelistfile = "build_win/filelist.win" if env.TargetOSIs('windows') else 'dist/filelist' +# Map WiredTiger build conditions: any conditions that appear in WiredTiger's +# dist/filelist must appear here, and if the value is true, those files will be +# included. +# +condition_map = { + 'POSIX_HOST' : not env.TargetOSIs('windows'), + 'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le', + 'WINDOWS_HOST' : env.TargetOSIs('windows'), +} -wtsources = [] +def filtered_filelist(f): + for line in f: + file_cond = line.split() + if line.startswith("#") or len(file_cond) == 0: + continue + if len(file_cond) == 1 or condition_map[file_cond[1]]: + yield file_cond[0] +filelistfile = 'dist/filelist' with open(File(filelistfile).srcnode().abspath) as filelist: - wtsources = [line.strip() - for line in filelist - if not line.startswith("#") and len(line.strip()) >= 1] + wtsources = list(filtered_filelist(filelist)) if useZlib: env.Append(CPPDEFINES=['HAVE_BUILTIN_EXTENSION_ZLIB']) |