diff options
30 files changed, 306 insertions, 139 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index e50024ed45b..4039a2b0204 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -25,6 +25,7 @@ env.InjectMongoIncludePaths() env.SConscript( dirs=[ 'base', + 'bson', 'client', 'crypto', 'db', @@ -42,70 +43,6 @@ env.SConscript( ], ) -# ------ SOURCE FILE SETUP ----------- - -env.Library('bson', [ - 'bson/mutable/document.cpp', - 'bson/mutable/element.cpp', - 'bson/util/bson_extract.cpp', - 'util/safe_num.cpp', - 'bson/bson_validate.cpp', - 'bson/oid.cpp', - "bson/timestamp.cpp", - 'bson/bson_startuptest.cpp', - 'bson/bsonelement.cpp', - 'bson/bsonmisc.cpp', - 'bson/bsonobj.cpp', - 'bson/bsonobjbuilder.cpp', - 'bson/bsontypes.cpp', - 'bson/json.cpp' - ], LIBDEPS=[ - '$BUILD_DIR/mongo/platform/platform', - 'base/base', - 'util/stringutils', - 'util/md5', - ]) - -env.Library('mutable_bson_test_utils', [ - 'bson/mutable/mutable_bson_test_utils.cpp' - ], LIBDEPS=['bson']) - -env.CppUnitTest('builder_test', ['bson/util/builder_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('mutable_bson_test', ['bson/mutable/mutable_bson_test.cpp'], - LIBDEPS=['bson', 'mutable_bson_test_utils']) - -env.CppUnitTest('mutable_bson_algo_test', ['bson/mutable/mutable_bson_algo_test.cpp'], - LIBDEPS=['bson', 'mutable_bson_test_utils']) - -env.CppUnitTest('safe_num_test', ['util/safe_num_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('string_map_test', ['util/string_map_test.cpp'], - LIBDEPS=['bson','util/foundation']) - -env.CppUnitTest('bson_field_test', ['bson/bson_field_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('bson_obj_test', ['bson/bson_obj_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('bson_obj_data_type_test', ['bson/bson_obj_data_type_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('bson_validate_test', ['bson/bson_validate_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('bsonobjbuilder_test', ['bson/bsonobjbuilder_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('oid_test', ['bson/oid_test.cpp'], - LIBDEPS=['bson']) - -env.CppUnitTest('bson_extract_test', ['bson/util/bson_extract_test.cpp'], LIBDEPS=['bson']) -env.CppUnitTest('bson_check_test', ['bson/util/bson_check_test.cpp'], LIBDEPS=['bson']) - def get_toolchain_ver(tool): # By default we don't know the version of each tool, and only report what # command gets executed (gcc vs /opt/mongodbtoolchain/bin/gcc). @@ -202,7 +139,7 @@ env.Library('version', 'util/version.cpp' ], LIBDEPS=[ - 'bson', + 'bson/bson', '$BUILD_DIR/mongo/base/base' ]) @@ -222,7 +159,7 @@ if env['MONGO_BUILD_SASL_CLIENT']: extraCommonLibdeps.append('client/cyrus_sasl_client_session') env.Library('mongocommon', commonFiles, - LIBDEPS=['bson', + LIBDEPS=['bson/bson', 'util/background_job', '$BUILD_DIR/mongo/client/clientdriver', 'util/fail_point', diff --git a/src/mongo/bson/SConscript b/src/mongo/bson/SConscript new file mode 100644 index 00000000000..26586b5d3b1 --- /dev/null +++ b/src/mongo/bson/SConscript @@ -0,0 +1,92 @@ +# -*- mode: python; -*- + +Import('env') + +env.SConscript( + dirs=[ + 'mutable', + 'util', + ], +) + +env.Library( + target='bson', + source=[ + 'bson_startuptest.cpp', + 'bson_validate.cpp', + 'bsonelement.cpp', + 'bsonmisc.cpp', + 'bsonobj.cpp', + 'bsonobjbuilder.cpp', + 'bsontypes.cpp', + 'json.cpp', + 'oid.cpp', + 'timestamp.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/base/base', + '$BUILD_DIR/mongo/platform/platform', + '$BUILD_DIR/mongo/util/md5', + '$BUILD_DIR/mongo/util/stringutils', + ], +) + +env.CppUnitTest( + target='bson_field_test', + source=[ + 'bson_field_test.cpp', + ], + LIBDEPS=[ + 'bson', + ], +) + +env.CppUnitTest( + target='bson_obj_test', + source=[ + 'bson_obj_test.cpp', + ], + LIBDEPS=[ + 'bson', + ], +) + +env.CppUnitTest( + target='bson_obj_data_type_test', + source=[ + 'bson_obj_data_type_test.cpp', + ], + LIBDEPS=[ + 'bson', + ] +) + +env.CppUnitTest( + target='bson_validate_test', + source=[ + 'bson_validate_test.cpp', + ], + LIBDEPS=[ + 'bson', + ], +) + +env.CppUnitTest( + target='bsonobjbuilder_test', + source=[ + 'bsonobjbuilder_test.cpp', + ], + LIBDEPS=[ + 'bson', + ], +) + +env.CppUnitTest( + target='oid_test', + source=[ + 'oid_test.cpp', + ], + LIBDEPS=[ + 'bson', + ], +) diff --git a/src/mongo/bson/mutable/SConscript b/src/mongo/bson/mutable/SConscript new file mode 100644 index 00000000000..9546d260f5f --- /dev/null +++ b/src/mongo/bson/mutable/SConscript @@ -0,0 +1,48 @@ +# -*- mode: python; -*- + +Import('env') + +env.Library( + target='mutable_bson', + source=[ + 'document.cpp', + 'element.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/util/safe_num', + '$BUILD_DIR/mongo/bson/bson', + ], +) + +env.Library( + target='mutable_bson_test_utils', + source=[ + 'mutable_bson_test_utils.cpp', + ], + LIBDEPS=[ + 'mutable_bson', + ], +) + +env.CppUnitTest( + target='mutable_bson_test', + source=[ + 'mutable_bson_test.cpp' + ], + LIBDEPS=[ + 'mutable_bson', + 'mutable_bson_test_utils', + ], +) + +env.CppUnitTest( + target='mutable_bson_algo_test', + source=[ + 'mutable_bson_algo_test.cpp', + ], + LIBDEPS=[ + 'mutable_bson', + 'mutable_bson_test_utils', + ], +) + diff --git a/src/mongo/bson/util/SConscript b/src/mongo/bson/util/SConscript new file mode 100644 index 00000000000..8360fb10ed3 --- /dev/null +++ b/src/mongo/bson/util/SConscript @@ -0,0 +1,44 @@ +# -*- mode: python; -*- + +Import('env') + +env.Library( + target='bson_extract', + source=[ + 'bson_extract.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + ], +) + +env.CppUnitTest( + target='bson_extract_test', + source=[ + 'bson_extract_test.cpp' + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + 'bson_extract', + ], +) + +env.CppUnitTest( + target='builder_test', + source=[ + 'builder_test.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + ], +) + +env.CppUnitTest( + target='bson_check_test', + source=[ + 'bson_check_test.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + ], +) diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript index 7601a4ba79e..19cf6ef3fe4 100644 --- a/src/mongo/client/SConscript +++ b/src/mongo/client/SConscript @@ -27,6 +27,7 @@ env.Library('clientdriver', [ "$BUILD_DIR/mongo/db/dbmessage.cpp" ], LIBDEPS=['connectionstring', + '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/auth/authcommon', '$BUILD_DIR/mongo/crypto/scramauth', '$BUILD_DIR/mongo/rpc/command_status', diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index 94e41d8a237..3f3032c60da 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -39,7 +39,7 @@ env.Library( 'write_concern_options.cpp' ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/foundation', '$BUILD_DIR/mongo/db/index_names', '$BUILD_DIR/mongo/db/service_context', @@ -137,6 +137,7 @@ env.Library( 'curop.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/bson/mutable/mutable_bson', '$BUILD_DIR/mongo/db/commands/server_status_core', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/stats/top', @@ -178,7 +179,7 @@ env.Library( 'range_arithmetic.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/foundation', ], ) @@ -226,7 +227,7 @@ env.Library( "server_parameters.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "$BUILD_DIR/mongo/util/foundation", ], ) @@ -258,7 +259,7 @@ env.CppUnitTest( 'update_index_data_test.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', 'common', 'update_index_data', ], @@ -274,7 +275,7 @@ env.Library( "server_options.cpp", ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ], ) @@ -284,7 +285,7 @@ env.Library( "server_options_helpers.cpp", ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/cmdline_utils/cmdline_utils', # The dependency on network is a temporary crutch that should go away once the # networking library has separate options @@ -313,7 +314,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/repl/repl_coordinator_global', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/util/concurrency/synchronization', diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript index 43108fc4212..b8aa0e38063 100644 --- a/src/mongo/db/auth/SConscript +++ b/src/mongo/db/auth/SConscript @@ -30,7 +30,9 @@ env.Library('authcore', ['action_set.cpp', 'user_set.cpp'], LIBDEPS=['sasl_options', '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson', + '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/crypto/scramauth', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/ops/update_driver', @@ -41,7 +43,11 @@ env.Library('authcore', ['action_set.cpp', env.Library('authcommon', ['internal_user_auth.cpp'], - LIBDEPS=['$BUILD_DIR/mongo/bson']) + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson', + '$BUILD_DIR/mongo/bson/util/bson_extract', + ]) env.Library('authorization_manager_global', [ diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript index d044e256d15..118363ff1a7 100644 --- a/src/mongo/db/catalog/SConscript +++ b/src/mongo/db/catalog/SConscript @@ -2,7 +2,7 @@ Import("env") -env.Library('collection_options', ['collection_options.cpp'], LIBDEPS=['$BUILD_DIR/mongo/bson']) +env.Library('collection_options', ['collection_options.cpp'], LIBDEPS=['$BUILD_DIR/mongo/bson/bson']) env.CppUnitTest('collection_options_test', ['collection_options_test.cpp'], LIBDEPS=['collection_options']) @@ -13,7 +13,7 @@ env.Library( "index_key_validate.cpp", ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/index_names', ], diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript index 1cfcd63fe4f..12733c1db8a 100644 --- a/src/mongo/db/commands/SConscript +++ b/src/mongo/db/commands/SConscript @@ -9,7 +9,7 @@ env.Library( 'server_status_metric.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson' + '$BUILD_DIR/mongo/bson/bson' ] ) diff --git a/src/mongo/db/exec/SConscript b/src/mongo/db/exec/SConscript index e5a4b0922c5..a85e098ff79 100644 --- a/src/mongo/db/exec/SConscript +++ b/src/mongo/db/exec/SConscript @@ -9,7 +9,7 @@ env.Library( "working_set.cpp", ], LIBDEPS = [ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", ], ) @@ -72,7 +72,7 @@ env.Library( ], LIBDEPS = [ "scoped_timer", - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", ], ) diff --git a/src/mongo/db/geo/SConscript b/src/mongo/db/geo/SConscript index 4f08472e979..5524a1e2a33 100644 --- a/src/mongo/db/geo/SConscript +++ b/src/mongo/db/geo/SConscript @@ -7,14 +7,14 @@ env.Library("geometry", [ "hash.cpp", "shapes.cpp", "big_polygon.cpp", "r2_region_coverer.cpp" ], - LIBDEPS = [ "$BUILD_DIR/mongo/bson", + LIBDEPS = [ "$BUILD_DIR/mongo/bson/bson", "$BUILD_DIR/third_party/s2/s2" ]) # Geometry / BSON parsing and wrapping env.Library("geoparser", [ "geoparser.cpp", "geometry_container.cpp" ], LIBDEPS = [ "geometry", - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "$BUILD_DIR/third_party/s2/s2" ]) env.CppUnitTest("hash_test", [ "hash_test.cpp" ], diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript index 2c47b60f660..8e15af268aa 100644 --- a/src/mongo/db/index/SConscript +++ b/src/mongo/db/index/SConscript @@ -18,7 +18,7 @@ env.Library( 'expression_keys_private.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/fts/base', '$BUILD_DIR/mongo/db/geo/geometry', '$BUILD_DIR/mongo/db/geo/geoparser', @@ -34,7 +34,7 @@ env.Library( ], LIBDEPS=[ 'key_generator', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ], ) diff --git a/src/mongo/db/matcher/SConscript b/src/mongo/db/matcher/SConscript index 82df8014a77..9b77d99c452 100644 --- a/src/mongo/db/matcher/SConscript +++ b/src/mongo/db/matcher/SConscript @@ -9,7 +9,7 @@ env.Library( 'path_internal.cpp' ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', ], ) @@ -38,7 +38,7 @@ env.Library( 'matchable.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/third_party/shim_pcrecpp', 'path', diff --git a/src/mongo/db/ops/SConscript b/src/mongo/db/ops/SConscript index f7718ac976a..c445a91a7a4 100644 --- a/src/mongo/db/ops/SConscript +++ b/src/mongo/db/ops/SConscript @@ -10,7 +10,8 @@ env.Library( 'path_support.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/util/foundation', '$BUILD_DIR/mongo/db/matcher/expressions', @@ -33,7 +34,7 @@ env.CppUnitTest( 'log_builder_test.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update_common', ], ) @@ -44,7 +45,7 @@ env.CppUnitTest( 'path_support_test.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', '$BUILD_DIR/mongo/db/matcher/expressions', 'update_common', ], @@ -78,7 +79,7 @@ env.CppUnitTest( target='modifier_add_to_set_test', source='modifier_add_to_set_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -87,7 +88,7 @@ env.CppUnitTest( target='modifier_bit_test', source='modifier_bit_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -96,7 +97,7 @@ env.CppUnitTest( target='modifier_compare_test', source='modifier_compare_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -105,7 +106,7 @@ env.CppUnitTest( target='modifier_current_date_test', source='modifier_current_date_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -114,7 +115,7 @@ env.CppUnitTest( target='modifier_inc_test', source='modifier_inc_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -123,7 +124,7 @@ env.CppUnitTest( target='modifier_object_replace_test', source='modifier_object_replace_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -132,7 +133,7 @@ env.CppUnitTest( target='modifier_pop_test', source='modifier_pop_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -149,7 +150,7 @@ env.CppUnitTest( target='modifier_pull_all_test', source='modifier_pull_all_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -158,7 +159,7 @@ env.CppUnitTest( target='modifier_pull_test', source='modifier_pull_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -167,7 +168,7 @@ env.CppUnitTest( target='modifier_push_test', source='modifier_push_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -176,7 +177,7 @@ env.CppUnitTest( target='modifier_rename_test', source='modifier_rename_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -185,7 +186,7 @@ env.CppUnitTest( target='modifier_set_test', source='modifier_set_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -194,7 +195,7 @@ env.CppUnitTest( target='modifier_unset_test', source='modifier_unset_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', 'update', ], ) @@ -206,7 +207,7 @@ env.Library( 'update_driver.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/query/query_planner', '$BUILD_DIR/mongo/db/update_index_data', @@ -226,7 +227,7 @@ env.CppUnitTest( target='update_driver_test', source='update_driver_test.cpp', LIBDEPS=[ - '$BUILD_DIR/mongo/mutable_bson_test_utils', + '$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils', '$BUILD_DIR/mongo/db/query/query_planner', 'update_driver', ], diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript index 5e70b2a5e61..f4f8c04508a 100644 --- a/src/mongo/db/pipeline/SConscript +++ b/src/mongo/db/pipeline/SConscript @@ -27,7 +27,7 @@ env.Library( ], LIBDEPS=[ 'field_path', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/foundation', '$BUILD_DIR/mongo/util/intrusive_counter', ] diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript index 6f8f691f89d..9d247b25b28 100644 --- a/src/mongo/db/query/SConscript +++ b/src/mongo/db/query/SConscript @@ -24,7 +24,7 @@ env.Library( "getmore_request", "index_bounds", "lite_parsed_query", - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "$BUILD_DIR/mongo/db/matcher/expression_algo", "$BUILD_DIR/mongo/db/matcher/expressions", "$BUILD_DIR/mongo/db/matcher/expressions_text", @@ -79,7 +79,7 @@ env.Library( "interval.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "$BUILD_DIR/mongo/db/matcher/expressions_geo", "$BUILD_DIR/mongo/db/index_names", "$BUILD_DIR/mongo/db/mongohasher", @@ -93,7 +93,7 @@ env.Library( "explain_common.cpp" ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", ], ) @@ -103,7 +103,7 @@ env.Library( "getmore_request.cpp" ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", ], ) @@ -132,7 +132,7 @@ env.Library( "lite_parsed_query.cpp" ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", ], ) diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index 3cf7ed37c4b..c46172cbd30 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -23,7 +23,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/client/clientdriver', '$BUILD_DIR/mongo/coredb', '$BUILD_DIR/mongo/db/common', @@ -267,7 +267,8 @@ env.Library('replica_set_messages', 'last_vote.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', + '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/util/net/hostandport', '$BUILD_DIR/mongo/db/common', ]) @@ -278,7 +279,10 @@ env.CppUnitTest('replica_set_config_test', 'replica_set_config_test.cpp', 'replica_set_tag_test.cpp', ], - LIBDEPS=['replica_set_messages']) + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/mutable/mutable_bson', + 'replica_set_messages', + ]) env.CppUnitTest('isself_test', [ diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript index 826740a9ac4..eb241491337 100644 --- a/src/mongo/db/storage/SConscript +++ b/src/mongo/db/storage/SConscript @@ -44,7 +44,7 @@ env.Library( 'oplog_hack.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ] ) @@ -122,7 +122,7 @@ env.Library( 'storage_engine_metadata.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ] ) @@ -139,6 +139,6 @@ env.CppUnitTest( source='key_string_test.cpp', LIBDEPS=[ 'key_string', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ] ) diff --git a/src/mongo/db/storage/in_memory/SConscript b/src/mongo/db/storage/in_memory/SConscript index b89f229c07d..95862326711 100644 --- a/src/mongo/db/storage/in_memory/SConscript +++ b/src/mongo/db/storage/in_memory/SConscript @@ -6,7 +6,7 @@ env.Library( 'in_memory_record_store.cpp' ], LIBDEPS= [ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/storage/oplog_hack', '$BUILD_DIR/mongo/util/foundation', ] @@ -21,7 +21,7 @@ env.Library( ], LIBDEPS= [ 'in_memory_record_store', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/index/index_descriptor', '$BUILD_DIR/mongo/db/storage/index_entry_comparison', diff --git a/src/mongo/db/storage/mmap_v1/SConscript b/src/mongo/db/storage/mmap_v1/SConscript index d848e015f42..31dd3cc29c6 100644 --- a/src/mongo/db/storage/mmap_v1/SConscript +++ b/src/mongo/db/storage/mmap_v1/SConscript @@ -42,7 +42,7 @@ env.Library( 'extent_manager.cpp', ], LIBDEPS= [ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/foundation', ] ) @@ -143,7 +143,7 @@ env.Library( 'btree/key.cpp' ], LIBDEPS= [ - '$BUILD_DIR/mongo/bson' + '$BUILD_DIR/mongo/bson/bson' ] ) diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript index c4317fc4339..ab8a80b8e6d 100644 --- a/src/mongo/db/storage/wiredtiger/SConscript +++ b/src/mongo/db/storage/wiredtiger/SConscript @@ -20,7 +20,7 @@ if wiredtiger: 'wiredtiger_util.cpp', ], LIBDEPS= [ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/index/index_descriptor', diff --git a/src/mongo/dbtests/SConscript b/src/mongo/dbtests/SConscript index bd35c65a4aa..72f6eeb8625 100644 --- a/src/mongo/dbtests/SConscript +++ b/src/mongo/dbtests/SConscript @@ -109,7 +109,7 @@ dbtest = env.Program( "$BUILD_DIR/mongo/db/repl/repl_coordinator_global", "$BUILD_DIR/mongo/db/repl/replmocks", "$BUILD_DIR/mongo/mongocommon", - "$BUILD_DIR/mongo/mutable_bson_test_utils", + "$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils", "$BUILD_DIR/mongo/s/cluster_ops", "$BUILD_DIR/mongo/s/cluster_ops_impl", "$BUILD_DIR/mongo/serveronly", diff --git a/src/mongo/logger/SConscript b/src/mongo/logger/SConscript index cee881d14db..c3ac2279fb7 100644 --- a/src/mongo/logger/SConscript +++ b/src/mongo/logger/SConscript @@ -23,7 +23,7 @@ env.Library('logger', env.Library('parse_log_component_settings', ['parse_log_component_settings.cpp'], - LIBDEPS=['logger', '$BUILD_DIR/mongo/bson']) + LIBDEPS=['logger', '$BUILD_DIR/mongo/bson/bson']) # writes multi-byte sequences to console # to support manual testing of console stream under Windows diff --git a/src/mongo/rpc/SConscript b/src/mongo/rpc/SConscript index ff586a7da4e..3bff42a61e6 100644 --- a/src/mongo/rpc/SConscript +++ b/src/mongo/rpc/SConscript @@ -10,7 +10,7 @@ env.Library( 'get_status_from_command_result.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/util/foundation' ], ) diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript index 77ecd0b6151..45184da7c22 100644 --- a/src/mongo/s/SConscript +++ b/src/mongo/s/SConscript @@ -21,7 +21,7 @@ env.Library('base', ['mongo_version_range.cpp', 'type_mongos.cpp', 'type_tags.cpp'], LIBDEPS=['$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson']) + '$BUILD_DIR/mongo/bson/bson']) env.CppUnitTest('chunk_version_test', 'chunk_version_test.cpp', LIBDEPS=['base', @@ -29,7 +29,7 @@ env.CppUnitTest('chunk_version_test', 'chunk_version_test.cpp', env.CppUnitTest('mongo_version_range_test', 'mongo_version_range_test.cpp', LIBDEPS=['base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common']) env.CppUnitTest('type_config_version_test', 'type_config_version_test.cpp', @@ -65,7 +65,7 @@ env.Library( LIBDEPS=[ 'base', 'catalog/catalog_types', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/base/base', '$BUILD_DIR/mongo/client/clientdriver', '$BUILD_DIR/mongo/db/range_arithmetic', @@ -115,7 +115,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ], ) @@ -148,7 +148,7 @@ env.Library( 'write_ops/batch_write_exec.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/client/clientdriver', 'batch_write_types', '$BUILD_DIR/mongo/util/concurrency/synchronization' @@ -177,7 +177,7 @@ env.Library( 'write_ops/batch_downconvert.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', # for Message '$BUILD_DIR/mongo/db/lasterror', 'cluster_ops', @@ -213,7 +213,7 @@ env.Library( 'dbclient_shard_resolver.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/s/client/sharding_client', 'cluster_ops', 'cluster_write_op_conversion', diff --git a/src/mongo/s/catalog/SConscript b/src/mongo/s/catalog/SConscript index cfc8154d5bd..e40f92a0b8c 100644 --- a/src/mongo/s/catalog/SConscript +++ b/src/mongo/s/catalog/SConscript @@ -21,7 +21,8 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', + '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/common', ] ) @@ -34,7 +35,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/s/batch_write_types', '$BUILD_DIR/mongo/s/catalog/catalog_types' diff --git a/src/mongo/scripting/SConscript b/src/mongo/scripting/SConscript index 22011889158..db20701e040 100644 --- a/src/mongo/scripting/SConscript +++ b/src/mongo/scripting/SConscript @@ -21,7 +21,7 @@ env.Library( "bson_template_evaluator.cpp", ], LIBDEPS=[ - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', ], ) diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript index 5d03dfcf089..0e1a47f609e 100644 --- a/src/mongo/util/SConscript +++ b/src/mongo/util/SConscript @@ -172,7 +172,7 @@ env.Library( "processinfo_${TARGET_OS}.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "foundation", ], ) @@ -195,7 +195,7 @@ env.Library( "fail_point_service.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/bson", + "$BUILD_DIR/mongo/bson/bson", "foundation", ], ) @@ -327,7 +327,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/bson', + '$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/mongo/version', 'stringutils', ], @@ -379,3 +379,35 @@ env.CppUnitTest( # None since unowned_ptr is header-only. ], ) + +env.Library( + target='safe_num', + source=[ + 'safe_num.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + ], +) + +env.CppUnitTest( + target='safe_num_test', + source=[ + 'safe_num_test.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + 'safe_num', + ], +) + +env.CppUnitTest( + target='string_map_test', + source=[ + 'string_map_test.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/bson/bson', + 'foundation', + ], +) diff --git a/src/mongo/util/cmdline_utils/SConscript b/src/mongo/util/cmdline_utils/SConscript index 1a5182442c4..1309f693195 100644 --- a/src/mongo/util/cmdline_utils/SConscript +++ b/src/mongo/util/cmdline_utils/SConscript @@ -3,7 +3,7 @@ Import("env") env.Library('cmdline_utils', ['censor_cmdline.cpp'], - LIBDEPS=['$BUILD_DIR/mongo/bson']) + LIBDEPS=['$BUILD_DIR/mongo/bson/bson']) env.CppUnitTest('censor_cmdline_test', 'censor_cmdline_test.cpp', diff --git a/src/mongo/util/options_parser/SConscript b/src/mongo/util/options_parser/SConscript index dfa3df31bfb..bdc543da685 100644 --- a/src/mongo/util/options_parser/SConscript +++ b/src/mongo/util/options_parser/SConscript @@ -14,7 +14,7 @@ optsEnv.Library('options_parser', ['environment.cpp', 'startup_option_init.cpp', 'startup_options.cpp', ], - LIBDEPS=['$BUILD_DIR/mongo/bson', + LIBDEPS=['$BUILD_DIR/mongo/bson/bson', '$BUILD_DIR/third_party/shim_yaml', '$BUILD_DIR/third_party/shim_pcrecpp' ]) |