waf/playground/embedded_resources/wscript

35 lines
637 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
#Demo on embedding resources in executables
"""
We embed the main.c source code in a section of the program.
See http://gareus.org/wiki/embedding_resources_in_executables
TODO: support for more toolchains
"""
from waflib import Task
from waflib.TaskGen import feature, before_method
def options(opt):
opt.load('compiler_c')
2014-09-01 04:37:07 +02:00
opt.load('file_to_object')
def configure(cfg):
cfg.load('compiler_c')
2014-09-01 04:37:07 +02:00
cfg.load('file_to_object')
def build(bld):
bld(
name='example',
source='main.c',
2014-09-01 04:37:07 +02:00
features='file_to_object',
)
bld(
target = 'app',
features = 'c cprogram',
source = 'main.c',
use='example',
2014-09-01 04:37:07 +02:00
)