Ejemplo n.º 1
0
def CmakeLauncherFlags():
  flags = []
  if UsingGoma():
    compiler_launcher = os.path.join(GomaDir(), 'gomacc')
  else:
    try:
      compiler_launcher = proc.Which('ccache', WORK_DIR)
      flags.extend(['-DCMAKE_%s_FLAGS=-Qunused-arguments' %
                    c for c in ['C', 'CXX']])
    except:
      compiler_launcher = None

  if compiler_launcher:
    flags.extend(['-DCMAKE_%s_COMPILER_LAUNCHER=%s' %
                  (c, compiler_launcher) for c in ['C', 'CXX']])
  return flags
Ejemplo n.º 2
0
def CMakeLauncherFlags():
    flags = []
    if UsingGoma():
        compiler_launcher = os.path.join(GomaDir(), 'gomacc')
    else:
        try:
            compiler_launcher = proc.Which('ccache')
        except:  # noqa
            return flags

        if ShouldForceHostClang():
            # This flag is only present in clang.
            flags.extend([
                '-DCMAKE_%s_FLAGS=-Qunused-arguments' % c
                for c in ['C', 'CXX']
            ])

    flags.extend([
        '-DCMAKE_%s_COMPILER_LAUNCHER=%s' % (c, compiler_launcher)
        for c in ['C', 'CXX']
    ])
    return flags