Fix Windows toolbox compilation 17/16517/2
Vincent COUVERT [Wed, 27 May 2015 14:53:00 +0000 (16:53 +0200)]
Change-Id: If0785b256d01fc46f9240d20f289e3905d1ac97e

scilab/contrib/toolbox_skeleton/builder.sce
scilab/modules/core/macros/isRelease.sci
scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci

index 7c080d9..c96c577 100644 (file)
@@ -7,8 +7,6 @@ mode(-1);
 lines(0);
 
 function main_builder()
-
-    setenv('DEBUG_SCILAB_DYNAMIC_LINK','YES')
     TOOLBOX_NAME  = "toolbox_skeleton";
     TOOLBOX_TITLE = "Toolbox Skeleton";
     toolbox_dir   = get_absolute_file_path("builder.sce");
index c3fb7ee..5b1a896 100644 (file)
@@ -6,5 +6,9 @@
 // =============================================================================
 function ret = isRelease()
     [a,b] = getversion();
-    ret = b(4) == "release";
+    if or(getscilabmode() == ["NWNI", "SCILAB_API"]) then
+        ret = b(4) == "release";
+    else
+        ret = b(5) == "release";
+    end
 endfunction
index 82cb725..6158922 100644 (file)
@@ -66,8 +66,15 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         if ( nt <> 3 ) then
             error(msprintf(gettext("%s: Wrong size for input argument #%d: %d expected.\n"),"ilib_gen_gateway",2,3));
         end
-        [gate,names,cppCompilation] = new_names(table);
+
         global cppCompilation;
+        if isempty(cppCompilation) then
+            cppCompilation = %f;
+        end
+
+        [gate,names,cpp] = new_names(table);
+        cppCompilation = cppCompilation | cpp;
+
         //generate cpp interface file
         if  cppCompilation then
             t = [
@@ -153,9 +160,11 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         "#define " + TNAME + "_GW_IMPEXP";
         "#endif";
         "";
+        "#include <cpp_gateway_prototype.hxx>";
+        "";
         "extern ""C"" " + TNAME + "_GW_IMPEXP int " + tname + "(wchar_t* _pwstFuncName);";
         "";
-        gate(:, 2);
+        unique(gate(:, 2));
         "";
         "#endif /* __" + TNAME + "_GW_HXX__ */"];
 
@@ -182,7 +191,7 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         "";
         "#include ""c_gateway_prototype.h""";
         "";
-        gate(:, 1);
+        unique(gate(:, 1));
         "";
         "#endif /* __" + TNAME + "_GW_H__ */"];