File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,14 @@ macro(PDAL_PYTHON_ADD_TEST _name)
223
223
# endif()
224
224
endmacro (PDAL_PYTHON_ADD_TEST)
225
225
226
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
227
+ # For newer versions of python (3.8+), C extensions don't link against
228
+ # libpython and instead get symbol definitions from the python interpreter
229
+ # executable. PDAL plugins need to link against libpython, but if a plugin
230
+ # is loaded inside a python process, it must resolve symbols from the python
231
+ # executable instead of libpython. Using flat namespace allows that.
232
+ set (PYTHON_LINK_LIBRARY ${PYTHON_LINK_LIBRARY} -Wl,-flat_namespace)
233
+ endif ()
226
234
227
235
PDAL_PYTHON_ADD_PLUGIN(numpy_reader reader numpy
228
236
FILES
Original file line number Diff line number Diff line change
1
+ import unittest
2
+ import json
3
+ import pdal
4
+ import numpy
5
+ import os
6
+
7
+ DATADIRECTORY = "./test/data"
8
+
9
+
10
+ def test_filter (ins , outs ):
11
+ return True
12
+
13
+
14
+ class TestPythonInPython (unittest .TestCase ):
15
+ def test_pipeline_construction (self ):
16
+
17
+ pipeline = [
18
+ os .path .join (DATADIRECTORY , "autzen-utm.las" ),
19
+ {
20
+ "type" : "filters.python" ,
21
+ "script" : __file__ ,
22
+ "function" : "test_filter" ,
23
+ "module" : "anything" ,
24
+ },
25
+ ]
26
+ pdal .Pipeline (json .dumps (pipeline )).execute ()
You can’t perform that action at this time.
0 commit comments