diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2022-10-23 10:12:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-23 10:12:01 (GMT) |
commit | 023d8a84311257a58b47191d229a58de8733c75b (patch) | |
tree | 1db7d3b6c87588063aa03f39f9476f390eb1de46 | |
parent | d21682397bc4c4ab84ae960c8c9f3129d461fefc (diff) | |
parent | 69fb2ce3085196628b2cf6a18bf20f5f1a1ab6dc (diff) | |
download | Ninja-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
-rwxr-xr-x | configure.py | 9 |
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. |