Files
cef/tools/exec_util.py
Nik Pavlov fdd36e8461 Support API versioning in platform-specific headers (see #3836)
- Exclude platform-specific includes (anything in < >) from the
  clang preprocessor by using `!defined(GENERATING_CEF_API_HASH)`
  in CEF header files.
- Define "target platforms" by passing platform- and architecture-
  specific ifdefs to the clang preprocessor. Grep for `defined(OS_`
  to identify headers that require target platform processing, and
  then process for each target as the platform-specific API hash
  contribution.
- Delete the univeral hash which is no longer a useful concept.
2025-02-25 12:36:00 -05:00

38 lines
993 B
Python

# Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file
from __future__ import absolute_import
from subprocess import Popen, PIPE
import sys
def exec_cmd(cmd, path, input_string=None):
""" Execute the specified command and return the result. """
out = ''
err = ''
ret = -1
parts = cmd.split()
if input_string is None:
process = Popen(
parts,
cwd=path,
stdout=PIPE,
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate()
ret = process.returncode
else:
process = Popen(
parts,
cwd=path,
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate(input=input_string)
ret = process.returncode
return {'out': out.decode('utf-8'), 'err': err.decode('utf-8'), 'ret': ret}