summaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorJan Niklas Hasse <jhasse@bixense.com>2022-10-23 10:12:01 (GMT)
committerGitHub <noreply@github.com>2022-10-23 10:12:01 (GMT)
commit023d8a84311257a58b47191d229a58de8733c75b (patch)
tree1db7d3b6c87588063aa03f39f9476f390eb1de46 /configure.py
parentd21682397bc4c4ab84ae960c8c9f3129d461fefc (diff)
parent69fb2ce3085196628b2cf6a18bf20f5f1a1ab6dc (diff)
downloadNinja-023d8a84311257a58b47191d229a58de8733c75b.zip
Ninja-023d8a84311257a58b47191d229a58de8733c75b.tar.gz
Ninja-023d8a84311257a58b47191d229a58de8733c75b.tar.bz2
Merge pull request #2086 from randomascii/compiler_detect
Detect whether VC++ compiler can be found in configure.py
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.py b/configure.py
index 7a5e2d3..09c5b28 100755
--- a/configure.py
+++ b/configure.py
@@ -305,9 +305,18 @@ if platform.is_msvc():
else:
n.variable('ar', configure_env.get('AR', 'ar'))
+def search_system_path(file_name):
+ """Find a file in the system path."""
+ for dir in os.environ['path'].split(';'):
+ path = os.path.join(dir, file_name)
+ if os.path.exists(path):
+ return path
+
# Note that build settings are separately specified in CMakeLists.txt and
# these lists should be kept in sync.
if platform.is_msvc():
+ if not search_system_path('cl.exe'):
+ raise Exception('cl.exe not found. Run again from the Developer Command Prompt for VS')
cflags = ['/showIncludes',
'/nologo', # Don't print startup banner.
'/Zi', # Create pdb with debug info.