aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/gn/build
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/gn/build')
-rw-r--r--llvm/utils/gn/build/BUILD.gn1
-rwxr-xr-xllvm/utils/gn/build/write_vcsrevision.py17
2 files changed, 5 insertions, 13 deletions
diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 9b5254e..f080a4c6 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -179,6 +179,7 @@ config("compiler_defaults") {
"_HAS_EXCEPTIONS=0",
"_UNICODE",
"UNICODE",
+ "CLANG_BUILD_STATIC",
]
cflags += [ "/EHs-c-" ]
cflags_cc += [ "/std:c++17" ]
diff --git a/llvm/utils/gn/build/write_vcsrevision.py b/llvm/utils/gn/build/write_vcsrevision.py
index afd6aae..3a627ee 100755
--- a/llvm/utils/gn/build/write_vcsrevision.py
+++ b/llvm/utils/gn/build/write_vcsrevision.py
@@ -6,22 +6,13 @@ import argparse
import os
import subprocess
import sys
+import shutil
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
LLVM_DIR = os.path.dirname(os.path.dirname(os.path.dirname(THIS_DIR)))
-def which(program):
- # distutils.spawn.which() doesn't find .bat files,
- # https://bugs.python.org/issue2200
- for path in os.environ["PATH"].split(os.pathsep):
- candidate = os.path.join(path, program)
- if os.path.isfile(candidate) and os.access(candidate, os.X_OK):
- return candidate
- return None
-
-
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
@@ -46,11 +37,11 @@ def main():
vcsrevision_contents = ""
if args.write_git_rev:
- git, use_shell = which("git"), False
+ git, use_shell = shutil.which("git"), False
if not git:
- git = which("git.exe")
+ git = shutil.which("git.exe")
if not git:
- git, use_shell = which("git.bat"), True
+ git, use_shell = shutil.which("git.bat"), True
git_dir = (
subprocess.check_output(
[git, "rev-parse", "--git-dir"], cwd=LLVM_DIR, shell=use_shell