Change SWIG output directory when building LLDB.framework with CMake

Instead of assuming that SWIG generated files (e.g. lldb.py) will live
in scripts, we should set it to $LLDB_PYTHON_TARGET_DIR. This variable is set to
scripts, except when building LLDB.framework when it is set to
LLDB_FRAMEWORK_DIR.

Differential Revision: https://reviews.llvm.org/D47742

llvm-svn: 333968
This commit is contained in:
Alex Langford 2018-06-04 23:47:36 +00:00
parent adcaddb6da
commit 59ad87821a
2 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ if (NOT LLDB_DISABLE_PYTHON)
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
--srcRoot=${LLDB_SOURCE_DIR}
--targetDir=${LLDB_PYTHON_TARGET_DIR}
--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts
--cfgBldDir=${LLDB_PYTHON_TARGET_DIR}
--prefix=${CMAKE_BINARY_DIR}
--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
--lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}
@ -146,7 +146,7 @@ if (NOT LLDB_DISABLE_PYTHON)
${FINISH_EXTRA_ARGS}
VERBATIM
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/scripts/lldb.py
DEPENDS ${LLDB_PYTHON_TARGET_DIR}/lldb.py
COMMENT "Python script sym-linking LLDB Python API")
# We depend on liblldb being built before we can do this step.
add_dependencies(finish_swig liblldb lldb-argdumper)

View File

@ -35,7 +35,7 @@ get_filename_component(CFGBLDDIR ${LLDB_WRAP_PYTHON} DIRECTORY)
find_package(SWIG REQUIRED)
add_custom_command(
OUTPUT ${LLDB_WRAP_PYTHON}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
OUTPUT ${LLDB_PYTHON_TARGET_DIR}/lldb.py
DEPENDS ${SWIG_SOURCES}
DEPENDS ${SWIG_INTERFACES}
DEPENDS ${SWIG_HEADERS}