This is an archive of the discontinued LLVM Phabricator instance.

Change SWIG output directory when building LLDB.framework with CMake
ClosedPublic

Authored by xiaobai on Jun 4 2018, 1:27 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

xiaobai created this revision.Jun 4 2018, 1:27 PM

I'm not sure who else would be interested in reviewing this. If you know somebody, please add them. :)

sas accepted this revision.Jun 4 2018, 3:29 PM
sas added inline comments.
CMakeLists.txt
149 ↗(On Diff #149843)

This path...

scripts/CMakeLists.txt
38 ↗(On Diff #149843)

...and this path were not the same before your change. Was that a bug that you're fixing?

This revision is now accepted and ready to land.Jun 4 2018, 3:29 PM
xiaobai added inline comments.Jun 4 2018, 3:40 PM
scripts/CMakeLists.txt
38 ↗(On Diff #149843)

Yes. Those paths were actually the same if you were not building the framework, which is why this bug never surfaced. Specifically, ${CMAKE_CURRENT_BINARY_DIR} in scripts/CMakeLists.txt resolves to the same path as ${CMAKE_CURRENT_BINARY_DIR}/scripts in the top level CMakeLists.txt.

The pitfall is the assumption that this path is always the same as ${LLDB_PYTHON_TARGET_DIR}, which it is not if you are trying to build the framework.

sas added inline comments.Jun 4 2018, 3:47 PM
scripts/CMakeLists.txt
38 ↗(On Diff #149843)

Makes sense. This should be good to go then.

This revision was automatically updated to reflect the committed changes.