This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Improve the clang order-file generation workflow
ClosedPublic

Authored by beanz on Feb 8 2016, 12:48 PM.

Details

Summary

This commit re-lands r259862. The underlying cause of the build breakage was an incorrectly written capabilities test. In tools/Driver/CMakeLists.txt I was attempting to check if a linker flag worked, the test was passing it to the compiler, not the linker. CMake doesn't have a linker test, so we have a hand-rolled one.

Original Patch Review: http://reviews.llvm.org/D16896

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

Diff Detail

Repository
rL LLVM

Event Timeline

beanz updated this revision to Diff 47241.Feb 8 2016, 12:48 PM
beanz retitled this revision from to [CMake] Improve the clang order-file generation workflow.
beanz updated this object.
beanz added a reviewer: bogner.
beanz added a subscriber: cfe-commits.
This revision was automatically updated to reflect the committed changes.