Skip to content

Commit bea1d8f

Browse files
committed
linux needs -fPIC
1 parent b90fb87 commit bea1d8f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

buildfile.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
plan.DefaultTasks = "test";
55

6-
if ~isMATLABReleaseOlderThan("R2024a")
6+
if ~isMATLABReleaseOlderThan("R2024b")
77
root = plan.RootFolder;
88
bin = fullfile(root, "bin");
99
if ~isfolder(bin), mkdir(bin), end
@@ -13,8 +13,10 @@
1313

1414
if ispc
1515
compiler_opt = "COMPFLAGS=/EHsc /std:c++17";
16-
else
16+
elseif ismac
1717
compiler_opt = "CXXFLAGS=-std=c++17";
18+
elseif isunix
19+
compiler_opt = "CXXFLAGS=-fPIC -std=c++17";
1820
end
1921

2022
plan("mex:is_char_device") = matlab.buildtool.tasks.MexTask("is_char_device.cpp", bin, ...

0 commit comments

Comments
 (0)