summaryrefslogtreecommitdiffstats
path: root/CMakeModules
diff options
context:
space:
mode:
authorAlexandre Bouvier <contact@amb.tf>2023-01-23 01:51:12 +0100
committerAlexandre Bouvier <contact@amb.tf>2023-01-23 06:23:00 +0100
commit34b1ea9c1925d0da9377973d25e10e9b5ec40e94 (patch)
tree0ada6de7ae81a250258a4243d5bd4d2cc1283aef /CMakeModules
parentMerge pull request #9555 from abouvier/catch2-update (diff)
downloadyuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar.gz
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar.bz2
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar.lz
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar.xz
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.tar.zst
yuzu-34b1ea9c1925d0da9377973d25e10e9b5ec40e94.zip
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/FindLLVM.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeModules/FindLLVM.cmake b/CMakeModules/FindLLVM.cmake
new file mode 100644
index 000000000..513d9a536
--- /dev/null
+++ b/CMakeModules/FindLLVM.cmake
@@ -0,0 +1,16 @@
+# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_package(LLVM QUIET CONFIG)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LLVM CONFIG_MODE)
+
+if (LLVM_FOUND AND NOT TARGET LLVM::Demangle)
+ add_library(LLVM::Demangle INTERFACE IMPORTED)
+ llvm_map_components_to_libnames(LLVM_LIBRARIES demangle)
+ target_compile_definitions(LLVM::Demangle INTERFACE ${LLVM_DEFINITIONS})
+ target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS})
+ target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES})
+endif()