Skip to content

Instantly share code, notes, and snippets.

@tcr
Created February 10, 2014 05:26
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 tcr/8910788 to your computer and use it in GitHub Desktop.
Save tcr/8910788 to your computer and use it in GitHub Desktop.
Creating distributable, flattened static libraries for distribution with gyp
#!/bin/bash
set -e
cd out/ARM
node -e "console.log('CREATE ' + process.argv[1]); console.log('ADDLIB', 'obj/lib' + process.argv.slice(2).join('.a\nADDLIB obj/lib') + '.a'); console.log('SAVE\nEND')" $@
node -e "console.log('CREATE ' + process.argv[1]); console.log('ADDLIB', 'obj/lib' + process.argv.slice(2).join('.a\nADDLIB obj/lib') + '.a'); console.log('SAVE\nEND')" $@ | arm-none-eabi-ar -M
{
"targets": [
{
'target_name': 'flatlib',
'type': 'none',
'actions': [
{
'action_name': 'flatten',
'inputs': [ 'myfile.gyp' ],
'outputs': [ '<(PRODUCT_DIR)/lib<(_target_name).a' ],
'action': [ 'tools/dist_static_lib.sh', 'lib<(_target_name).a', '<@(_dependencies)' ],
}
],
'dependencies': [
# what i have to include
"something",
"fatfs",
"axtls",
"tm-ssl",
"tm-tar",
"http_parser",
"hsregex",
"yajl",
# what i want to include
"some-combined-target",
"with-its-deps",
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment