Move the post-build step that creates lldb.py.
authorZachary Turner <zturner@google.com>
Thu, 10 Jul 2014 20:37:47 +0000 (20:37 +0000)
committerZachary Turner <zturner@google.com>
Thu, 10 Jul 2014 20:37:47 +0000 (20:37 +0000)
Being in lldb\source, ${CMAKE_CURRENT_BINARY_DIR} would resolve to
the build\tools\lldb\source directory.  For correct operation, and
parity with the shell script, it needs to resolve to the
build\tools\lldb\scripts directory.

llvm-svn: 212760

lldb/scripts/CMakeLists.txt
lldb/source/CMakeLists.txt

index 773a5b7..b11f2fc 100644 (file)
@@ -18,6 +18,14 @@ if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )
 
        # 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}\")
+
+       # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
+       add_custom_command( TARGET liblldb
+         POST_BUILD
+         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/finishSwigWrapperClasses.py
+         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Python/finishSwigPythonLLDB.py
+         COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/finishSwigWrapperClasses.py -d "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m
+         COMMENT "Python script sym-linking LLDB Python API")
 else ()
        add_custom_command(
          OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
index b130641..d319ec4 100644 (file)
@@ -327,16 +327,6 @@ endif ()
 # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
 #        revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
 
-if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )
-       # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
-       if ( NOT LLDB_DISABLE_PYTHON )
-       add_custom_command( TARGET liblldb
-           POST_BUILD
-           COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m
-           COMMENT "Python script sym-linking LLDB Python API")
-       endif ()
-endif ()
-
 install(TARGETS liblldb
   RUNTIME DESTINATION bin
   LIBRARY DESTINATION lib