瀏覽代碼

Find the protoc from environ first for python.

liujisi@google.com 13 年之前
父節點
當前提交
e34f1f63b6
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      python/setup.py

+ 3 - 1
python/setup.py

@@ -26,7 +26,9 @@ from distutils.spawn import find_executable
 maintainer_email = "protobuf@googlegroups.com"
 maintainer_email = "protobuf@googlegroups.com"
 
 
 # Find the Protocol Compiler.
 # Find the Protocol Compiler.
-if os.path.exists("../src/protoc"):
+if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']):
+  protoc = os.environ['PROTOC']
+elif os.path.exists("../src/protoc"):
   protoc = "../src/protoc"
   protoc = "../src/protoc"
 elif os.path.exists("../src/protoc.exe"):
 elif os.path.exists("../src/protoc.exe"):
   protoc = "../src/protoc.exe"
   protoc = "../src/protoc.exe"