allow user to forced used msvc compiler via SCILAB_PREFERED_MSVC env var
[scilab.git] / scilab / modules / dynamic_link / macros / windows / dlwGenerateCleaner.sci
index 979f7c1..e7562bb 100644 (file)
@@ -8,8 +8,16 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 //=============================================================================
 function dlwGenerateCleaner(fd, makename)
+    val = getenv("SCILAB_PREFERED_MSVC", "");
     make_command = dlwGetMakefileCmdCleaner(makename);
     mfprintf(fd,"if fileinfo(''%s'') <> [] then\n", makename);
+    if val <> "" then
+        mfprintf(fd,"  setenv(""SCILAB_PREFERED_MSVC"", ""%s"");\n", val);
+    end
+    mfprintf(fd,"  if ~ exists(""dynamic_linkwindowslib"") then\n");
+    mfprintf(fd,"    load(""SCI/modules/dynamic_link/macros/windows/lib"")\n");
+    mfprintf(fd,"  end\n");
+    mfprintf(fd,"  dlwConfigureEnv();\n");
     mfprintf(fd,"  unix_s(''%s'');\n", make_command);
     mfprintf(fd,"  mdelete(''%s'');\n", makename);
     mfprintf(fd,"end\n");