# vim: set ts=2 sw=2 tw=99 noet ft=python: import os, sys builder.SetBuildFolder('/') project = builder.LibraryProject('accelerator.ext') project.sources = [ 'extension.cpp', 'MemoryDownloader.cpp', 'forwards.cpp', 'natives.cpp', os.path.join(Accelerator.sm_root, 'public', 'smsdk_ext.cpp') ] def AddSourceFilesFromDir(path, files): list = [] for file in files: list.append(os.path.join(path, file)) return list for cxx in Accelerator.targets: binary = Accelerator.ConfigureExtension(project, cxx, builder) compiler = binary.compiler # Wait for breakpad to be patched compiler.sourcedeps += Accelerator.breakpad_patch # We depend on breakpad on config compiler.sourcedeps += Accelerator.breakpad_config[compiler.target.arch] compiler.defines += ['HAVE_CONFIG_H'] compiler.cxxincludes += [ os.path.join(builder.sourcePath, 'third_party', 'breakpad', 'src'), os.path.join(builder.buildPath, 'third_party', 'config', compiler.target.arch), ] if compiler.target.platform in ['linux']: binary.sources += AddSourceFilesFromDir(os.path.join(builder.currentSourcePath, '..', 'third_party', 'breakpad', 'src', 'common'), [ 'dwarf_cfi_to_module.cc', 'dwarf_cu_to_module.cc', 'dwarf_line_to_module.cc', 'dwarf_range_list_handler.cc', 'language.cc', 'module.cc', 'path_helper.cc', 'stabs_reader.cc', 'stabs_to_module.cc', 'dwarf/bytereader.cc', 'dwarf/dwarf2diehandler.cc', 'dwarf/dwarf2reader.cc', 'dwarf/elf_reader.cc', 'linux/crc32.cc', 'linux/dump_symbols.cc', 'linux/elf_symbols_to_module.cc', 'linux/breakpad_getcontext.S' ]) Accelerator.link_libbreakpad_client(compiler, builder) Accelerator.link_libbreakpad(compiler, builder) Accelerator.link_libdisasm(compiler, builder) Accelerator.extension = builder.Add(project)