@@ -978,7 +978,7 @@ def factory(cls, vswhere_exe):
978
978
979
979
vswhere_binary = cls (
980
980
vswhere_exe = vswhere_exe ,
981
- vswhere_norm = vswhere_exe ,
981
+ vswhere_norm = vswhere_norm ,
982
982
)
983
983
984
984
cls ._cache_vswhere_paths [vswhere_exe ] = vswhere_binary
@@ -1103,6 +1103,11 @@ def _vswhere_all_executables(cls):
1103
1103
vswhere_exe_list .append (vswhere_binary .vswhere_exe )
1104
1104
return vswhere_exe_list
1105
1105
1106
+ @classmethod
1107
+ def is_frozen (cls ) -> bool :
1108
+ rval = bool (cls .vswhere_frozen_flag )
1109
+ return rval
1110
+
1106
1111
@classmethod
1107
1112
def freeze_vswhere_binary (cls ):
1108
1113
if not cls .vswhere_frozen_flag :
@@ -1141,7 +1146,7 @@ def _vswhere_priority_group(cls, priority):
1141
1146
return group
1142
1147
1143
1148
@classmethod
1144
- def register_vswhere_executable (cls , vswhere_exe , priority = None ) -> bool :
1149
+ def register_vswhere_executable (cls , vswhere_exe , priority = None ):
1145
1150
1146
1151
vswhere_binary = cls .UNDEFINED_VSWHERE_BINARY
1147
1152
@@ -1222,11 +1227,27 @@ def vswhere_freeze_env(cls, env):
1222
1227
return frozen_binary , vswhere_binary
1223
1228
1224
1229
# external use
1225
- vswhere_register_executable = _VSWhereExecutable .register_vswhere_executable
1226
- vswhere_get_executable = _VSWhereExecutable .get_vswhere_executable
1227
- vswhere_freeze_executable = _VSWhereExecutable .freeze_vswhere_executable
1228
1230
1229
- # internal use
1231
+ def vswhere_register_executable (vswhere_exe , priority = None , freeze = False ):
1232
+ debug ('register vswhere_exe=%s, priority=%s, freeze=%s' , repr (vswhere_exe ), repr (priority ), repr (freeze ))
1233
+ _VSWhereExecutable .register_vswhere_executable (vswhere_exe , priority = priority )
1234
+ if freeze :
1235
+ _VSWhereExecutable .freeze_vswhere_executable ()
1236
+ rval = _VSWhereExecutable .get_vswhere_executable ()
1237
+ debug ('current vswhere_exe=%s, is_frozen=%s' , repr (rval ), _VSWhereExecutable .is_frozen ())
1238
+ return vswhere_exe
1239
+
1240
+ def vswhere_get_executable ():
1241
+ debug ('' )
1242
+ vswhere_exe = _VSWhereExecutable .get_vswhere_executable ()
1243
+ return vswhere_exe
1244
+
1245
+ def vswhere_freeze_executable ():
1246
+ debug ('' )
1247
+ vswhere_exe = _VSWhereExecutable .freeze_vswhere_executable ()
1248
+ return vswhere_exe
1249
+
1250
+ # internal use only
1230
1251
vswhere_freeze_env = _VSWhereExecutable .vswhere_freeze_env
1231
1252
1232
1253
def msvc_find_vswhere ():
0 commit comments