Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: tools/telemetry/telemetry/core/build_extension.py

Issue 127453003: Revert of [telemetry] Implement per-pixel algorithms in Bitmap as a C++ extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/bitmaptools/bitmaptools.cc ('k') | tools/telemetry/telemetry/core/tab.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/build_extension.py
diff --git a/tools/telemetry/telemetry/core/build_extension.py b/tools/telemetry/telemetry/core/build_extension.py
deleted file mode 100644
index fd98e1273d84990a8480f9dfb88939371fa27ef3..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/core/build_extension.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-def _FixDistutilsMsvcCompiler():
- # To avoid runtime mismatch, distutils should use the compiler which was used
- # to build python. But our module does not use the runtime much, so it should
- # be fine to build within a different environment.
- # See also: http://bugs.python.org/issue7511
- from distutils import msvc9compiler
- for version in [msvc9compiler.get_build_version(), 9.0, 10.0, 11.0, 12.0]:
- msvc9compiler.VERSION = version
- try:
- msvc9compiler.MSVCCompiler().initialize()
- return
- except Exception:
- pass
- raise Exception('Could not initialize MSVC compiler for distutils.')
-
-
-def BuildExtension(sources, output_dir, extension_name):
- from distutils import log
- from distutils.core import Distribution, Extension
- import os
- import tempfile
-
- if os.name == 'nt':
- _FixDistutilsMsvcCompiler()
-
- build_dir = tempfile.mkdtemp()
- # Source file paths must be relative to current path.
- cwd = os.getcwd()
- src_files = [os.path.relpath(filename, cwd) for filename in sources]
-
- dist = Distribution({
- 'ext_modules': [Extension(extension_name, src_files)]
- })
- dist.script_args = ['build_ext', '--build-temp', build_dir,
- '--build-lib', output_dir]
- dist.parse_command_line()
- log.set_threshold(log.DEBUG)
- dist.run_commands()
- dist.script_args = ['clean', '--build-temp', build_dir, '--all']
- dist.parse_command_line()
- log.set_threshold(log.DEBUG)
- dist.run_commands()
-
-
-if __name__ == '__main__':
- import sys
- assert len(sys.argv) > 3, 'Usage: build.py source-files output-dir ext-name'
- BuildExtension(sys.argv[1:-2], sys.argv[-2], sys.argv[-1])
« no previous file with comments | « tools/telemetry/telemetry/core/bitmaptools/bitmaptools.cc ('k') | tools/telemetry/telemetry/core/tab.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698