mirror of https://gitlab.com/ita1024/waf
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
658 B
Python
36 lines
658 B
Python
#!/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')
|
|
opt.load('file_to_object')
|
|
|
|
def configure(cfg):
|
|
cfg.load('compiler_c')
|
|
cfg.load('file_to_object')
|
|
|
|
def build(bld):
|
|
bld(
|
|
name='example',
|
|
source='main.c',
|
|
features='file_to_object',
|
|
includes_nodes=[],
|
|
)
|
|
bld(
|
|
target = 'app',
|
|
features = 'c cprogram',
|
|
source = 'main.c',
|
|
use='example',
|
|
)
|
|
|