|
|
|
@ -1,16 +1,11 @@
|
|
|
|
# SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
# SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
# SPDX-License-Identifier: CC-BY-NC-ND-4.0 + Packaging Restriction
|
|
|
|
# SPDX-License-Identifier: CC-BY-NC-ND-4.0 + Packaging Restriction
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# NOTE: In addition to the terms of CC-BY-NC-ND-4.0, you may not use this file to create
|
|
|
|
|
|
|
|
# packages or build recipes without explicit permission from the copyright holder.
|
|
|
|
|
|
|
|
|
|
|
|
# Get prebuilt dependencies for the current platform and architecture.
|
|
|
|
# Get prebuilt dependencies for the current platform and architecture.
|
|
|
|
if(WIN32)
|
|
|
|
if(APPLE)
|
|
|
|
if (CPU_ARCH_X64)
|
|
|
|
|
|
|
|
set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/windows-x64")
|
|
|
|
|
|
|
|
elseif(CPU_ARCH_ARM64)
|
|
|
|
|
|
|
|
set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/windows-arm64")
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
message(FATAL_ERROR "Unsupported architecture")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
elseif(APPLE)
|
|
|
|
|
|
|
|
set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/macos-universal")
|
|
|
|
set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/macos-universal")
|
|
|
|
elseif(LINUX)
|
|
|
|
elseif(LINUX)
|
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
@ -43,7 +38,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
|
|
|
|
# pkg-config gets pulled transitively on some platforms.
|
|
|
|
# pkg-config gets pulled transitively on some platforms.
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
if(NOT APPLE)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
find_package(Libbacktrace REQUIRED)
|
|
|
|
find_package(Libbacktrace REQUIRED)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
@ -86,19 +81,8 @@ find_package(spirv_cross_c_shared REQUIRED
|
|
|
|
find_package(SDL3 3.4.4 REQUIRED
|
|
|
|
find_package(SDL3 3.4.4 REQUIRED
|
|
|
|
NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/SDL3")
|
|
|
|
NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/SDL3")
|
|
|
|
|
|
|
|
|
|
|
|
# Verify dependency paths.
|
|
|
|
|
|
|
|
foreach(dep zstd WebP PNG libjpeg-turbo freetype harfbuzz plutosvg cpuinfo
|
|
|
|
|
|
|
|
DiscordRPC SoundTouch libzip Shaderc spirv_cross_c_shared SDL3)
|
|
|
|
|
|
|
|
if((${dep}_LIBRARY AND NOT "${${dep}_LIBRARY}" MATCHES "^${DEPS_PATH}") OR
|
|
|
|
|
|
|
|
(${dep}_DIR AND NOT "${${dep}_DIR}" MATCHES "^${DEPS_PATH}"))
|
|
|
|
|
|
|
|
message(FATAL_ERROR "Using incorrect ${dep} library. Check your dependencies.")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# All our builds include Qt, so this is not a problem.
|
|
|
|
# All our builds include Qt, so this is not a problem.
|
|
|
|
set(QT_NO_PRIVATE_MODULE_WARNING ON)
|
|
|
|
set(QT_NO_PRIVATE_MODULE_WARNING ON)
|
|
|
|
|
|
|
|
|
|
|
|
# Should be prebuilt.
|
|
|
|
|
|
|
|
if(LINUX)
|
|
|
|
if(LINUX)
|
|
|
|
find_package(Qt6 6.11.1 REQUIRED
|
|
|
|
find_package(Qt6 6.11.1 REQUIRED
|
|
|
|
NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/Qt6"
|
|
|
|
NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/Qt6"
|
|
|
|
@ -109,13 +93,16 @@ else()
|
|
|
|
COMPONENTS Core Gui GuiPrivate Widgets LinguistTools)
|
|
|
|
COMPONENTS Core Gui GuiPrivate Widgets LinguistTools)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Have to verify it down here, don't want users using unpatched Qt.
|
|
|
|
# Verify dependency paths.
|
|
|
|
if(NOT Qt6_DIR MATCHES "^${DEPS_PATH}")
|
|
|
|
foreach(dep zstd WebP PNG libjpeg-turbo freetype harfbuzz plutosvg cpuinfo
|
|
|
|
message(FATAL_ERROR "Using incorrect Qt library. Check your dependencies.")
|
|
|
|
DiscordRPC SoundTouch libzip Shaderc spirv_cross_c_shared SDL3 Qt6)
|
|
|
|
|
|
|
|
if((${dep}_LIBRARY AND NOT "${${dep}_LIBRARY}" MATCHES "^${DEPS_PATH}") OR
|
|
|
|
|
|
|
|
(${dep}_DIR AND NOT "${${dep}_DIR}" MATCHES "^${DEPS_PATH}"))
|
|
|
|
|
|
|
|
message(FATAL_ERROR "Using incorrect ${dep} library. Check your dependencies.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
# Libraries that are pulled in from host.
|
|
|
|
# Libraries that are pulled in from host.
|
|
|
|
if(NOT WIN32)
|
|
|
|
|
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
if(LINUX)
|
|
|
|
if(LINUX)
|
|
|
|
find_package(UDEV REQUIRED)
|
|
|
|
find_package(UDEV REQUIRED)
|
|
|
|
@ -135,14 +122,9 @@ if(NOT WIN32)
|
|
|
|
find_package(Wayland REQUIRED Egl)
|
|
|
|
find_package(Wayland REQUIRED Egl)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
|
|
|
|
find_package(FFMPEG 8.1.1 COMPONENTS avcodec avformat avutil swresample swscale)
|
|
|
|
find_package(FFMPEG 8.1.1 COMPONENTS avcodec avformat avutil swresample swscale)
|
|
|
|
if(NOT FFMPEG_FOUND)
|
|
|
|
if(NOT FFMPEG_FOUND)
|
|
|
|
message(WARNING "FFmpeg not found, using bundled headers.")
|
|
|
|
message(WARNING "FFmpeg not found, using bundled headers.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT FFMPEG_FOUND)
|
|
|
|
|
|
|
|
set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/dep/ffmpeg/include")
|
|
|
|
set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/dep/ffmpeg/include")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|