are two key things that were necessary:
1. We have to turn off the -fvisibility=hidden flag, since this hides the symbols in our
shared libraries from others. There's probably a better way to handle this, but this
is expedient for now.
2. Since I'm testing with GNU compilers & linkers, I have to use the magic lines in python
before importing the inter-dependent modules (see test_cross_module_inheritance.py):
import sys, ctypes
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
This shouldn't be necessary on all platforms.
28 lines
1.2 KiB
Python
28 lines
1.2 KiB
Python
## -*- python -*-
|
|
|
|
def build(bld):
|
|
|
|
for src, tgt in (("Agen.py", "Amodule.cc"),
|
|
("Bgen.py", "Bmodule.cc")):
|
|
gen = bld.new_task_gen(features="command",
|
|
source=src,
|
|
target=tgt,
|
|
command="${PYTHON} ${SRC[0]} ${TGT[0]}")
|
|
|
|
if bld.env["CXX"]:
|
|
obj = bld.new_task_gen(features="cxx cxxshlib pyext",
|
|
source = "Amodule.cc",
|
|
target = "A",
|
|
install_path = None, # do not install
|
|
includes = ".",
|
|
cxxflags = "-fvisibility=default", # Hack for gcc only -- need to clean up
|
|
)
|
|
|
|
obj = bld.new_task_gen(features="cxx cxxshlib pyext",
|
|
source = "Bmodule.cc",
|
|
target = "B",
|
|
install_path = None, # do not install
|
|
includes = ".",
|
|
cxxflags = "-fvisibility=default", # Hack for gcc only -- need to clean up
|
|
)
|