summaryrefslogtreecommitdiffstats
path: root/CMakeModules
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/CopyYuzuFFmpegDeps.cmake4
-rw-r--r--CMakeModules/CopyYuzuQt5Deps.cmake2
-rw-r--r--CMakeModules/CopyYuzuSDLDeps.cmake2
-rw-r--r--CMakeModules/DownloadExternals.cmake6
-rw-r--r--CMakeModules/FindFFmpeg.cmake2
-rw-r--r--CMakeModules/FindLLVM.cmake26
-rw-r--r--CMakeModules/Findhttplib.cmake12
-rw-r--r--CMakeModules/Findinih.cmake19
8 files changed, 62 insertions, 11 deletions
diff --git a/CMakeModules/CopyYuzuFFmpegDeps.cmake b/CMakeModules/CopyYuzuFFmpegDeps.cmake
index c6231737e..e50696cc0 100644
--- a/CMakeModules/CopyYuzuFFmpegDeps.cmake
+++ b/CMakeModules/CopyYuzuFFmpegDeps.cmake
@@ -3,8 +3,8 @@
function(copy_yuzu_FFmpeg_deps target_dir)
include(WindowsCopyFiles)
- set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
+ set(DLL_DEST "$<TARGET_FILE_DIR:${target_dir}>/")
file(READ "${FFmpeg_PATH}/requirements.txt" FFmpeg_REQUIRED_DLLS)
string(STRIP "${FFmpeg_REQUIRED_DLLS}" FFmpeg_REQUIRED_DLLS)
- windows_copy_files(${target_dir} ${FFmpeg_DLL_DIR} ${DLL_DEST} ${FFmpeg_REQUIRED_DLLS})
+ windows_copy_files(${target_dir} ${FFmpeg_LIBRARY_DIR} ${DLL_DEST} ${FFmpeg_REQUIRED_DLLS})
endfunction(copy_yuzu_FFmpeg_deps)
diff --git a/CMakeModules/CopyYuzuQt5Deps.cmake b/CMakeModules/CopyYuzuQt5Deps.cmake
index ab56de444..b3a65c347 100644
--- a/CMakeModules/CopyYuzuQt5Deps.cmake
+++ b/CMakeModules/CopyYuzuQt5Deps.cmake
@@ -4,7 +4,7 @@
function(copy_yuzu_Qt5_deps target_dir)
include(WindowsCopyFiles)
if (MSVC)
- set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
+ set(DLL_DEST "$<TARGET_FILE_DIR:${target_dir}>/")
set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
else()
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/")
diff --git a/CMakeModules/CopyYuzuSDLDeps.cmake b/CMakeModules/CopyYuzuSDLDeps.cmake
index 7ffdd8a1d..464eed5e9 100644
--- a/CMakeModules/CopyYuzuSDLDeps.cmake
+++ b/CMakeModules/CopyYuzuSDLDeps.cmake
@@ -3,6 +3,6 @@
function(copy_yuzu_SDL_deps target_dir)
include(WindowsCopyFiles)
- set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
+ set(DLL_DEST "$<TARGET_FILE_DIR:${target_dir}>/")
windows_copy_files(${target_dir} ${SDL2_DLL_DIR} ${DLL_DEST} SDL2.dll)
endfunction(copy_yuzu_SDL_deps)
diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake
index 8fe5ba48d..972f5ca74 100644
--- a/CMakeModules/DownloadExternals.cmake
+++ b/CMakeModules/DownloadExternals.cmake
@@ -7,6 +7,7 @@
# prefix_var: name of a variable which will be set with the path to the extracted contents
function(download_bundled_external remote_path lib_name prefix_var)
+set(package_base_url "https://github.com/yuzu-emu/")
set(package_repo "no_platform")
set(package_extension "no_platform")
if (WIN32)
@@ -15,10 +16,13 @@ if (WIN32)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(package_repo "ext-linux-bin/raw/main/")
set(package_extension ".tar.xz")
+elseif (ANDROID)
+ set(package_repo "ext-android-bin/raw/main/")
+ set(package_extension ".tar.xz")
else()
message(FATAL_ERROR "No package available for this platform")
endif()
-set(package_url "https://github.com/yuzu-emu/${package_repo}")
+set(package_url "${package_base_url}${package_repo}")
set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
if (NOT EXISTS "${prefix}")
diff --git a/CMakeModules/FindFFmpeg.cmake b/CMakeModules/FindFFmpeg.cmake
index eedf28aea..5cb1f3c8a 100644
--- a/CMakeModules/FindFFmpeg.cmake
+++ b/CMakeModules/FindFFmpeg.cmake
@@ -14,7 +14,7 @@
# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
# FFmpeg_FOUND: True if all components have been found
#
-# This module defines the following targets, which are prefered over variables:
+# This module defines the following targets, which are preferred over variables:
#
# FFmpeg::<component>: Target to use <component> directly, with include path,
# library and dependencies set up. If you are using a static build, you are
diff --git a/CMakeModules/FindLLVM.cmake b/CMakeModules/FindLLVM.cmake
new file mode 100644
index 000000000..efbd0ca46
--- /dev/null
+++ b/CMakeModules/FindLLVM.cmake
@@ -0,0 +1,26 @@
+# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_package(LLVM QUIET COMPONENTS CONFIG)
+if (LLVM_FOUND)
+ separate_arguments(LLVM_DEFINITIONS)
+ if (LLVMDemangle IN_LIST LLVM_AVAILABLE_LIBS)
+ set(LLVM_Demangle_FOUND TRUE)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LLVM HANDLE_COMPONENTS CONFIG_MODE)
+
+if (LLVM_FOUND AND LLVM_Demangle_FOUND AND NOT TARGET LLVM::Demangle)
+ add_library(LLVM::Demangle INTERFACE IMPORTED)
+ target_compile_definitions(LLVM::Demangle INTERFACE ${LLVM_DEFINITIONS})
+ target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS})
+ # prefer shared LLVM: https://github.com/llvm/llvm-project/issues/34593
+ # but use ugly hack because llvm_config doesn't support interface library
+ add_library(_dummy_lib SHARED EXCLUDE_FROM_ALL src/yuzu/main.cpp)
+ llvm_config(_dummy_lib USE_SHARED demangle)
+ get_target_property(LLVM_LIBRARIES _dummy_lib LINK_LIBRARIES)
+ target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES})
+endif()
diff --git a/CMakeModules/Findhttplib.cmake b/CMakeModules/Findhttplib.cmake
index 861207eb5..48967add9 100644
--- a/CMakeModules/Findhttplib.cmake
+++ b/CMakeModules/Findhttplib.cmake
@@ -6,13 +6,23 @@ include(FindPackageHandleStandardArgs)
find_package(httplib QUIET CONFIG)
if (httplib_CONSIDERED_CONFIGS)
- find_package_handle_standard_args(httplib CONFIG_MODE)
+ find_package_handle_standard_args(httplib HANDLE_COMPONENTS CONFIG_MODE)
else()
find_package(PkgConfig QUIET)
pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib)
+ if ("-DCPPHTTPLIB_OPENSSL_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
+ set(httplib_OpenSSL_FOUND TRUE)
+ endif()
+ if ("-DCPPHTTPLIB_ZLIB_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
+ set(httplib_ZLIB_FOUND TRUE)
+ endif()
+ if ("-DCPPHTTPLIB_BROTLI_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
+ set(httplib_Brotli_FOUND TRUE)
+ endif()
find_package_handle_standard_args(httplib
REQUIRED_VARS HTTPLIB_INCLUDEDIR
VERSION_VAR HTTPLIB_VERSION
+ HANDLE_COMPONENTS
)
endif()
diff --git a/CMakeModules/Findinih.cmake b/CMakeModules/Findinih.cmake
index b8d38dcff..791befebd 100644
--- a/CMakeModules/Findinih.cmake
+++ b/CMakeModules/Findinih.cmake
@@ -3,14 +3,25 @@
# SPDX-License-Identifier: GPL-3.0-or-later
find_package(PkgConfig QUIET)
-pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
+pkg_search_module(INIH QUIET IMPORTED_TARGET inih)
+if (INIReader IN_LIST inih_FIND_COMPONENTS)
+ pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
+ if (INIREADER_FOUND)
+ set(inih_INIReader_FOUND TRUE)
+ endif()
+endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(inih
- REQUIRED_VARS INIREADER_LINK_LIBRARIES
- VERSION_VAR INIREADER_VERSION
+ REQUIRED_VARS INIH_LINK_LIBRARIES
+ VERSION_VAR INIH_VERSION
+ HANDLE_COMPONENTS
)
-if (inih_FOUND AND NOT TARGET inih::INIReader)
+if (inih_FOUND AND NOT TARGET inih::inih)
+ add_library(inih::inih ALIAS PkgConfig::INIH)
+endif()
+
+if (inih_FOUND AND inih_INIReader_FOUND AND NOT TARGET inih::INIReader)
add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
endif()