Added command line tool and removed lib folder from gitignore.
This commit is contained in:
18
util/python_module/sppcmd/ccjson.py
Normal file
18
util/python_module/sppcmd/ccjson.py
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import argparse
|
||||
from .common import exec_spp, get_config_cache, require_project_file
|
||||
|
||||
def _cmd(args: argparse.Namespace) -> None:
|
||||
require_project_file()
|
||||
|
||||
build_type = args.build_type
|
||||
if build_type == 'auto':
|
||||
cache = get_config_cache()
|
||||
build_type = cache.get('build_type', 'debug')
|
||||
|
||||
exec_spp((f'--build_type={build_type}', '--unity=disable', 'compile_commands.json'))
|
||||
|
||||
def make_ccjson_parser(subparsers) -> None:
|
||||
parser : argparse.ArgumentParser = subparsers.add_parser('ccjson', help='Generate compile_commands.json')
|
||||
parser.set_defaults(handler=_cmd)
|
||||
parser.add_argument('--build_type', choices=('auto', 'debug', 'release_debug', 'release', 'profile'), default='auto')
|
||||
Reference in New Issue
Block a user