# -*- mode: python -*- Import("env") env = env.Clone() optsEnv = env.Clone() optsEnv.InjectThirdParty(libraries=['yaml']) # TODO BUILD-16566 # This warning cause false positives with the v4 toolchain gcc on Ubuntu 2022 ARM64 # platforms, in short term we will disable the warning until we can figure out what the # underlying issue is. Once the toolchain is updated, the workaround below should be removed. if env.ToolchainIs('gcc') and env['TARGET_ARCH'] == 'aarch64': no_misleading_indentation_flag = ['-Wno-misleading-indentation'] else: no_misleading_indentation_flag = [] optsEnv.Library( target='options_parser', source=[ 'constraints.cpp', 'environment.cpp', 'option_description.cpp', 'option_section.cpp', 'options_parser.cpp', 'startup_option_init.cpp', 'startup_options.cpp', 'value.cpp', ], CCFLAGS=no_misleading_indentation_flag + optsEnv.get('CCFLAGS', []), LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/third_party/shim_yaml', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/crypto/sha_block_${MONGO_CRYPTO}', '$BUILD_DIR/mongo/util/net/http_client', '$BUILD_DIR/mongo/util/net/network', '$BUILD_DIR/third_party/shim_boost', ], ) # This library contains the initializers to run option parsing. This is separated into its own # library because some code that is shared between many different binaries needs to link against the # options_parser library, but not all these binaries need to actually run the option parsing. # Linking against this library will cause the option parsing initializer to actually be run. env.Library( 'options_parser_init', ['options_parser_init.cpp'], LIBDEPS=['options_parser'], ) env.CppUnitTest( target='options_parser_test', source=[ 'environment_test.cpp', 'options_parser_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/unittest/unittest', 'options_parser', ], )