Build a dictionnary with an entry for cppflags, ldflags, and cxxflags.

    These options are filled according to the command line defined options
179365
def compile_flags(args):
    

    compiler_options = {
        'define_macros': args.defines,
        'undef_macros': args.undefs,
        'include_dirs': args.include_dirs,
        'extra_compile_args': args.extra_flags,
        'library_dirs': args.libraries_dir,
        'extra_link_args': args.extra_flags,
    }
    for param in ('opts', ):
        val = getattr(args, param, None)
        if val:
            compiler_options[param] = val

    return compiler_options
401767
function buildArgs(options) {
    // access, private, readme, template, etc.. These CLI options do not
    // have affect when run with --explain (-X) flag. They are for
    // jsdoc-genrated docs. access is handled within the filter method.
    const opts = _.defaults(options, {
        // files: ... // non-jsdoc option
        encoding: 'utf8',
        package: null, // path
        recurse: false,
        pedantic: false,
        query: null
        // debug: false
        // verbose: false
    });

    let args = ['-X'];
    args = args.concat(helper.ensureArray(opts.files));
    args.push('-e', opts.encoding);
    if (_.isString(opts.package)) {
        args.push('-P', opts.package);
    }
    if (opts.recurse) args.push('-r');
    if (opts.pedantic) args.push('--pedantic');
    if (opts.query) args.push('-q', opts.query);
    // if (opts.debug) args.push('--debug');
    // if (opts.verbose) args.push('--verbose');
    return args;
}
759160
def _windowsLdmodTargets(target, source, env, for_signature):
    """"""
    return _dllTargets(target, source, env, for_signature, 'LDMODULE')
63274
def parse_options(cls, options):
        """"""
        if (not options.putty_select and not options.putty_ignore and
                not options.putty_auto_ignore):
            return

        options._orig_select = options.select
        options._orig_ignore = options.ignore

        options.putty_select = Parser(options.putty_select)._rules
        options.putty_ignore = Parser(options.putty_ignore)._rules

        if options.putty_auto_ignore:
            options.putty_ignore.append(AutoLineDisableRule())

        options.ignore_code = functools.partial(
            putty_ignore_code,
            options,
        )

        options.report._ignore_code = options.ignore_code
302482
def flags_as_args():
  """"""
  if hasattr(FLAGS, "flag_values_dict"):
    args_dict = FLAGS.flag_values_dict()
  else:
    args_dict = dict(FLAGS.__dict__["__flags"])
  del args_dict["cloud_mlengine"]
  # Configured later
  del args_dict["t2t_usr_dir"]
  args_dict.pop("h", None)
  args_dict.pop("helpfull", None)
  args_dict.pop("helpshort", None)
  args_dict.pop("help", None)
  args = []
  for name, val in args_dict.items():
    if val is None:
      continue
    if name.startswith("autotune"):
      continue
    args.extend(["--%s=%s" % (name, str(val))])
  return args
983829
function build(options) {
  var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat(
    ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) {
      return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
    })).concat(options.args);

  console.log('Building:', [process.execPath].concat(args).join(' '));

  var proc = spawn(process.execPath, args, {
    stdio: [0, 1, 2]
  });

  proc.on('exit', function(errorCode) {
    if (!errorCode) {
      afterBuild(options);
      return;
    }

    if (errorCode === 127 ) {
      console.error('node-gyp not found!');
    } else {
      console.error('Build failed with error code:', errorCode);
    }

    process.exit(1);
  });
}
1145559
def mapping_args(parser):
    """"""
    parser.add_argument('--add-prefix',
                        dest='add_prefix',
                        help='Specify a prefix to use when '
                        'generating secret key names')
    parser.add_argument('--add-suffix',
                        dest='add_suffix',
                        help='Specify a suffix to use when '
                        'generating secret key names')
    parser.add_argument('--merge-path',
                        dest='merge_path',
                        action='store_true',
                        default=True,
                        help='merge vault path and key name')
    parser.add_argument('--no-merge-path',
                        dest='merge_path',
                        action='store_false',
                        default=True,
                        help='do not merge vault path and key name')
    parser.add_argument('--key-map',
                        dest='key_map',
                        action='append',
                        type=str,
                        default=[])
690381
def _define_helper(flag_name, default_value, docstring, flagtype, required):
    """"""
    option_name = flag_name if required else "--%s" % flag_name
    get_context_parser().add_argument(
        option_name, default=default_value, help=docstring, type=flagtype)
442347
def build_flags(library, type_, path):
    """"""

    pkg_config_path = [path]
    if "PKG_CONFIG_PATH" in os.environ:
        pkg_config_path.append(os.environ['PKG_CONFIG_PATH'])
    if "LIB_DIR" in os.environ:
        pkg_config_path.append(os.environ['LIB_DIR'])
        pkg_config_path.append(os.path.join(os.environ['LIB_DIR'], "pkgconfig"))

    options = [
        "--static",
        {
            'I': "--cflags-only-I",
            'L': "--libs-only-L",
            'l': "--libs-only-l"
        }[type_]
    ]

    return [
        flag.strip("-{}".format(type_))
        for flag
        in subprocess.check_output(
            ["pkg-config"] + options + [library],
            env=dict(os.environ, PKG_CONFIG_PATH=":".join(pkg_config_path))
        ).decode("UTF-8").split()
    ]
