[kitsune] Fixes to support building only a subset of targets #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should really be more than one patch because there are several unrelated issues here.
The kitsune tests look for a label identifying the linker executable, then check the same line to ensure that the correct libraries are present. Checking the linker reliably is a hassle because it can be very different depending on the platform (even within Linux'es, it can vary, and that is even before using LLD). The, admittedly suboptimal, changes here simply remove the check for the linker executable and assume that the line immediately following the compile line is the link line and check for linker flags/libraries there. It should work unless something major changes in clang which is, hopefully, unlikely.
If the Cuda target has not been enabled, Kitsune will fail to build because CudaABI.cpp expects to find certain variables. This could be a more general problem with the other ABI's as well, so we don't build them unless they have been enabled.
Because kitsune/ is only processed after the subdirectories of llvm/, the KITSUNE_*_ENABLED variables are not set when llvm/lib/Transforms/Tapir is processed, so we will not be able to determine which Tapir targets have been enabed. All the code to do that is moved from kitsune/CMakeLists.txt to llvm/CMakeLists.txt. It would be good if we could find a way to keep all the kitsune cmake code isolated, from the rest of LLVM's cmake, but this should be manageable during merges.
The names of the variables were changed from KITSUNE_ENABLE to KITSUNE_ENABLED (note the added trailing D) for consistency with the rest of the code.