import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.maniccoder.rpmalloc.$(binname)') ]) rpmalloc_lib = generator.lib(module='rpmalloc', libname='rpmalloc', sources=['rpmalloc.c']) rpmalloc_test_lib = generator.lib(module='rpmalloc', libname='rpmalloc-test', sources=['rpmalloc.c'], variables={ 'defines': [ 'ENABLE_ASSERTS=1', 'ENABLE_STATISTICS=1', 'RPMALLOC_FIRST_CLASS_HEAPS=1', 'RPMALLOC_CONFIGURABLE=1' ] }) if not generator.target.is_android() and not generator.target.is_ios(): rpmalloc_so = generator.sharedlib(module='rpmalloc',
import generator dependlibs = ['foundation'] generator = generator.Generator(project = 'obj', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.obj.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] includepaths = [] obj_sources = [ 'obj.c', 'version.c' ] obj_lib = generator.lib(module = 'obj', sources = obj_sources + extrasources) #obj_so = generator.sharedlib(module = 'obj', sources = obj_sources + extrasources) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() linklibs = ['test'] + dependlibs test_cases = [] if toolchain.is_monolithic() or target.is_ios() or target.is_android() or target.is_tizen():
variables = {'defines': ['NDEBUG=1'], 'cflags': ['-fno-builtin-malloc']} def merge_variables(a, b): merged = copy.deepcopy(a) for k, v in b.items(): if k in merged: merged[k] = list(merged[k]) + list(v) else: merged[k] = v return merged includepaths = ['test', 'benchmark'] test_lib = generator.lib(module='test', sources=['thread.c', 'timer.c'], includepaths=includepaths, variables=variables) benchmark_lib = generator.lib(module='benchmark', sources=['main.c'], includepaths=includepaths, variables=variables) #Build one binary per benchmark generator.bin(module='rpmalloc', sources=['benchmark.c', 'rpmalloc.c'], binname='benchmark-rpmalloc', basepath='benchmark', implicit_deps=[benchmark_lib, test_lib], libs=['benchmark', 'test'], includepaths=includepaths, variables=variables)
sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain rpmalloc_lib = generator.lib(module='rpmalloc', libname='rpmalloc', sources=['rpmalloc.c']) rpmallocguard_lib = generator.lib( module='rpmalloc', libname='rpmallocguard', sources=['rpmalloc.c'], variables={ 'defines': ['ENABLE_ASSERTS=1', 'ENABLE_STATISTICS=1', 'ENABLE_GUARDS=1'] }) if not target.is_android() and not target.is_ios(): rpmallocwrap_lib = generator.lib( module='rpmalloc', libname='rpmallocwrap', sources=['rpmalloc.c', 'malloc.c', 'new.cc'],
sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain rpmalloc_lib = generator.lib(module='rpmalloc', libname='rpmalloc', sources=['rpmalloc.c']) if not target.is_android() and not target.is_ios(): rpmalloc_so = generator.sharedlib(module='rpmalloc', libname='rpmalloc', sources=['rpmalloc.c']) if not target.is_windows(): if not target.is_android() and not target.is_ios(): rpmallocwrap_lib = generator.lib( module='rpmalloc', libname='rpmallocwrap', sources=['rpmalloc.c', 'malloc.c', 'new.cc'], variables={'defines': ['ENABLE_PRELOAD=1']})
dependlibs = ['foundation'] generator = generator.Generator(project='window', dependlibs=dependlibs, variables=[ ('bundleidentifier', 'com.rampantpixels.window.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain window_lib = generator.lib(module='window', sources=[ 'event.c', 'version.c', 'window.c', 'window_android.c', 'window_ios.m', 'window_linux.c', 'window_osx.m', 'window_windows.c' ]) includepaths = generator.test_includepaths() gllibs = [] glframeworks = [] if target.is_macos(): glframeworks = ['OpenGL'] elif target.is_ios(): glframeworks = ['QuartzCore', 'OpenGLES'] if target.is_windows(): gllibs = ['gdi32'] if target.is_linux():
import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['task', 'foundation'] generator = generator.Generator(project = 'task', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.task.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain task_lib = generator.lib(module = 'task', sources =[ 'scheduler.c', 'task.c', 'version.c']) #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() linklibs = ['test'] test_cases = [ 'task' ] if toolchain.is_monolithic() or target.is_ios() or target.is_android() or target.is_tizen() or target.is_pnacl(): #Build one fat binary with all test cases test_resources = []
import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['foundation'] generator = generator.Generator(project = 'vector', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.vector.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain vector_lib = generator.lib(module = 'vector', sources = [ 'vector.c', 'version.c']) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] if not configs == []: generator.bin('maskgen', ['main.c'], 'maskgen', basepath = 'tools', implicit_deps = [vector_lib], libs = ['vector', 'foundation'], configs = configs) #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() test_cases = [ 'matrix', 'quaternion', 'vector' ]
generator = generator.Generator(project='input', dependlibs=dependlibs, variables=[('bundleidentifier', 'com.maniccoder.input.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] input_sources = [ 'event.c', 'input.c', 'input_android.c', 'input_ios.c', 'input_linux.c', 'input_macos.c', 'input_windows.c', 'version.c' ] input_lib = generator.lib(module='input', sources=input_sources + extrasources) #if not target.is_ios() and not target.is_android() and not target.is_tizen(): # configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] # if not configs == []: # generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() test_cases = ['basic'] if toolchain.is_monolithic() or target.is_ios() or target.is_android( ) or target.is_tizen():
#!/usr/bin/env python """Ninja build configurator for rpmalloc library""" import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project = 'rpmalloc', variables = [('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain rpmalloc_lib = generator.lib(module = 'rpmalloc', sources = ['rpmalloc.c', 'malloc.c', 'new.cc']) if not target.is_windows(): rpmalloc_so = generator.sharedlib(module = 'rpmalloc', sources = ['rpmalloc.c', 'malloc.c', 'new.cc'], variables = {'runtime': 'c++'})
sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['resource', 'vector', 'window', 'network', 'foundation'] generator = generator.Generator(project = 'render', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.render.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain render_lib = generator.lib(module = 'render', sources = [ 'backend.c', 'buffer.c', 'command.c', 'context.c', 'compile.c', 'drawable.c', 'event.c', 'indexbuffer.c', 'import.c', 'parameter.c', 'program.c', 'render.c', 'shader.c', 'state.c', 'sort.c', 'target.c', 'version.c', 'vertexbuffer.c', os.path.join('gl4', 'backend.c'), os.path.join('gl4', 'backend.m'), os.path.join('gl4', 'glprocs.c'), os.path.join('gl2', 'backend.c'), os.path.join('gles2', 'backend.c'), os.path.join('null', 'backend.c') ]) gllibs = [] glframeworks = [] if target.is_macos(): glframeworks = ['OpenGL'] elif target.is_ios(): glframeworks = ['QuartzCore', 'OpenGLES'] if target.is_windows(): gllibs = ['opengl32', 'gdi32'] if target.is_linux(): gllibs = ['GL', 'Xxf86vm', 'Xext', 'X11']
import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain rpmalloc_lib = generator.lib(module='rpmalloc', sources=['rpmalloc.c']) includepaths = ['test', 'benchmark'] test_lib = generator.lib(module='test', sources=['thread.c', 'timer.c'], includepaths=includepaths) benchmark_lib = generator.lib(module='benchmark', sources=['main.c'], includepaths=includepaths) #Build one binary per benchmark generator.bin(module='rpmalloc', sources=['benchmark.c'], binname='benchmark-rpmalloc', basepath='benchmark', implicit_deps=[benchmark_lib, test_lib, rpmalloc_lib],
dependlibs = ['memory', 'foundation'] generator = generator.Generator(project='memory', dependlibs=dependlibs, variables=[('bundleidentifier', 'com.maniccoder.memory.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] memory_sources = ['memory.c', 'rpmalloc.c', 'version.c'] memory_lib = generator.lib(module='memory', sources=memory_sources + extrasources) #if not target.is_ios() and not target.is_android() and not target.is_tizen(): # configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] # if not configs == []: # generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() test_cases = ['alloc'] if toolchain.is_monolithic() or target.is_ios() or target.is_android( ) or target.is_tizen():
import generator dependlibs = ['mesh', 'vector', 'foundation'] generator = generator.Generator(project = 'gltf', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.maniccoder.gltf.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] includepaths = [] gltf_sources = [ 'accessor.c', 'buffer.c', 'extension.c', 'gltf.c', 'image.c', 'material.c', 'mesh.c', 'node.c', 'scene.c', 'stream.c', 'texture.c', 'version.c' ] gltf_lib = generator.lib(module = 'gltf', sources = gltf_sources + extrasources) #gltf_so = generator.sharedlib(module = 'gltf', sources = gltf_sources + extrasources) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() linklibs = ['test'] + dependlibs test_cases = [] if toolchain.is_monolithic() or target.is_ios() or target.is_android() or target.is_tizen():
dependlibs = ['lua', 'render', 'window', 'resource', 'network', 'foundation'] extralibs = [] extravariables = {} generator = generator.Generator(project = 'lua', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.lua.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain if target.is_windows(): extralibs += ['gdi32', 'ws2_32', 'iphlpapi'] if target.is_linux(): extralibs += ['X11', 'Xext', 'GL'] lua_lib = generator.lib(module = 'lua', sources = [ 'bind.c', 'call.c', 'compile.c', 'eval.c', 'event.c', 'foundation.c', 'import.c', 'lua.c', 'module.c', 'network.c', 'read.c', 'resource.c', 'symbol.c', 'version.c', 'window.c']) if not target.is_ios() and not target.is_android(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] if not configs == []: generator.bin('lua', ['main.c'], 'lua', basepath = 'tools', implicit_deps = [lua_lib], dependlibs = dependlibs, libs = ['luajit'] + extralibs, configs = configs, variables = extravariables) generator.bin('luadump', ['main.c'], 'luadump', basepath = 'tools', implicit_deps = [lua_lib], dependlibs = dependlibs, libs = ['luajit'] + extralibs, configs = configs, variables = extravariables) generator.bin('luaimport', ['main.c'], 'luaimport', basepath = 'tools', implicit_deps = [lua_lib], dependlibs = dependlibs, libs = ['luajit'] + extralibs, configs = configs, variables = extravariables) generator.bin('luacompile', ['main.c'], 'luacompile', basepath = 'tools', implicit_deps = [lua_lib], dependlibs = dependlibs, libs = ['luajit'] + extralibs, configs = configs, variables = extravariables) generator.bin('', ['luacompile/main.c'], 'luacompile32', basepath = 'tools', implicit_deps = [lua_lib], dependlibs = dependlibs, libs = ['luajit32'] + extralibs, configs = configs, variables = dict({'support_lua': True}, **extravariables)) #No test cases if we're a submodule if generator.is_subninja(): sys.exit()
import sys import os sys.path.insert( 0, os.path.join( 'build', 'ninja' ) ) import generator dependlibs = [ 'foundation' ] generator = generator.Generator( project = 'network', dependlibs = dependlibs, variables = [ ( 'bundleidentifier', 'com.rampantpixels.network.$(binname)' ) ] ) target = generator.target writer = generator.writer toolchain = generator.toolchain network_lib = generator.lib( module = 'network', sources = [ 'address.c', 'network.c', 'poll.c', 'socket.c', 'stream.c', 'tcp.c', 'udp.c', 'version.c' ] ) includepaths = generator.test_includepaths() extralibs = [] if target.is_windows(): extralibs += [ 'iphlpapi', 'ws2_32' ] #if not target.is_ios() and not target.is_android(): # configs = [ config for config in toolchain.configs if config not in [ 'profile', 'deploy' ] ] # if not configs == []: # generator.bin( 'blast', [ 'main.c', 'client.c', 'reader.c', 'server.c', 'writer.c' ], 'blast', basepath = 'tools', implicit_deps = [ network_lib ], libs = [ 'network', 'foundation' ] + extralibs, configs = configs ) test_cases = [ 'address', 'socket', 'tcp', 'udp' ]
sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['foundation'] generator = generator.Generator(project = 'memory', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.foundation.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] memory_sources = ['memory.c', 'version.c'] memory_lib = generator.lib(module = 'memory', sources = memory_sources + extrasources) #if not target.is_ios() and not target.is_android() and not target.is_tizen(): # configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] # if not configs == []: # generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) includepaths = generator.test_includepaths() test_cases = ['alloc'] if toolchain.is_monolithic() or target.is_ios() or target.is_android() or target.is_tizen() or target.is_pnacl(): #Build one fat binary with all test cases test_resources = [] test_extrasources = [] test_cases += ['all'] if target.is_ios():
#!/usr/bin/env python """Ninja build configurator for rpmalloc library""" import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain rpmalloc_lib = generator.lib(module='rpmalloc', sources=['rpmalloc.c'])
if target.is_android(): extrasources += [ os.path.join(toolchain.android_ndkpath, 'sources', 'android', 'native_app_glue', 'android_native_app_glue.c'), os.path.join(toolchain.android_ndkpath, 'sources', 'android', 'cpufeatures', 'cpu-features.c') ] foundation_lib = generator.lib( module='foundation', sources=[ 'android.c', 'array.c', 'assert.c', 'assetstream.c', 'atomic.c', 'base64.c', 'beacon.c', 'bitbuffer.c', 'blowfish.c', 'bufferstream.c', 'config.c', 'crash.c', 'environment.c', 'error.c', 'event.c', 'foundation.c', 'fs.c', 'hash.c', 'hashmap.c', 'hashtable.c', 'library.c', 'log.c', 'main.c', 'md5.c', 'memory.c', 'mutex.c', 'objectmap.c', 'path.c', 'pipe.c', 'pnacl.c', 'process.c', 'profile.c', 'radixsort.c', 'random.c', 'regex.c', 'ringbuffer.c', 'semaphore.c', 'stacktrace.c', 'stream.c', 'string.c', 'system.c', 'thread.c', 'time.c', 'tizen.c', 'uuid.c', 'version.c', 'delegate.m', 'environment.m', 'fs.m', 'system.m' ] + extrasources) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [ config for config in toolchain.configs if config not in ['profile', 'deploy'] ] if not configs == []: generator.bin('bin2hex', ['main.c'], 'bin2hex',
dependlibs = ['image', 'foundation'] generator = generator.Generator(project='image', dependlibs=dependlibs, variables=[('bundleidentifier', 'com.maniccoder.image.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] image_sources = ['freeimage.c', 'image.c', 'version.c'] image_lib = generator.lib(module='image', sources=image_sources + extrasources) #if not target.is_ios() and not target.is_android() and not target.is_tizen(): # configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] # if not configs == []: # generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() test_cases = [] if toolchain.is_monolithic() or target.is_ios() or target.is_android( ) or target.is_tizen():
dependlibs = ['foundation'] generator = generator.Generator(project='mesh', dependlibs=dependlibs, variables=[('bundleidentifier', 'com.maniccoder.mesh.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] includepaths = [] mesh_sources = ['mesh.c', 'version.c'] mesh_lib = generator.lib(module='mesh', sources=mesh_sources + extrasources) #mesh_so = generator.sharedlib(module = 'mesh', sources = mesh_sources + extrasources) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [ config for config in toolchain.configs if config not in ['profile', 'deploy'] ] #No test cases if we're a submodule if generator.is_subninja(): sys.exit() includepaths = generator.test_includepaths() linklibs = ['test'] + dependlibs
generator = generator.Generator(project = 'foundation', variables = [('bundleidentifier', 'com.rampantpixels.foundation.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] foundation_sources = [ 'android.c', 'array.c', 'assert.c', 'assetstream.c', 'atomic.c', 'base64.c', 'beacon.c', 'bitbuffer.c', 'blowfish.c', 'bufferstream.c', 'environment.c', 'error.c', 'event.c', 'exception.c', 'foundation.c', 'fs.c', 'hash.c', 'hashmap.c', 'hashtable.c', 'json.c', 'library.c', 'log.c', 'main.c', 'md5.c', 'memory.c', 'mutex.c', 'objectmap.c', 'path.c', 'pipe.c', 'pnacl.c', 'process.c', 'profile.c', 'radixsort.c', 'random.c', 'regex.c', 'ringbuffer.c', 'sha.c', 'semaphore.c', 'stacktrace.c', 'stream.c', 'string.c', 'system.c', 'thread.c', 'time.c', 'tizen.c', 'uuid.c', 'version.c', 'delegate.m', 'environment.m', 'fs.m', 'system.m' ] foundation_lib = generator.lib(module = 'foundation', sources = foundation_sources + extrasources) #foundation_so = generator.sharedlib( module = 'foundation', sources = foundation_sources + extrasources ) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] if not configs == []: generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) generator.bin('hashify', ['main.c'], 'hashify', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) generator.bin('uuidgen', ['main.c'], 'uuidgen', basepath = 'tools', implicit_deps = [foundation_lib], libs = ['foundation'], configs = configs) includepaths = ['test'] test_lib = generator.lib(module = 'test', basepath = 'test', sources = ['test.c', 'test.m'], includepaths = includepaths) test_cases = [ 'app', 'array', 'atomic', 'base64', 'beacon', 'bitbuffer', 'blowfish', 'bufferstream', 'environment', 'error', 'event', 'exception', 'fs', 'hash', 'hashmap', 'hashtable', 'json', 'library', 'math', 'md5', 'mutex', 'objectmap',
toolchain = generator.toolchain extrasources = [] foundation_sources = [ 'android.c', 'array.c', 'assert.c', 'assetstream.c', 'atomic.c', 'base64.c', 'beacon.c', 'bitbuffer.c', 'blowfish.c', 'bufferstream.c', 'environment.c', 'error.c', 'event.c', 'exception.c', 'foundation.c', 'fs.c', 'hash.c', 'hashmap.c', 'hashtable.c', 'json.c', 'library.c', 'log.c', 'main.c', 'md5.c', 'memory.c', 'mutex.c', 'objectmap.c', 'path.c', 'pipe.c', 'pnacl.c', 'process.c', 'profile.c', 'radixsort.c', 'random.c', 'regex.c', 'ringbuffer.c', 'sha.c', 'semaphore.c', 'stacktrace.c', 'stream.c', 'string.c', 'system.c', 'thread.c', 'time.c', 'tizen.c', 'uuid.c', 'version.c', 'delegate.m', 'environment.m', 'fs.m', 'system.m' ] foundation_lib = generator.lib(module='foundation', sources=foundation_sources + extrasources) #foundation_so = generator.sharedlib( module = 'foundation', sources = foundation_sources + extrasources ) if not target.is_ios() and not target.is_android() and not target.is_tizen(): configs = [ config for config in toolchain.configs if config not in ['profile', 'deploy'] ] if not configs == []: generator.bin('bin2hex', ['main.c'], 'bin2hex', basepath='tools', implicit_deps=[foundation_lib], libs=['foundation'], configs=configs) generator.bin('hashify', ['main.c'],
import generator generator = generator.Generator( project = 'foundation', variables = [ ( 'bundleidentifier', 'com.rampantpixels.foundation.$(binname)' ) ] ) target = generator.target writer = generator.writer toolchain = generator.toolchain extrasources = [] if target.is_android(): extrasources += [ os.path.join( toolchain.android_ndkpath, 'sources', 'android', 'native_app_glue', 'android_native_app_glue.c' ), os.path.join( toolchain.android_ndkpath, 'sources', 'android', 'cpufeatures', 'cpu-features.c' ) ] foundation_lib = generator.lib( module = 'foundation', sources = [ 'android.c', 'array.c', 'assert.c', 'assetstream.c', 'atomic.c', 'base64.c', 'bitbuffer.c', 'blowfish.c', 'bufferstream.c', 'config.c', 'crash.c', 'environment.c', 'error.c', 'event.c', 'foundation.c', 'fs.c', 'hash.c', 'hashmap.c', 'hashtable.c', 'library.c', 'log.c', 'main.c', 'md5.c', 'memory.c', 'mutex.c', 'objectmap.c', 'path.c', 'pipe.c', 'pnacl.c', 'process.c', 'profile.c', 'radixsort.c', 'random.c', 'regex.c', 'ringbuffer.c', 'semaphore.c', 'stacktrace.c', 'stream.c', 'string.c', 'system.c', 'thread.c', 'time.c', 'uuid.c', 'version.c', 'delegate.m', 'environment.m', 'fs.m', 'system.m' ] + extrasources ) if not target.is_ios() and not target.is_android(): configs = [ config for config in toolchain.configs if config not in [ 'profile', 'deploy' ] ] if not configs == []: generator.bin( 'bin2hex', [ 'main.c' ], 'bin2hex', basepath = 'tools', implicit_deps = [ foundation_lib ], libs = [ 'foundation' ], configs = configs ) generator.bin( 'hashify', [ 'main.c' ], 'hashify', basepath = 'tools', implicit_deps = [ foundation_lib ], libs = [ 'foundation' ], configs = configs ) generator.bin( 'uuidgen', [ 'main.c' ], 'uuidgen', basepath = 'tools', implicit_deps = [ foundation_lib ], libs = [ 'foundation' ], configs = configs ) includepaths = [ 'test' ] test_lib = generator.lib( module = 'test', basepath = 'test', sources = [ 'test.c', 'test.m' ], includepaths = includepaths ) test_cases = [
import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['resource', 'foundation'] generator = generator.Generator(project = 'lua', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.lua.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain lua_lib = generator.lib(module = 'lua', sources = [ 'bind.c', 'compile.c', 'foundation.c', 'import.c', 'lua.c', 'module.c', 'read.c', 'symbol.c', 'version.c']) if not target.is_ios() and not target.is_android(): configs = [config for config in toolchain.configs if config not in ['profile', 'deploy']] if not configs == []: generator.bin('lua', ['main.c'], 'lua', basepath = 'tools', implicit_deps = [lua_lib], libs = ['lua', 'luajit'] + dependlibs, configs = configs) generator.bin('luadump', ['main.c'], 'luadump', basepath = 'tools', implicit_deps = [lua_lib], libs = ['lua', 'luajit'] + dependlibs, configs = configs) generator.bin('luaimport', ['main.c'], 'luaimport', basepath = 'tools', implicit_deps = [lua_lib], libs = ['lua', 'luajit'] + dependlibs, configs = configs) generator.bin('luacompile', ['main.c'], 'luacompile', basepath = 'tools', implicit_deps = [lua_lib], libs = ['lua', 'luajit'] + dependlibs, configs = configs) includepaths = generator.test_includepaths() test_cases = [ 'bind', 'foundation' ] if target.is_ios() or target.is_android():
import sys import os sys.path.insert(0, os.path.join('build', 'ninja')) import generator dependlibs = ['foundation'] generator = generator.Generator(project = 'window', dependlibs = dependlibs, variables = [('bundleidentifier', 'com.rampantpixels.window.$(binname)')]) target = generator.target writer = generator.writer toolchain = generator.toolchain window_lib = generator.lib(module = 'window', sources = [ 'event.c', 'version.c', 'window.c', 'window_android.c', 'window_ios.m', 'window_linux.c', 'window_osx.m', 'window_windows.c']) includepaths = generator.test_includepaths() gllibs = [] glframeworks = [] if target.is_macosx(): glframeworks = ['OpenGL'] elif target.is_ios(): glframeworks = ['QuartzCore', 'OpenGLES'] if target.is_windows(): gllibs = ['gdi32'] if target.is_linux(): gllibs = ['GL', 'X11'] test_cases = [
sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project='rpmalloc', variables=[ ('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain includepaths = ['test', 'benchmark'] test_lib = generator.lib(module='test', sources=['thread.c', 'timer.c'], includepaths=includepaths) benchmark_lib = generator.lib(module='benchmark', sources=['main.c'], includepaths=includepaths) #Build one binary per benchmark generator.bin(module='rpmalloc', sources=['benchmark.c', 'rpmalloc.c'], binname='benchmark-rpmalloc-unlimit', basepath='benchmark', implicit_deps=[benchmark_lib, test_lib], libs=['benchmark', 'test'], includepaths=includepaths, variables={'defines': ['ENABLE_UNLIMITED_CACHE=1']}) generator.bin(module='rpmalloc',
dependlibs = ['network', 'foundation'] generator = generator.Generator(project='mdns', dependlibs=dependlibs, variables=[ ('bundleidentifier', 'com.rampantpixels.mdns.$(binname)') ]) target = generator.target writer = generator.writer toolchain = generator.toolchain mdns_lib = generator.lib(module='mdns', sources=[ 'discovery.c', 'mdns.c', 'query.c', 'record.c', 'response.c', 'service.c', 'socket.c', 'string.c', 'version.c' ]) #if not target.is_ios() and not target.is_android(): # configs = [ config for config in toolchain.configs if config not in [ 'profile', 'deploy' ] ] # if not configs == []: # generator.bin( 'blast', [ 'main.c', 'client.c', 'server.c' ], 'blast', basepath = 'tools', implicit_deps = [ mdns_lib ], libs = [ 'network' ], configs = configs ) includepaths = generator.test_includepaths() test_cases = ['dnsds'] if target.is_ios() or target.is_android() or target.is_pnacl(): #Build one fat binary with all test cases test_resources = [] test_extrasources = []