mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-25 11:19:52 +01:00
35 lines
637 B
Python
35 lines
637 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',
|
|
)
|
|
bld(
|
|
target = 'app',
|
|
features = 'c cprogram',
|
|
source = 'main.c',
|
|
use='example',
|
|
)
|
|
|