This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fix build with -DLLVM_TOOL_LLVM_{MCA/EXEGESIS}_BUILD=OFF
Needs ReviewPublic

Authored by arichardson on Nov 28 2018, 6:12 AM.

Details

Reviewers
beanz
Summary

I have been trying to reduce our Jenkins build times by not building tools
that aren't used in dependent jobs and noticed that not building llvm-mca
or llvm-exegesis broke the CMake configure for tests.

llvm-mca and llvm-exegesis seem to be the only tools worth disabling to
save build time since they contain more than just a couple of source files
and are not needed for any of the other tests.

Diff Detail

Event Timeline

arichardson created this revision.Nov 28 2018, 6:12 AM

Out of interest, how are you disabling tools?

Just an idea, but how about making all the targets optional? It's less code and gives you more flexibility should you wish to disable more of them in future.

set(LLVM_TEST_DEPENDS_CANDIDATES
          BugpointPasses
[...]
          yaml2obj
        )

foreach(candidate ${LLVM_TEST_DEPENDS_CANDIDATES})
  if(TARGET ${candidate})
    list(APPEND LLVM_TEST_DEPENDS ${candidate})
  endif()
endforeach()
beanz added a comment.Nov 29 2018, 9:32 AM

How are you instructing lit to not run the tests that rely on these tools? Doesn't seem like you are, so I would expect check-llvm to fail on a clean build configuration due to missing tools.

Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2019, 10:09 AM