Skip to content

Commit 4e6252f

Browse files
committed
buildfile: return empty if compiler not found for simplicity
1 parent 9169a40 commit 4e6252f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

private/get_compiler.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
function [comp, shell] = get_compiler(lang)
2-
arguments (Input)
2+
arguments
33
lang (1,1) string {mustBeMember(lang, ["c", "c++", "fortran"])}
44
end
5-
arguments (Output)
6-
comp string {mustBeScalarOrEmpty}
7-
shell string {mustBeScalarOrEmpty}
8-
end
5+
6+
shell = string.empty;
97

108
lang = lower(lang);
119

@@ -33,8 +31,8 @@
3331
comp = co.Details.CompilerExecutable;
3432
% disp(lang + " compiler: " + co.ShortName + " " + co.Name + " " + co.Version + " " + comp)
3533
end
34+
if ~strlength(comp), return, end
3635

37-
shell = string.empty;
3836
if ispc()
3937
if isempty(co)
4038
if any(contains(comp, ["gcc", "g++", "gfortran"]))

0 commit comments

Comments
 (0)