summaryrefslogtreecommitdiffstats
path: root/methods.py
diff options
context:
space:
mode:
authorAren Villanueva <aren@displaysweet.com>2017-05-19 11:27:17 +1000
committerAren Villanueva <aren@displaysweet.com>2017-05-19 11:27:17 +1000
commit14a982a0c2100a2a406421f017b11340f7a38316 (patch)
tree55ffddbdb0c79cadd1c00068e0e756fd39c0e328 /methods.py
parenta75623f436c215e107ede321afa08a1897552deb (diff)
downloadredot-engine-14a982a0c2100a2a406421f017b11340f7a38316.tar.gz
Detect newer Visual Studio compilers correctly like VS2017.
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/methods.py b/methods.py
index cad87ad775..40f7deedbc 100644
--- a/methods.py
+++ b/methods.py
@@ -1623,6 +1623,33 @@ def detect_visual_c_compiler_version(tools_env):
vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
vc_chosen_compiler_str = "x86_amd64"
+ # Newer versions have a different path available
+ vc_amd64_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX64\\X64;")
+ if(vc_amd64_compiler_detection_index > -1):
+ vc_chosen_compiler_index = vc_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "amd64"
+
+ vc_amd64_x86_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX64\\X86;")
+ if(vc_amd64_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_amd64_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_amd64_x86_compiler_detection_index
+ vc_chosen_compiler_str = "amd64_x86"
+
+ vc_x86_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX86\\X86;")
+ if(vc_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_compiler_detection_index
+ vc_chosen_compiler_str = "x86"
+
+ vc_x86_amd64_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX86\\X64;")
+ if(vc_x86_amd64_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_amd64_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "x86_amd64"
+
# debug help
# print vc_amd64_compiler_detection_index
# print vc_amd64_x86_compiler_detection_index