Fix the install location of LLDBWrapPython.cpp when building
authorAdrian Prantl <aprantl@apple.com>
Mon, 5 Mar 2018 21:08:42 +0000 (21:08 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 5 Mar 2018 21:08:42 +0000 (21:08 +0000)
LLDB.framework to point to the build directory where it is expected by
the top-level CMakeLists.txt.

This should be a no-op in any other configurations.

rdar://problem/38005302

llvm-svn: 326743

lldb/scripts/CMakeLists.txt

index 1fe3411..72534ce 100644 (file)
@@ -30,6 +30,8 @@ if(LLDB_BUILD_FRAMEWORK)
     ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR})
 endif()
 
+get_filename_component(CFGBLDDIR ${LLDB_WRAP_PYTHON} DIRECTORY)
+
 find_package(SWIG REQUIRED)
 add_custom_command(
   OUTPUT ${LLDB_WRAP_PYTHON}
@@ -43,7 +45,7 @@ add_custom_command(
       ${framework_arg}
       --srcRoot=${LLDB_SOURCE_DIR}
       --targetDir=${LLDB_PYTHON_TARGET_DIR}
-      --cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}
+      --cfgBldDir=${CFGBLDDIR}
       --prefix=${CMAKE_BINARY_DIR}
       --swigExecutable=${SWIG_EXECUTABLE}
   VERBATIM