File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed
demos_lazarus/Python_Console Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ implementation
4242{ $R *.lfm}
4343
4444const
45- cPyLibraryWindows = ' python37.dll' ;
46- cPyLibraryLinux = ' libpython3.8.so.1.0' ; // default in Ubuntu 20.x
47- cPyLibraryMac = ' /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib' ;
48- cPyZipWindows = ' python37.zip' ;
45+ cPyLibraryWindows: string = ' python37.dll' ;
46+ cPyLibraryLinux: string = ' libpython3.8.so.1.0' ; // default in Ubuntu 20.x
47+ cPyLibraryMac: string = ' /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib' ;
48+ cPyZipWindows: string = ' python37.zip' ;
4949
5050function Py_s0 (Self, Args : PPyObject): PPyObject; cdecl;
5151begin
@@ -145,5 +145,30 @@ procedure TfmMain.DoPy_InitEngine;
145145 PythonEngine.LoadDll;
146146end ;
147147
148+ { $ifdef darwin}
149+ procedure InitMacLibPath ;
150+ var
151+ N: integer;
152+ S: string;
153+ begin
154+ for N:= 5 to 10 do
155+ begin
156+ S:= Format(' /Library/Frameworks/Python.framework/Versions/3.%d/lib/libpython3.%d.dylib' ,
157+ [N, N]);
158+ if FileExists(S) then
159+ begin
160+ cPyLibraryMac:= S;
161+ exit;
162+ end ;
163+ end ;
164+ end ;
165+ { $endif}
166+
167+ initialization
168+
169+ { $ifdef darwin}
170+ InitMacLibPath;
171+ { $endif}
172+
148173end .
149174
You can’t perform that action at this time.
0 commit comments