Skip to content

Commit f2a790f

Browse files
committed
put mex binary in package dir
1 parent 1df998a commit f2a790f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

buildfile.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
plan.DefaultTasks = "test";
55

6+
pkg_name = "+stdlib";
7+
68
if ~isMATLABReleaseOlderThan("R2023b")
7-
plan("check") = matlab.buildtool.tasks.CodeIssuesTask("+stdlib", IncludeSubfolders=true);
9+
plan("check") = matlab.buildtool.tasks.CodeIssuesTask(pkg_name, IncludeSubfolders=true);
810
end
911

1012
if ~isMATLABReleaseOlderThan("R2024b")
@@ -44,13 +46,11 @@
4446
end
4547

4648
root = plan.RootFolder;
47-
bin = fullfile(root, "bin");
48-
if ~isfolder(bin), mkdir(bin), end
49-
addpath(bin)
49+
bindir = fullfile(root, pkg_name);
5050

5151
plan("clean") = matlab.buildtool.tasks.CleanTask;
5252

53-
plan("mex:is_char_device") = matlab.buildtool.tasks.MexTask("is_char_device.cpp", bin, ...
53+
plan("mex:is_char_device") = matlab.buildtool.tasks.MexTask("is_char_device.cpp", bindir, ...
5454
Options=compiler_opt);
5555

5656
plan("test").Dependencies = "mex";

test/TestMex.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ function test_is_char_device(tc)
88
% /dev/stdin may not be available on CI systems
99

1010
if ispc
11-
b = is_char_device("NUL");
11+
n = "NUL";
1212
else
13-
b = is_char_device("/dev/null");
13+
n = "/dev/null";
1414
end
1515

16-
tc.verifyTrue(b)
16+
tc.verifyTrue(stdlib.is_char_device(n))
1717

1818
end
1919

0 commit comments

Comments
 (0)