diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-04-12 13:08:47 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-05-03 01:39:16 +0200 |
commit | 1fba945b61619a344c21468eb2bb36604f1cb975 (patch) | |
tree | 5aaa40ffaa9f3504f44a4c68110a45023d9dbfc9 /mesonbuild/dependencies/data | |
parent | 3f539e01aedd1a3498c341efadb591a8a90e6995 (diff) | |
download | meson-1fba945b61619a344c21468eb2bb36604f1cb975.zip meson-1fba945b61619a344c21468eb2bb36604f1cb975.tar.gz meson-1fba945b61619a344c21468eb2bb36604f1cb975.tar.bz2 |
cmake: LLVM better modules handling
Diffstat (limited to 'mesonbuild/dependencies/data')
-rw-r--r-- | mesonbuild/dependencies/data/CMakeListsLLVM.txt | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/data/CMakeListsLLVM.txt b/mesonbuild/dependencies/data/CMakeListsLLVM.txt index d16e1b6..9d3e412 100644 --- a/mesonbuild/dependencies/data/CMakeListsLLVM.txt +++ b/mesonbuild/dependencies/data/CMakeListsLLVM.txt @@ -17,10 +17,33 @@ endwhile() if(LLVM_FOUND) set(PACKAGE_FOUND TRUE) - llvm_map_components_to_libnames(llvm_libs ${LLVM_MESON_MODULES}) - llvm_map_components_to_libnames(llvm_libs_opt ${LLVM_MESON_OPT_MODULES}) - set(MESON_RESOLVED_LLVM_MODULES ${llvm_libs}) - set(MESON_RESOLVED_LLVM_MODULES_OPT ${llvm_libs_opt}) + foreach(mod IN LISTS LLVM_MESON_MODULES) + # Reset variables + set(out_mods) + set(real_mods) + + # Generate a lower and upper case version + string(TOLOWER "${mod}" mod_L) + string(TOUPPER "${mod}" mod_U) + + # Get the mapped components + llvm_map_components_to_libnames(out_mods ${mod} ${mod_L} ${mod_U}) + list(SORT out_mods) + list(REMOVE_DUPLICATES out_mods) + + # Make sure that the modules exist + foreach(i IN LISTS out_mods) + if(TARGET ${i}) + list(APPEND real_mods ${i}) + endif() + endforeach() + + # Set the output variables + set(MESON_LLVM_TARGETS_${mod} ${real_mods}) + foreach(i IN LISTS real_mods) + set(MESON_TARGET_TO_LLVM_${i} ${mod}) + endforeach() + endforeach() # Check the following variables: # LLVM_PACKAGE_VERSION |