fix trouble with debug/release detection on Windows dynamic_link
[scilab.git] / scilab / modules / dynamic_link / macros / windows / dlwCompile.sci
index e27b048..054ea95 100644 (file)
@@ -60,11 +60,14 @@ function filename = writeBatchFile(cmd)
 
     //update DEBUG_SCILAB_DYNAMIC_LINK to match with Scilab compilation mode
     val = getenv("DEBUG_SCILAB_DYNAMIC_LINK","");
-    debugVal = "NO";
-    if val <> "YES" & val <> "NO" & isDebug() then
-        debugVal = "YES";
+    if val <> "NO" & val <> "YES" then
+        if isDebug() then
+            val = "YES";
+        else
+            val = "NO";
+        end
     end
-
+    
     if win64() then
         if dlwIsExpress() then
             arch = "x86_amd64";
@@ -79,7 +82,7 @@ function filename = writeBatchFile(cmd)
 
     scibuild = [ ...
     "@call """ + path + "\VC\vcvarsall.bat"" " + arch;
-    "set DEBUG_SCILAB_DYNAMIC_LINK=" + debugVal;
+    "set DEBUG_SCILAB_DYNAMIC_LINK=" + val;
     cmd
     ];