mirror of
https://github.com/google/pebble.git
synced 2025-06-02 16:23:11 +00:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
58
src/bluetooth-fw/wscript
Normal file
58
src/bluetooth-fw/wscript
Normal file
|
@ -0,0 +1,58 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
import waflib.Logs
|
||||
|
||||
from waflib.Configure import conf
|
||||
|
||||
|
||||
@conf
|
||||
def uses_dialog_bluetooth(ctx):
|
||||
return 'da14681' in ctx.env.bt_controller
|
||||
|
||||
|
||||
def _recurse(ctx):
|
||||
if ctx.env.bt_controller == 'cc2564x':
|
||||
# TODO: replace with real FW
|
||||
ctx.recurse('stub')
|
||||
elif ctx.uses_dialog_bluetooth():
|
||||
# TODO: replace with real FW
|
||||
ctx.recurse('stub')
|
||||
elif ctx.env.bt_controller == 'qemu':
|
||||
ctx.recurse('qemu')
|
||||
else:
|
||||
ctx.fatal('Invalid bt controller {}'.format(ctx.env.bt_controller))
|
||||
|
||||
|
||||
def options(opt):
|
||||
opt.add_option('--bt_controller', action='store', default=None,
|
||||
help='Override Bluetooth controller to build for',
|
||||
choices=['da14681-01', 'da14681-00', 'cc2564x', 'qemu'])
|
||||
|
||||
|
||||
def configure(conf):
|
||||
prev_variant = conf.variant
|
||||
prev_env = conf.env
|
||||
|
||||
if conf.options.bt_controller:
|
||||
bt = conf.options.bt_controller
|
||||
conf.env.bt_controller = bt
|
||||
else:
|
||||
# If option wasn't specified, assume main wscript has set env.bt_controller.
|
||||
# Act as if the option was set, so recurse'd wscripts can use the option.
|
||||
conf.options.bt_controller = conf.env.bt_controller
|
||||
|
||||
waflib.Logs.pprint('CYAN', 'Using Bluetooth controller: {}'
|
||||
.format(conf.env.bt_controller))
|
||||
_recurse(conf)
|
||||
|
||||
conf.variant = prev_variant
|
||||
conf.env = prev_env
|
||||
|
||||
|
||||
def build(bld):
|
||||
prev_env = bld.env
|
||||
_recurse(bld)
|
||||
bld.env = prev_env
|
||||
|
||||
# vim:filetype=python
|
Loading…
Add table
Add a link
Reference in a new issue