2013-06-14 00:05:41 +08:00
set ( LLVM_NO_RTTI 1 )
2014-04-03 23:03:11 +08:00
file ( GLOB SWIG_INPUTS Python/interface/*.i )
2014-07-02 01:57:19 +08:00
if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )
add_custom_command (
O U T P U T $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / L L D B W r a p P y t h o n . c p p
D E P E N D S $ { L L D B _ S O U R C E _ D I R } / s c r i p t s / l l d b . s w i g
2014-07-11 04:25:18 +08:00
D E P E N D S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / b u i l d S w i g W r a p p e r C l a s s e s . p y
2014-07-02 01:57:19 +08:00
D E P E N D S $ { S W I G _ I N P U T S }
2014-07-18 15:06:13 +08:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / b u i l d S w i g W r a p p e r C l a s s e s . p y " - - s r c R o o t = $ { L L D B _ S O U R C E _ D I R } " " - - t a r g e t D i r = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } " " - - c f g B l d D i r = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } " " - - p r e f i x = $ { C M A K E _ B I N A R Y _ D I R } " - m
2014-07-02 01:57:19 +08:00
C O M M E N T " P y t h o n s c r i p t b u i l d i n g L L D B P y t h o n w r a p p e r " )
set_source_files_properties ( ${ CMAKE_CURRENT_BINARY_DIR } /LLDBWrapPython.cpp PROPERTIES GENERATED 1 )
2013-06-14 00:05:41 +08:00
2014-07-02 01:57:19 +08:00
ADD_CUSTOM_TARGET ( swig_wrapper ALL echo -n
D E P E N D S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / L L D B W r a p P y t h o n . c p p
)
2013-06-14 00:05:41 +08:00
2014-07-02 01:57:19 +08:00
# Install the LLDB python module on all operating systems
install ( SCRIPT lldb_python_module.cmake -DCMAKE_INSTALL_PREFIX=\ "${CMAKE_INSTALL_PREFIX}\" -DCMAKE_BUILD_DIR=\ "${CMAKE_BUILD_DIR}\" )
else ( )
add_custom_command (
O U T P U T $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / L L D B W r a p P y t h o n . c p p
D E P E N D S $ { L L D B _ S O U R C E _ D I R } / s c r i p t s / l l d b . s w i g
D E P E N D S $ { S W I G _ I N P U T S }
# swig was directly invoked on Windows (where the Python API is not being generated) but on other platforms, we need to run the *swig-wrapper-classes.sh shell-scripts.
#COMMAND swig -c++ -shadow -python -I${LLDB_SOURCE_DIR}/include -I./. -outdir ${LLDB_SOURCE_DIR}/scripts/Python -o ${LLDB_SOURCE_DIR}/source/LLDBWrapPython.cpp ${LLDB_SOURCE_DIR}/scripts/lldb.swig
C O M M A N D e n v P Y T H O N _ E X E C U T A B L E = $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / b u i l d - s w i g - w r a p p e r - c l a s s e s . s h $ { L L D B _ S O U R C E _ D I R } $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } $ { C M A K E _ B I N A R Y _ D I R } - m
C O M M A N D e n v P Y T H O N _ E X E C U T A B L E = $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / f i n i s h - s w i g - w r a p p e r - c l a s s e s . s h $ { L L D B _ S O U R C E _ D I R } $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } $ { C M A K E _ B I N A R Y _ D I R } - m
C O M M E N T " B u i l d i n g l l d b p y t h o n w r a p p e r " )
set_source_files_properties ( ${ CMAKE_CURRENT_BINARY_DIR } /LLDBWrapPython.cpp PROPERTIES GENERATED 1 )
ADD_CUSTOM_TARGET ( swig_wrapper ALL echo -n
D E P E N D S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / L L D B W r a p P y t h o n . c p p
)
# Install the LLDB python module on all operating systems (except Windows)
if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
install ( DIRECTORY ${ CMAKE_BINARY_DIR } /lib ${ LLVM_LIBDIR_SUFFIX } /python ${ PYTHON_VERSION_MAJOR } . ${ PYTHON_VERSION_MINOR }
D E S T I N A T I O N l i b $ { L L V M _ L I B D I R _ S U F F I X } )
endif ( )
endif ( )
2014-02-26 15:39:20 +08:00
# build Python modules
2014-07-02 01:57:19 +08:00
add_subdirectory ( Python/modules )