118877
def get_flag_args(**options):
    """"""
    flags = []
    for key, value in options.items():
        # Build short flags.
        if len(key) == 1:
            flag = f'-{key}'
        # Built long flags.
        else:
            flag = f'--{key}'
        flags = flags + [flag, value]
    return flags
461301
def xincludeProcessFlags(self, flags):
        
        ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
        return ret
1292083
def build_subcommands_parser(parser, module):
    
    mdefs = module.__dict__
    keys = list(mdefs.keys())
    keys.sort()
    subparsers = parser.add_subparsers(help='sub-command help')
    for command in keys:
        if command.startswith('pub_'):
            func = module.__dict__[command]
            parser = subparsers.add_parser(command[4:], help=func.__doc__)
            parser.set_defaults(func=func)
            argspec = inspect.getargspec(func)
            flags = len(argspec.args)
            if argspec.defaults:
                flags = len(argspec.args) - len(argspec.defaults)
            if flags >= 1:
                for arg in argspec.args[:flags - 1]:
                    parser.add_argument(arg)
                parser.add_argument(argspec.args[flags - 1], nargs='*')
            short_opts = set([])
            for idx, arg in enumerate(argspec.args[flags:]):
                arg = arg.replace('_', '-')
                short_opt = arg[0]
                if not (arg.startswith('no') or (short_opt in short_opts)):
                    opts = ['-%s' % short_opt, '--%s' % arg]
                else:
                    opts = ['--%s' % arg]
                short_opts |= set([short_opt])
                if isinstance(argspec.defaults[idx], list):
                    parser.add_argument(*opts, action='append')
                elif isinstance(argspec.defaults[idx], dict):
                    parser.add_argument(*opts, type=json.loads)
                elif argspec.defaults[idx] is False:
                    parser.add_argument(*opts, action='store_true')
                elif argspec.defaults[idx] is not None:
                    parser.add_argument(*opts, default=argspec.defaults[idx])
                else:
                    parser.add_argument(*opts)
1247146
def compile(self, source, options={}):
    
    options = dict(options)
    if "paths" in options:
      options["paths"] += self.paths
    else:
      options["paths"] = self.paths

    if "compress" not in options:
      options["compress"] = self.compress

    return self.context.call("compiler", source, options, self.plugins, self.imports)
625689
def generate(env):
    """"""

    cplusplus.generate(env)

    env['CXX']         = 'CC'
    env['CXXFLAGS']    = SCons.Util.CLVar('-LANG:std')
    env['SHCXX']       = '$CXX'
    env['SHOBJSUFFIX'] = '.o'
    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
84063
def _parse_arguments():
    """"""
    parser = argparse.ArgumentParser(description="CMake AST Dumper")
    parser.add_argument("filename", nargs=1, metavar=("FILE"),
                        help="read FILE")
    return parser.parse_args()
714271
def argv_flag_dec(*argin, **kwargs):
    
    kwargs = kwargs.copy()
    kwargs['default'] = kwargs.get('default', False)
    from utool import util_decor
    @util_decor.ignores_exc_tb(outer_wrapper=False)
    def wrap_argv_flag_dec(func):
        return __argv_flag_dec(func, **kwargs)

    assert len(argin) < 2, 'specify 0 or 1 args'

    if len(argin) == 1 and util_type.is_funclike(argin[0]):
        func = argin[0]
        return wrap_argv_flag_dec(func)
    else:
        return wrap_argv_flag_dec
208321
def set_libs_flags(self, env, arch):
        '''
        '''
        def add_flags(include_flags, link_dirs, link_libs):
            env['CPPFLAGS'] = env.get('CPPFLAGS', '') + include_flags
            env['LDFLAGS'] = env.get('LDFLAGS', '') + link_dirs
            env['LIBS'] = env.get('LIBS', '') + link_libs

        if 'sqlite3' in self.ctx.recipe_build_order:
            info('Activating flags for sqlite3')
            recipe = Recipe.get_recipe('sqlite3', self.ctx)
            add_flags(' -I' + recipe.get_build_dir(arch.arch),
                      ' -L' + recipe.get_lib_dir(arch), ' -lsqlite3')

        if 'libffi' in self.ctx.recipe_build_order:
            info('Activating flags for libffi')
            recipe = Recipe.get_recipe('libffi', self.ctx)
            # In order to force the correct linkage for our libffi library, we
            # set the following variable to point where is our libffi.pc file,
            # because the python build system uses pkg-config to configure it.
            env['PKG_CONFIG_PATH'] = recipe.get_build_dir(arch.arch)
            add_flags(' -I' + ' -I'.join(recipe.get_include_dirs(arch)),
                      ' -L' + join(recipe.get_build_dir(arch.arch), '.libs'),
                      ' -lffi')

        if 'openssl' in self.ctx.recipe_build_order:
            info('Activating flags for openssl')
            recipe = Recipe.get_recipe('openssl', self.ctx)
            add_flags(recipe.include_flags(arch),
                      recipe.link_dirs_flags(arch), recipe.link_libs_flags())
        return env