Skip to content

Instantly share code, notes, and snippets.

@fastjack
Created March 17, 2014 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fastjack/9599945 to your computer and use it in GitHub Desktop.
Save fastjack/9599945 to your computer and use it in GitHub Desktop.
Example of adding CFLAGS to pebble project
#
# This file is the default set of rules to compile a Pebble project.
#
# Feel free to customize this to your needs.
#
top = '.'
out = 'build'
def options(ctx):
ctx.load('pebble_sdk')
def configure(ctx):
ctx.load('pebble_sdk')
def build(ctx):
ctx.load('pebble_sdk')
ctx.env.CFLAGS.append('-Wpointer-arith')
ctx.env.CFLAGS.append('-Wformat-nonliteral')
ctx.env.CFLAGS.append('-Winit-self')
ctx.env.CFLAGS.append('-Werror=unused-variable') # override defaults
ctx.env.CFLAGS.append('-Werror=unused-parameter') # override defaults
ctx.env.CFLAGS.append('-Werror=unused-function') # override defaults
ctx.env.CFLAGS.append('-fno-exceptions')
ctx.env.CFLAGS.append('-fvisibility=hidden')
ctx.env.CFLAGS.append('-Wl,-O1')
ctx.env.CFLAGS.append('-Wl,--discard-all')
ctx.env.CFLAGS.append('-Wl,--no-undefined')
ctx.env.CFLAGS.append('-Wl,--build-id=sha1')
ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
target='pebble-app.elf')
ctx.pbl_bundle(elf='pebble-app.elf',
js=ctx.path.ant_glob('src/js/**/*.js'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment