This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Don't use the local python to set a default for LLDB_PYTHON_RELATIVE_PATH when cross compiling.
ClosedPublic

Authored by mstorsjo on May 5 2021, 5:48 AM.

Diff Detail

Event Timeline

mstorsjo created this revision.May 5 2021, 5:48 AM
mstorsjo requested review of this revision.May 5 2021, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 5:48 AM
JDevlieghere accepted this revision.May 5 2021, 8:38 AM
JDevlieghere added inline comments.
lldb/CMakeLists.txt
54

Are there other reasons LLDB_PYTHON_RELATIVE_PATH could be empty at this point, unrelated to cross compilation? Would it make sense to move the error in the else clause of if (NOT CMAKE_CROSSCOMPILING) instead?

This revision is now accepted and ready to land.May 5 2021, 8:38 AM
mstorsjo added inline comments.May 5 2021, 12:24 PM
lldb/CMakeLists.txt
54

I guess it could be if the python command above succeeded, but output an empty string.

My cmake-fu isn't very strong, but I wonder if it's ok to check ${LLDB_PYTHON_RELATIVE_PATH} before the set(LLDB_PYTHON_RELATIVE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} CACHE ...) command? I guess it is, because it's going to need to be set beforehand anyway?