@@ -1180,16 +1180,27 @@ do
1180
1180
# MSVC requires cmake because that's how we're going to build LLVM
1181
1181
probe_need CFG_CMAKE cmake
1182
1182
1183
+ # There are three builds of cmake on windows: MSVC, MinGW and Cygwin
1184
+ # The Cygwin build does not have generators for Visual Studio, so
1185
+ # detect that here and error.
1186
+ if ! " $CFG_CMAKE " --help | sed -n ' /^Generators/,$p' | grep ' Visual Studio' > /dev/null
1187
+ then
1188
+ err " cmake does not support Visual Studio generators.\n\n \
1189
+ This is likely due to it being an msys/cygwin build of cmake, \
1190
+ rather than the required windows version, built using MinGW \
1191
+ or Visual Studio."
1192
+ fi
1193
+
1183
1194
# Use the REG program to figure out where VS is installed
1184
1195
# We need to figure out where cl.exe and link.exe are, so we do some
1185
1196
# munging and some probing here. We also look for the default
1186
1197
# INCLUDE and LIB variables for MSVC so we can set those in the
1187
1198
# build system as well.
1188
- install=$( reg QUERY \
1199
+ install=$( cmd //c reg QUERY \
1189
1200
' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
1190
1201
-v InstallDir)
1191
1202
if [ -z " $install " ]; then
1192
- install=$( reg QUERY \
1203
+ install=$( cmd //c reg QUERY \
1193
1204
' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1194
1205
-v InstallDir)
1195
1206
fi
1222
1233
eval CFG_MSVC_LINK_$bits =" \" $bindir /link.exe\" "
1223
1234
1224
1235
vcvarsall=" ${CFG_MSVC_ROOT} /VC/vcvarsall.bat"
1225
- include_path=$( cmd /c " \" $vcvarsall \ " $msvc_part && cmd /c echo % INCLUDE% " )
1236
+ include_path=$( cmd //V:ON // c " $vcvarsall " $msvc_part \& echo ! INCLUDE! )
1226
1237
need_ok " failed to learn about MSVC's INCLUDE"
1227
- lib_path=$( cmd /c " \" $vcvarsall \ " $msvc_part && cmd /c echo % LIB% " )
1238
+ lib_path=$( cmd //V:ON // c " $vcvarsall " $msvc_part \& echo ! LIB! )
1228
1239
need_ok " failed to learn about MSVC's LIB"
1229
1240
1230
1241
eval CFG_MSVC_INCLUDE_PATH_${bits} =" \" $include_path \" "
0 commit comments