6868 Tag= " python" , ...
6969 SourceFiles= pkg_root , RunOnlyImpactedTests= true ,...
7070 TestResults= " TestResults_python.xml" , Strict= true );
71-
71+
7272 addons = matlab .addons .installedAddons ;
7373 if contains(addons .Name , " Matlab Test" )
7474 plan(" coverage" ) = matlab .buildtool .tasks .TestTask(test_root , ...
@@ -189,6 +189,13 @@ function build_exe(context)
189189
190190
191191function [comp , shell ] = get_compiler(lang )
192+ arguments (Input )
193+ lang (1 ,1 ) string {mustBeMember(lang , [" c" , " c++" , " fortran" ])}
194+ end
195+ arguments (Output )
196+ comp (1 ,1 ) string
197+ shell (1 ,1 ) string
198+ end
192199
193200lang = lower(lang );
194201
@@ -211,14 +218,13 @@ function build_exe(context)
211218 if isempty(comp )
212219 disp(" set CC environment variable to the C compiler path, or do 'mex -setup c'" )
213220 end
214- otherwise , error(" language not known " + lang )
215221 end
216222else
217223 comp = co .Details .CompilerExecutable ;
218224 % disp(lang + " compiler: " + co.ShortName + " " + co.Name + " " + co.Version + " " + comp)
219225end
220226
221- shell = string . empty ;
227+ shell = " " ;
222228if ispc()
223229 if isempty(co )
224230 if any(contains(comp , [" gcc" , " g++" , " gfortran" ]))
@@ -238,6 +244,14 @@ function build_exe(context)
238244
239245
240246function [comp , shell , outFlag ] = get_build_cmd(lang )
247+ arguments (Input )
248+ lang (1 ,1 ) string {mustBeMember(lang , [" c" , " c++" , " fortran" ])}
249+ end
250+ arguments (Output )
251+ comp (1 ,1 ) string
252+ shell (1 ,1 ) string
253+ outFlag (1 ,1 ) string
254+ end
241255
242256[comp , shell ] = get_compiler(lang );
243257
@@ -251,9 +265,12 @@ function build_exe(context)
251265
252266
253267function srcs = get_mex_sources(build_all )
254- arguments
268+ arguments ( Input )
255269 build_all (1 ,1 ) logical = false
256270end
271+ arguments (Output )
272+ srcs cell
273+ end
257274
258275srcs = {
259276" src/remove.cpp" , ...
@@ -272,6 +289,10 @@ function build_exe(context)
272289
273290
274291function [compiler_opt , linker_opt ] = get_compiler_options()
292+ arguments (Output )
293+ compiler_opt (1 ,1 ) string
294+ linker_opt (1 ,1 ) string
295+ end
275296
276297cxx = mex .getCompilerConfigurations(' c++' );
277298flags = cxx .Details .CompilerFlags ;
@@ -318,6 +339,9 @@ function build_exe(context)
318339
319340
320341function comp = get_fortran_compiler()
342+ arguments (Output )
343+ comp (1 ,1 ) string
344+ end
321345
322346disp(" set FC environment variable to the Fortran compiler path, or do 'mex -setup fortran'" )
323347
@@ -338,6 +362,7 @@ function build_exe(context)
338362 p = ' ' ;
339363end
340364
365+ comp = " " ;
341366for fc = [" flang" , " gfortran" , " ifx" ]
342367 comp = stdlib .which(fc , p );
343368 if ~isempty(comp )
0 commit comments