This is an archive of the discontinued LLVM Phabricator instance.

Fix handling of LLDB_VERS_GENERATED_FILE.
ClosedPublic

Authored by brucem on Oct 8 2015, 6:45 AM.

Details

Summary

This is Darwin only.

The symbol defined by ${LLDB_VERS_GENERATED_FILE} is used by
source/lldb.cpp, so anything that uses lldb.cpp (which is in
lldbBase) should also have the generated symbol. This means
that the entire process can be centralized within source/CMakeLists.txt
where lldbBase is constructed.

Additionally, the custom command should have dependencies on the
project file as well as the generation script so that if either
changes, the version file is correctly re-generated and everything
is re-linked appropriately.

  • cmake/LLDBDependencies.cmake: Remove everything related to the generated version file from here.
  • source/CMakeLists.txt: On Darwin, add the generated version file to the sources that make up lldbBase. Also, create a custom target and make lldbBase depend on it to re-generate the generated file as needed.
  • source/API/CMakeLists.txt: Don't need to build the generated version file here or use it to control linking against swig_wrapper.
  • tools/lldb-server/CMakeLists.txt: Likewise.

Diff Detail

Repository
rL LLVM

Event Timeline

brucem updated this revision to Diff 36851.Oct 8 2015, 6:45 AM
brucem retitled this revision from to Fix handling of LLDB_VERS_GENERATED_FILE..
brucem updated this object.
brucem added reviewers: dawn, sas, clayborg, zturner.
brucem added a subscriber: lldb-commits.
brucem added a comment.Oct 8 2015, 6:46 AM

I did NOT test this with a full rebuild as it is nearly my bedtime. I did test it with an incremental build as well as rm'ing the generated file and touching the (new) dependencies to make sure that the vers file got regenerated.

brucem added a comment.Oct 8 2015, 7:15 AM

I have a full build from clean going with this. I'm pretty sure that it will be fine.

I'll check this into SVN after I wake up if someone agrees that it looks good.

brucem added a comment.Oct 8 2015, 8:06 AM

Both builds from clean and incremental have now succeeded for me with this patch.

zturner edited edge metadata.Oct 8 2015, 9:32 AM

I'll defer to Dawn, I'm not too familiar with how the CMake Darwin stuff works. If the people interested say it works, that's fine with me.

dawn edited edge metadata.Oct 8 2015, 11:01 AM

Hi Bruce, thanks for this patch! I'll give it a try now...

dawn accepted this revision.Oct 8 2015, 5:34 PM
dawn edited edge metadata.

Works great! Please commit. (Sorry for delay - I ran into problems with clang crashing on me for unknown reasons - finally got the build working again so I could test).

This revision is now accepted and ready to land.Oct 8 2015, 5:34 PM
This revision was automatically updated to reflect the committed changes.