File: wrapper.py

package info (click to toggle)
roc-toolkit 0.4.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,684 kB
  • sloc: cpp: 102,987; ansic: 8,959; python: 6,125; sh: 942; makefile: 16; javascript: 9
file content (23 lines) | stat: -rw-r--r-- 647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os

def WrapLauncher(env, tool, launcher):
    return '"{launcher}" "{tool}"'.format(
        launcher=launcher, tool=tool)

def WrapClangDb(env, tool, build_dir):
    if not tool.startswith('"'):
        tool = '"{}"'.format(tool)

    return (
        '{python_cmd} scripts/scons_helpers/clangdb.py '
        '"{root_dir}" "{build_dir}" {tool}'.format(
            python_cmd=env.GetPythonExecutable(),
            root_dir=env.Dir('#').path,
            build_dir=env.Dir(build_dir).path,
            tool=tool
        )
    )

def init(env):
    env.AddMethod(WrapLauncher, 'WrapLauncher')
    env.AddMethod(WrapClangDb, 'WrapClangDb')