You've already forked gnatcoll-bindings
mirror of
https://github.com/AdaCore/gnatcoll-bindings.git
synced 2026-02-12 12:59:11 -08:00
New library providing a wrapper of the C++ ISO/IEC 14882:1998(E) string class. Issue: eng/toolchain/gnat#358 TN: Q505-002
55 lines
1.7 KiB
Python
Executable File
55 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python
|
|
import logging
|
|
import os
|
|
import sys
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
from setup_support import SetupApp
|
|
|
|
|
|
class GNATCollCPP(SetupApp):
|
|
name = 'gnatcoll_cpp'
|
|
project = 'gnatcoll_cpp.gpr'
|
|
description = 'GNATColl CPP bindings'
|
|
|
|
def create(self):
|
|
super(GNATCollCPP, self).create()
|
|
self.build_cmd.add_argument(
|
|
'--debug',
|
|
help='build project in debug mode',
|
|
action="store_true",
|
|
default=False)
|
|
|
|
def update_config(self, config, args):
|
|
logging.info('%-26s %s',
|
|
'Libraries kind', ", ".join(config.data['library_types']))
|
|
|
|
# Set library version
|
|
with open(os.path.join(config.source_dir, '..',
|
|
'version_information'), 'r') as fd:
|
|
version = fd.read().strip()
|
|
config.set_data('GNATCOLL_VERSION', version, sub='gprbuild')
|
|
|
|
# Set build mode
|
|
config.set_data('BUILD', 'DEBUG' if args.debug else 'PROD',
|
|
sub='gprbuild')
|
|
logging.info('%-26s %s', 'Build mode',
|
|
config.data['gprbuild']['BUILD'])
|
|
|
|
def variants(self, config, cmd):
|
|
result = []
|
|
for library_type in config.data['library_types']:
|
|
gpr_vars = {'LIBRARY_TYPE': library_type,
|
|
'GPR_BUILD': library_type}
|
|
if cmd == 'install':
|
|
result.append((['--build-name=%s' % library_type,
|
|
'--build-var=LIBRARY_TYPE'],
|
|
gpr_vars))
|
|
else:
|
|
result.append(([], gpr_vars))
|
|
return result
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = GNATCollCPP()
|
|
sys.exit(app.run())
|