36 lines
1.5 KiB
Python
36 lines
1.5 KiB
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
import os
|
||
|
|
||
|
Import('envalos2procF')
|
||
|
package = envalos2procF['PACKAGE'] # 'library'
|
||
|
project = envalos2procF['PROJECT'] # 'isceLib'
|
||
|
build = envalos2procF['PRJ_LIB_DIR']
|
||
|
|
||
|
envalos2procF['CMAKE_CXX_STANDARD'] = '11'
|
||
|
|
||
|
install_main = os.path.join(envalos2procF['PRJ_SCONS_INSTALL'], package, project)
|
||
|
install_src = os.path.join(install_main, 'src') # location of the built object files
|
||
|
install_pyx = os.path.join(install_main, 'pyx') # location of the Cythonizing outputs
|
||
|
|
||
|
envalos2procF.Append(CXXFLAGS=['-fopenmp', '-O3'])
|
||
|
|
||
|
pyx_files=['alos2proc_f.pyx']
|
||
|
|
||
|
a = envalos2procF.Command(os.path.join(install_pyx,'alos2proc_f.cc'), 'alos2proc_f.pyx', 'cython3 $SOURCE -o $TARGET --cplus') # Cythonize the alos2proc_f.pyx file to the install dir
|
||
|
b = envalos2procF.SharedObject(target=os.path.join(install_pyx,'alos2proc_f.o'), source=os.path.join(install_pyx,'alos2proc_f.cc')) # Build the Cythonized alos2proc_f.pyx
|
||
|
|
||
|
objs_with_paths = []
|
||
|
objs_with_paths.append(os.path.join(install_pyx,'alos2proc_f.o')) # Add newly-Cythonized alos2proc_f.pyx object
|
||
|
|
||
|
libList = ['libalos2proc_f']
|
||
|
envalos2procF.PrependUnique(LIBS = libList)
|
||
|
|
||
|
# Build Python module from shared objects
|
||
|
c = envalos2procF.LoadableModule(target=os.path.join(install_main,'alos2proc_f.abi3.so'), source=objs_with_paths)
|
||
|
|
||
|
# Use Depends() command to make sure that changing the .pyx files rebuilds the Python module
|
||
|
Depends(a, pyx_files) # Re-Cythonize alos2proc_f.pyx
|
||
|
Depends(b, pyx_files) # Rebuild alos2proc_f.o
|
||
|
Depends(c, pyx_files) # Rebuild alos2proc_f Python module
|