mirror of
https://github.com/libretro/parallel-gx1.git
synced 2026-11-07 04:26:01 -10:00
Remove the CMake build
The static Makefile is the only build. GitLab CI and the GitHub workflows build with it, with the same lanes and toolchains; the MSVC workflow and the CMake-only macOS universal-binary script go, as nothing builds them. The Readme describes the Makefile build.
This commit is contained in:
1 parent
deaaab1c9b
commit
057a10b834
131 files changed
+76
-10246
No files matched your search
@@ -10,10 +10,6 @@ indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 100
|
||||
|
||||
[{CMakeLists.txt,*.cmake}]
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
|
||||
[.editorconfig]
|
||||
insert_final_newline = true
|
||||
|
||||
|
||||
@@ -1,40 +1,27 @@
|
||||
name: Build Dolphin (libretro) on Android
|
||||
name: Build parallel_gamecubewii (libretro) on Android
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
core_id: parallel_gamecubewii_libretro
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y openjdk-25-jdk wget unzip cmake ninja-build
|
||||
wget https://dl.google.com/android/repository/android-ndk-r29-linux.zip
|
||||
unzip -q android-ndk-r29-linux.zip
|
||||
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r29" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
- name: Checkout parallel-gamecubewii repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
cmake -B build/android-arm64-v8a \
|
||||
-DLIBRETRO=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DANDROID_ABI=arm64-v8a \
|
||||
-DANDROID_PLATFORM=android-26 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
|
||||
-G Ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd ${{ env.core_id }}/build/android-arm64-v8a
|
||||
ninja -j$(nproc)
|
||||
cd ${{ env.core_id }}
|
||||
make -j$(nproc) platform=android-arm64 NDK_ROOT=$ANDROID_NDK_HOME
|
||||
@@ -1,42 +1,21 @@
|
||||
name: Build Dolphin (libretro) on iOS
|
||||
name: Build parallel_gamecubewii (libretro) on iOS
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
core_id: parallel_gamecubewii_libretro
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew update
|
||||
brew install cmake mbedtls zlib
|
||||
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
- name: Checkout parallel-gamecubewii repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure (iOS arm64)
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DCMAKE_C_FLAGS="" \
|
||||
-DCMAKE_CXX_FLAGS="" \
|
||||
-DIOS=ON \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
|
||||
-DCMAKE_SYSTEM_NAME=iOS \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
|
||||
-DCMAKE_OSX_ARCHITECTURES=arm64 \
|
||||
-DLIBRETRO=ON \
|
||||
. -Bbuild/ios-arm64
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd ${{ env.core_id }}/build/ios-arm64
|
||||
make -j$(sysctl -n hw.ncpu)
|
||||
cd ${{ env.core_id }}
|
||||
make -j$(sysctl -n hw.ncpu) platform=ios-arm64
|
||||
@@ -1,43 +1,21 @@
|
||||
name: Build Dolphin (libretro) on macOS
|
||||
name: Build parallel_gamecubewii (libretro) on macOS
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
core_id: parallel_gamecubewii_libretro
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: "macOS x64"
|
||||
os: macos-latest
|
||||
ZIP_NAME_SUFFIX: macos_x64
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew update
|
||||
brew install cmake \
|
||||
mbedtls zlib
|
||||
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
- name: Checkout parallel-gamecubewii repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
mkdir -p build && cd build
|
||||
cmake .. \
|
||||
-DLIBRETRO=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd ${{ env.core_id }}/build
|
||||
make -j$(sysctl -n hw.ncpu)
|
||||
cd ${{ env.core_id }}
|
||||
make -j$(sysctl -n hw.ncpu) platform=osx
|
||||
@@ -1,46 +1,21 @@
|
||||
name: Build Dolphin (libretro) on Ubuntu x64
|
||||
name: Build parallel_gamecubewii (libretro) on Ubuntu x64
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
core_id: parallel_gamecubewii_libretro
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: "Ubuntu x64"
|
||||
os: ubuntu-latest
|
||||
ZIP_NAME_SUFFIX: linux_x64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y cmake ninja-build pkg-config \
|
||||
libasound2-dev \
|
||||
libx11-dev libxi-dev libxrandr-dev libudev-dev libevdev-dev \
|
||||
libegl1-mesa-dev libgl1-mesa-dev \
|
||||
libmbedtls-dev libcurl4-openssl-dev zlib1g-dev
|
||||
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
- name: Checkout parallel-gamecubewii repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
mkdir -p build && cd build
|
||||
cmake .. \
|
||||
-DLIBRETRO=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd ${{ env.core_id }}/build
|
||||
cd ${{ env.core_id }}
|
||||
make -j$(nproc)
|
||||
@@ -1,49 +1,27 @@
|
||||
name: Build Dolphin (libretro) for Windows (MinGW on Ubuntu)
|
||||
name: Build parallel_gamecubewii (libretro) for Windows (MinGW on Ubuntu)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
core_id: parallel_gamecubewii_libretro
|
||||
|
||||
jobs:
|
||||
build-windows-mingw:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: ubuntu:25.10
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt update
|
||||
apt install -y git cmake ninja-build pkg-config \
|
||||
mingw-w64
|
||||
apt install -y git make mingw-w64
|
||||
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
- name: Checkout parallel-gamecubewii repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure (MinGW cross-compile)
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
export PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig
|
||||
export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/share/pkgconfig
|
||||
export PKG_CONFIG_SYSROOT_DIR=/usr/x86_64-w64-mingw32
|
||||
mkdir -p build && cd build
|
||||
cmake .. \
|
||||
-DLIBRETRO=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
|
||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
||||
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
|
||||
-DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres \
|
||||
-DCMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
-G Ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd ${{ env.core_id }}/build
|
||||
ninja -j$(nproc)
|
||||
cd ${{ env.core_id }}
|
||||
make -j$(nproc) CC=x86_64-w64-mingw32-gcc-posix CXX=x86_64-w64-mingw32-g++-posix
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Build Dolphin (libretro) on Windows (MSVC)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
core_id: dolphin_libretro
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
choco install cmake ninja git
|
||||
- name: Checkout Dolphin (libretro) repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ${{ env.core_id }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure (MSVC)
|
||||
run: |
|
||||
cd ${{ env.core_id }}
|
||||
mkdir build && cd build
|
||||
cmake .. -DLIBRETRO=ON -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 18 2026" -A x64
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build ${{ env.core_id }}/build --config Release --parallel
|
||||
@@ -6,8 +6,6 @@ Thumbs.db
|
||||
Externals/mGBA/version.c
|
||||
Source/Core/Common/scmrev.h
|
||||
# Ignore files output by build
|
||||
/cmake-build-debug
|
||||
/cmake-build-release
|
||||
/[Bb]uild*/
|
||||
/[Bb]inary*/
|
||||
/obj/
|
||||
@@ -26,8 +24,6 @@ Source/Core/Common/scmrev.h
|
||||
*.VC.db
|
||||
.vs*/
|
||||
/Source/enc_temp_folder/
|
||||
# Ignore build info file created by QtCreator
|
||||
CMakeLists.txt.user
|
||||
# Ignore files created by posix people
|
||||
*~
|
||||
# Ignore vim swapfiles
|
||||
@@ -46,8 +42,6 @@ CMakeLists.txt.user
|
||||
|
||||
# clangd cache for Neovim
|
||||
.cache/clangd
|
||||
# Ignore CMake user presets
|
||||
CMakeUserPresets.json
|
||||
# Ignore the libretro core built by the static Makefile
|
||||
/parallel_gamecubewii_libretro*.so
|
||||
/parallel_gamecubewii_libretro*.dll
|
||||
|
||||
+27
-45
@@ -8,45 +8,48 @@
|
||||
.core-defs:
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CORENAME: dolphin
|
||||
CORE_ARGS: -DLIBRETRO=ON -DENABLE_LTO=ON
|
||||
|
||||
CORENAME: parallel_gamecubewii
|
||||
|
||||
# Inclusion templates, required for the build to work
|
||||
include:
|
||||
################################## DESKTOPS ################################
|
||||
# Windows
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-cmake-mingw.yml'
|
||||
file: '/windows-x64-mingw.yml'
|
||||
|
||||
# Linux 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/linux-cmake.yml'
|
||||
file: '/linux-x64.yml'
|
||||
|
||||
# Linux ARM 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/linux-aarch64.yml'
|
||||
|
||||
# MacOS x64
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: 'osx-cmake-x86.yml'
|
||||
file: '/osx-x64.yml'
|
||||
|
||||
# MacOS arm64
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: 'osx-cmake-arm64.yml'
|
||||
file: '/osx-arm64.yml'
|
||||
|
||||
################################## CELLULAR ################################
|
||||
# Android
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/android-cmake.yml'
|
||||
file: '/android-make.yml'
|
||||
|
||||
# iOS arm64
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios-cmake.yml'
|
||||
file: '/ios-arm64.yml'
|
||||
|
||||
# tvOS arm64
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/tvos-cmake.yml'
|
||||
file: '/tvos-arm64.yml'
|
||||
|
||||
################################## MISC ####################################
|
||||
# webOS aarch64
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/webos-cmake.yml'
|
||||
file: '/webos-make.yml'
|
||||
|
||||
# Stages for building
|
||||
stages:
|
||||
@@ -61,20 +64,13 @@ stages:
|
||||
# Windows 64-bit
|
||||
libretro-build-windows-x64:
|
||||
extends:
|
||||
- .libretro-windows-cmake-x86_64
|
||||
- .libretro-windows-x64-mingw-make-default
|
||||
- .core-defs
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-mxe-win-cross-cores:gcc16
|
||||
variables:
|
||||
EXTRA_PATH: Binaries
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/5))
|
||||
- if builtin type -P ccache &> /dev/null; then ccache -V &> /dev/null; fi
|
||||
- mv /usr/lib/mxe/usr/x86_64-w64-mingw32.static/lib/libcurl.a .
|
||||
|
||||
# Linux 64-bit
|
||||
libretro-build-linux-x64:
|
||||
extends:
|
||||
- .libretro-linux-cmake-x86_64
|
||||
- .libretro-linux-x64-make-default
|
||||
- .core-defs
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-amd64-ubuntu:backports
|
||||
variables:
|
||||
@@ -84,7 +80,7 @@ libretro-build-linux-x64:
|
||||
# Linux ARM 64-bit
|
||||
libretro-build-linux-aarch64:
|
||||
extends:
|
||||
- .libretro-linux-cmake-aarch64
|
||||
- .libretro-linux-aarch64-make-default
|
||||
- .core-defs
|
||||
variables:
|
||||
CC: /usr/bin/gcc-14
|
||||
@@ -95,63 +91,49 @@ libretro-build-osx-x64:
|
||||
tags:
|
||||
- mac-apple-silicon
|
||||
extends:
|
||||
- .libretro-osx-cmake-x86
|
||||
- .libretro-osx-x64-make-default
|
||||
- .core-defs
|
||||
variables:
|
||||
CORE_ARGS: -DLIBRETRO=ON -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64
|
||||
arch: x86_64
|
||||
|
||||
# macOS arm64
|
||||
libretro-build-osx-arm64:
|
||||
extends:
|
||||
- .libretro-osx-cmake-arm64
|
||||
- .libretro-osx-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
################################### CELLULAR #################################
|
||||
# Android ARMv8a
|
||||
android-arm64-v8a:
|
||||
extends:
|
||||
- .libretro-android-cmake-arm64-v8a
|
||||
- .libretro-android-make-arm64-v8a
|
||||
- .core-defs
|
||||
|
||||
# Android ARMv7a (for play only)
|
||||
#android-armeabi-v7a:
|
||||
# extends:
|
||||
# - .libretro-android-cmake-armeabi-v7a
|
||||
# - .core-defs
|
||||
# variables:
|
||||
# API_LEVEL: 24
|
||||
# CORE_ARGS: -DLIBRETRO=ON -DENABLE_LTO=ON -DENABLE_GENERIC=ON
|
||||
|
||||
# Android x86_64 (for play only)
|
||||
android-x86_64:
|
||||
extends:
|
||||
- .libretro-android-cmake-x86_64
|
||||
- .libretro-android-make-x86_64
|
||||
- .core-defs
|
||||
variables:
|
||||
API_LEVEL: 24
|
||||
CORE_ARGS: -DLIBRETRO=ON -DENABLE_LTO=ON
|
||||
|
||||
# iOS arm64
|
||||
libretro-build-ios-arm64:
|
||||
extends:
|
||||
- .libretro-ios-cmake-arm64
|
||||
- .libretro-ios-arm64-make-default
|
||||
- .core-defs
|
||||
variables:
|
||||
CMAKE_ADDL_COMP_FLAGS: ""
|
||||
IOS_MINVER: 14.0
|
||||
IOS_MINVER: "14.0"
|
||||
|
||||
# tvOS arm64
|
||||
libretro-build-tvos-arm64:
|
||||
extends:
|
||||
- .libretro-tvos-cmake-arm64
|
||||
- .libretro-tvos-arm64-make-default
|
||||
- .core-defs
|
||||
variables:
|
||||
CMAKE_ADDL_COMP_FLAGS: ""
|
||||
MINVER: 14.0
|
||||
MINVER: "14.0"
|
||||
|
||||
################################## MISC ####################################
|
||||
# webOS aarch64
|
||||
libretro-build-webos-aarch64:
|
||||
extends:
|
||||
- .libretro-webos-cmake-aarch64
|
||||
- .libretro-webos-aarch64-make-default
|
||||
- .core-defs
|
||||
@@ -1,392 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
The current tooling supported in CMake, Homebrew, and Qt5 are insufficient for
|
||||
creating macOS universal binaries automatically for applications like Dolphin
|
||||
which have more complicated build requirements (like different libraries, build
|
||||
flags and source files for each target architecture).
|
||||
|
||||
So instead, this script manages the configuration and compilation of distinct
|
||||
builds and project files for each target architecture and then merges the two
|
||||
binaries into a single universal binary.
|
||||
|
||||
Running this script will:
|
||||
1) Generate Xcode project files for the ARM build (if project files don't
|
||||
already exist)
|
||||
2) Generate Xcode project files for the x64 build (if project files don't
|
||||
already exist)
|
||||
3) Build the ARM project for the selected build_target
|
||||
4) Build the x64 project for the selected build_target
|
||||
5) Generate universal .app packages combining the ARM and x64 packages
|
||||
6) Use the lipo tool to combine the binary objects inside each of the
|
||||
packages into universal binaries
|
||||
7) Code sign the final universal binaries using the specified
|
||||
codesign_identity
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import filecmp
|
||||
import glob
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
# The config variables listed below are the defaults, but they can be
|
||||
# overridden by command line arguments see parse_args(), or run:
|
||||
# BuildMacOSUniversalBinary.py --help
|
||||
DEFAULT_CONFIG = {
|
||||
|
||||
# Location of destination universal binary
|
||||
"dst_app": "universal/",
|
||||
# Build Target (dolphin-emu to just build the emulator and skip the tests)
|
||||
"build_target": "ALL_BUILD",
|
||||
|
||||
# Location for CMake to search for files (default is for homebrew)
|
||||
"arm64_cmake_prefix": "/opt/homebrew",
|
||||
"x86_64_cmake_prefix": "/usr/local",
|
||||
|
||||
# Locations to qt5 directories for arm and x64 libraries
|
||||
# The default values of these paths are taken from the default
|
||||
# paths used for homebrew
|
||||
"arm64_qt5_path": "/opt/homebrew/opt/qt5",
|
||||
"x86_64_qt5_path": "/usr/local/opt/qt5",
|
||||
|
||||
# Identity to use for code signing. "-" indicates that the app will not
|
||||
# be cryptographically signed/notarized but will instead just use a
|
||||
# SHA checksum to verify the integrity of the app. This doesn't
|
||||
# protect against malicious actors, but it does protect against
|
||||
# running corrupted binaries and allows for access to the extended
|
||||
# permissions needed for ARM builds
|
||||
"codesign_identity": "-",
|
||||
|
||||
# CMake Generator to use for building
|
||||
"generator": "Unix Makefiles",
|
||||
"build_type": "Release",
|
||||
|
||||
"run_unit_tests": False,
|
||||
|
||||
# Whether our autoupdate functionality is enabled or not.
|
||||
"autoupdate": True,
|
||||
|
||||
# Whether CCache is used for the build or not.
|
||||
"ccache": False,
|
||||
|
||||
# The distributor for this build.
|
||||
"distributor": "None"
|
||||
}
|
||||
|
||||
# Architectures to build for. This is explicitly left out of the command line
|
||||
# config options for several reasons:
|
||||
# 1) Adding new architectures will generally require more code changes
|
||||
# 2) Single architecture builds should utilize the normal generated cmake
|
||||
# project files rather than this wrapper script
|
||||
|
||||
ARCHITECTURES = ["x86_64", "arm64"]
|
||||
|
||||
|
||||
def parse_args(conf=DEFAULT_CONFIG):
|
||||
"""
|
||||
Parses the command line arguments into a config dictionary.
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
||||
parser.add_argument(
|
||||
"--target",
|
||||
help="Build target in generated project files",
|
||||
default=conf["build_target"],
|
||||
dest="build_target")
|
||||
parser.add_argument(
|
||||
"-G",
|
||||
help="CMake Generator to use for creating project files",
|
||||
default=conf["generator"],
|
||||
dest="generator")
|
||||
parser.add_argument(
|
||||
"--build_type",
|
||||
help="CMake build type [Debug, Release, RelWithDebInfo, MinSizeRel]",
|
||||
default=conf["build_type"],
|
||||
dest="build_type")
|
||||
parser.add_argument(
|
||||
"--dst_app",
|
||||
help="Directory where universal binary will be stored",
|
||||
default=conf["dst_app"])
|
||||
|
||||
parser.add_argument("--run_unit_tests", action="store_true",
|
||||
default=conf["run_unit_tests"])
|
||||
|
||||
parser.add_argument(
|
||||
"--autoupdate",
|
||||
help="Enables our autoupdate functionality",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=conf["autoupdate"])
|
||||
|
||||
parser.add_argument(
|
||||
"--ccache",
|
||||
help="Enables CCache",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=conf["ccache"])
|
||||
|
||||
parser.add_argument(
|
||||
"--distributor",
|
||||
help="Sets the distributor for this build",
|
||||
default=conf["distributor"])
|
||||
|
||||
parser.add_argument(
|
||||
"--codesign",
|
||||
help="Code signing identity to use to sign the applications",
|
||||
default=conf["codesign_identity"],
|
||||
dest="codesign_identity")
|
||||
|
||||
for arch in ARCHITECTURES:
|
||||
parser.add_argument(
|
||||
f"--{arch}_cmake_prefix",
|
||||
help="Folder for cmake to search for packages",
|
||||
default=conf[arch+"_cmake_prefix"],
|
||||
dest=arch+"_cmake_prefix")
|
||||
|
||||
parser.add_argument(
|
||||
f"--{arch}_qt5_path",
|
||||
help=f"Install path for {arch} qt5 libraries",
|
||||
default=conf[arch+"_qt5_path"])
|
||||
|
||||
return vars(parser.parse_args())
|
||||
|
||||
|
||||
def lipo(path0, path1, dst):
|
||||
if subprocess.call(["lipo", "-create", "-output", dst, path0, path1]) != 0:
|
||||
print(f"WARNING: {path0} and {path1} cannot be lipo'd")
|
||||
|
||||
shutil.copy(path0, dst)
|
||||
|
||||
|
||||
def recursive_merge_binaries(src0, src1, dst):
|
||||
"""
|
||||
Merges two build trees together for different architectures into a single
|
||||
universal binary.
|
||||
|
||||
The rules for merging are:
|
||||
|
||||
1) Files that exist in either src tree are copied into the dst tree
|
||||
2) Files that exist in both trees and are identical are copied over
|
||||
unmodified
|
||||
3) Files that exist in both trees and are non-identical are lipo'd
|
||||
4) Symlinks are created in the destination tree to mirror the hierarchy in
|
||||
the source trees
|
||||
"""
|
||||
|
||||
# Check that all files present in the folder are of the same type and that
|
||||
# links link to the same relative location
|
||||
for newpath0 in glob.glob(src0+"/*"):
|
||||
filename = os.path.basename(newpath0)
|
||||
newpath1 = os.path.join(src1, filename)
|
||||
if not os.path.exists(newpath1):
|
||||
continue
|
||||
|
||||
if os.path.islink(newpath0) and os.path.islink(newpath1):
|
||||
if os.path.relpath(newpath0, src0) == os.path.relpath(newpath1, src1):
|
||||
continue
|
||||
|
||||
if os.path.isdir(newpath0) and os.path.isdir(newpath1):
|
||||
continue
|
||||
|
||||
# isfile() can be true for links so check that both are not links
|
||||
# before checking if they are both files
|
||||
if (not os.path.islink(newpath0)) and (not os.path.islink(newpath1)):
|
||||
if os.path.isfile(newpath0) and os.path.isfile(newpath1):
|
||||
continue
|
||||
|
||||
raise Exception(f"{newpath0} and {newpath1} cannot be " +
|
||||
"merged into a universal binary because they are of " +
|
||||
"incompatible types. Perhaps the installed libraries" +
|
||||
" are from different versions for each architecture")
|
||||
|
||||
for newpath0 in glob.glob(src0+"/*"):
|
||||
filename = os.path.basename(newpath0)
|
||||
newpath1 = os.path.join(src1, filename)
|
||||
new_dst_path = os.path.join(dst, filename)
|
||||
if os.path.islink(newpath0):
|
||||
# Symlinks will be fixed after files are resolved
|
||||
continue
|
||||
|
||||
if not os.path.exists(newpath1):
|
||||
if os.path.isdir(newpath0):
|
||||
shutil.copytree(newpath0, new_dst_path)
|
||||
else:
|
||||
shutil.copy(newpath0, new_dst_path)
|
||||
|
||||
continue
|
||||
|
||||
if os.path.isdir(newpath1):
|
||||
os.mkdir(new_dst_path)
|
||||
recursive_merge_binaries(newpath0, newpath1, new_dst_path)
|
||||
continue
|
||||
|
||||
if filecmp.cmp(newpath0, newpath1):
|
||||
shutil.copy(newpath0, new_dst_path)
|
||||
else:
|
||||
lipo(newpath0, newpath1, new_dst_path)
|
||||
|
||||
# Loop over files in src1 and copy missing things over to dst
|
||||
for newpath1 in glob.glob(src1+"/*"):
|
||||
filename = os.path.basename(newpath1)
|
||||
newpath0 = os.path.join(src0, filename)
|
||||
new_dst_path = os.path.join(dst, filename)
|
||||
if (not os.path.exists(newpath0)) and (not os.path.islink(newpath1)):
|
||||
if os.path.isdir(newpath1):
|
||||
shutil.copytree(newpath1, new_dst_path)
|
||||
else:
|
||||
shutil.copy(newpath1, new_dst_path)
|
||||
|
||||
# Fix up symlinks for path0
|
||||
for newpath0 in glob.glob(src0+"/*"):
|
||||
filename = os.path.basename(newpath0)
|
||||
new_dst_path = os.path.join(dst, filename)
|
||||
if os.path.islink(newpath0):
|
||||
relative_path = os.path.relpath(os.path.realpath(newpath0), src0)
|
||||
os.symlink(relative_path, new_dst_path)
|
||||
# Fix up symlinks for path1
|
||||
for newpath1 in glob.glob(src1+"/*"):
|
||||
filename = os.path.basename(newpath1)
|
||||
new_dst_path = os.path.join(dst, filename)
|
||||
newpath0 = os.path.join(src0, filename)
|
||||
if os.path.islink(newpath1) and not os.path.exists(newpath0):
|
||||
relative_path = os.path.relpath(os.path.realpath(newpath1), src1)
|
||||
os.symlink(relative_path, new_dst_path)
|
||||
|
||||
def python_to_cmake_bool(boolean):
|
||||
return "ON" if boolean else "OFF"
|
||||
|
||||
def build(config):
|
||||
"""
|
||||
Builds the project with the parameters specified in config.
|
||||
"""
|
||||
|
||||
print("Building config:")
|
||||
print(json.dumps(config, indent=4))
|
||||
|
||||
# Configure and build single architecture builds for each architecture
|
||||
for arch in ARCHITECTURES:
|
||||
if not os.path.exists(arch):
|
||||
os.mkdir(arch)
|
||||
|
||||
# Place Qt on the prefix path.
|
||||
prefix_path = config[arch+"_qt5_path"]+';'+config[arch+"_cmake_prefix"]
|
||||
|
||||
env = os.environ.copy()
|
||||
env["CMAKE_OSX_ARCHITECTURES"] = arch
|
||||
env["CMAKE_PREFIX_PATH"] = prefix_path
|
||||
|
||||
# Add the other architecture's prefix path to the ignore path so that
|
||||
# CMake doesn't try to pick up the wrong architecture's libraries when
|
||||
# cross compiling.
|
||||
ignore_path = ""
|
||||
for a in ARCHITECTURES:
|
||||
if a != arch:
|
||||
ignore_path = config[a+"_cmake_prefix"]
|
||||
|
||||
subprocess.check_call([
|
||||
"cmake", "../../", "-G", config["generator"],
|
||||
"-DCMAKE_BUILD_TYPE=" + config["build_type"],
|
||||
'-DCMAKE_CXX_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"',
|
||||
'-DCMAKE_C_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"',
|
||||
# System name needs to be specified for CMake to use
|
||||
# the specified CMAKE_SYSTEM_PROCESSOR
|
||||
"-DCMAKE_SYSTEM_NAME=Darwin",
|
||||
"-DCMAKE_PREFIX_PATH="+prefix_path,
|
||||
"-DCMAKE_SYSTEM_PROCESSOR="+arch,
|
||||
"-DCMAKE_IGNORE_PATH="+ignore_path,
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0.0",
|
||||
"-DMACOS_CODE_SIGNING_IDENTITY="
|
||||
+ config["codesign_identity"],
|
||||
'-DMACOS_CODE_SIGNING="ON"',
|
||||
"-DENABLE_AUTOUPDATE="
|
||||
+ python_to_cmake_bool(config["autoupdate"]),
|
||||
'-DDISTRIBUTOR=' + config['distributor'],
|
||||
# Distributable bundles need to be postprocessed to embed dependencies
|
||||
"-DPOSTPROCESS_BUNDLE=ON",
|
||||
# Always use libraries from Externals to prevent any libraries
|
||||
# installed by Homebrew from leaking in to the app
|
||||
"-DUSE_SYSTEM_LIBS=OFF",
|
||||
# However, we should still use the macOS provided versions of
|
||||
# iconv, bzip2, and curl
|
||||
"-DUSE_SYSTEM_ICONV=ON",
|
||||
"-DUSE_SYSTEM_BZIP2=ON",
|
||||
"-DUSE_SYSTEM_CURL=ON",
|
||||
"-DENABLE_CCACHE="
|
||||
+ python_to_cmake_bool(config["ccache"]),
|
||||
],
|
||||
env=env, cwd=arch)
|
||||
|
||||
threads = multiprocessing.cpu_count()
|
||||
subprocess.check_call(["cmake", "--build", ".",
|
||||
"--config", config["build_type"],
|
||||
"--parallel", f"{threads}"], cwd=arch)
|
||||
|
||||
dst_app = config["dst_app"]
|
||||
|
||||
if os.path.exists(dst_app):
|
||||
shutil.rmtree(dst_app)
|
||||
|
||||
# Create and codesign the universal binary/
|
||||
os.mkdir(dst_app)
|
||||
|
||||
# Source binary trees to merge together
|
||||
src_app0 = ARCHITECTURES[0]+"/Binaries/"
|
||||
src_app1 = ARCHITECTURES[1]+"/Binaries/"
|
||||
|
||||
recursive_merge_binaries(src_app0, src_app1, dst_app)
|
||||
|
||||
if config["autoupdate"]:
|
||||
subprocess.check_call([
|
||||
"../Tools/mac-codesign.sh",
|
||||
"-t",
|
||||
"-e", "preserve",
|
||||
config["codesign_identity"],
|
||||
dst_app+"/Dolphin.app/Contents/Helpers/Dolphin Updater.app"])
|
||||
|
||||
subprocess.check_call([
|
||||
"../Tools/mac-codesign.sh",
|
||||
"-t",
|
||||
"-e", "preserve",
|
||||
config["codesign_identity"],
|
||||
dst_app+"/Dolphin.app"])
|
||||
|
||||
print("Built Universal Binary successfully!")
|
||||
|
||||
# Build and run unit tests for each architecture
|
||||
unit_test_results = {}
|
||||
if config["run_unit_tests"]:
|
||||
for arch in ARCHITECTURES:
|
||||
if not os.path.exists(arch):
|
||||
os.mkdir(arch)
|
||||
|
||||
print(f"Building and running unit tests for: {arch}")
|
||||
unit_test_results[arch] = \
|
||||
subprocess.call(["cmake", "--build", ".",
|
||||
"--config", config["build_type"],
|
||||
"--target", "unittests",
|
||||
"--parallel", f"{threads}"], cwd=arch)
|
||||
|
||||
passed_unit_tests = True
|
||||
for a in unit_test_results:
|
||||
code = unit_test_results[a]
|
||||
passed = code == 0
|
||||
|
||||
status_string = "PASSED"
|
||||
if not passed:
|
||||
passed_unit_tests = False
|
||||
status_string = f"FAILED ({code})"
|
||||
|
||||
print(a + " Unit Tests: " + status_string)
|
||||
|
||||
if not passed_unit_tests:
|
||||
exit(-1)
|
||||
|
||||
print("Passed all unit tests")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
conf = parse_args()
|
||||
build(conf)
|
||||
@@ -1,13 +0,0 @@
|
||||
find_program(CCACHE_BIN NAMES ccache sccache)
|
||||
if(CCACHE_BIN)
|
||||
set(_CCACHE_SUPPORTED_LAUCHERS C CXX OBJC OBJCXX)
|
||||
foreach(LAUNCHER ${_CCACHE_SUPPORTED_LAUCHERS})
|
||||
if (NOT CMAKE_${LAUNCHER}_COMPILER_LAUNCHER MATCHES "ccache")
|
||||
list(INSERT CMAKE_${LAUNCHER}_COMPILER_LAUNCHER 0 ${CCACHE_BIN})
|
||||
endif()
|
||||
# ccache uses -I when compiling without preprocessor, which makes clang complain.
|
||||
if("${CMAKE_${LAUNCHER}_COMPILER_ID}" MATCHES "Clang")
|
||||
set(CMAKE_${LAUNCHER}_FLAGS "${CMAKE_${LAUNCHER}_FLAGS} -Qunused-arguments -fcolor-diagnostics")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
@@ -1,58 +0,0 @@
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# check_add_add_flag(<variable> <flag> [DEBUG_ONLY | RELEASE_ONLY])
|
||||
#
|
||||
# Add a C or C++ compilation flag to the current scope
|
||||
#
|
||||
# Can optionally add the flag to Debug or Release configurations only, use this when
|
||||
# targeting multi-configuration generators like Visual Studio or Xcode.
|
||||
# Release configurations means NOT Debug, so it will work for RelWithDebInfo or MinSizeRel too.
|
||||
#
|
||||
# If the flag is added successfully, the variables FLAG_C_<variable> and FLAG_CXX_<variable>
|
||||
# may be set to ON.
|
||||
#
|
||||
# Examples:
|
||||
# check_and_add_flag(FOO -foo)
|
||||
# check_and_add_flag(ONLYDEBUG -onlydebug DEBUG_ONLY)
|
||||
# check_and_add_flag(OPTMAX -O9001 RELEASE_ONLY)
|
||||
|
||||
function(check_and_add_flag var flag)
|
||||
set(genexp_config_test "1")
|
||||
if(ARGV2 STREQUAL "DEBUG_ONLY")
|
||||
set(genexp_config_test "$<CONFIG:Debug>")
|
||||
elseif(ARGV2 STREQUAL "NO_DEBINFO_ONLY")
|
||||
set(genexp_config_test "$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>>")
|
||||
elseif(ARGV2 STREQUAL "RELEASE_ONLY")
|
||||
set(genexp_config_test "$<NOT:$<CONFIG:Debug>>")
|
||||
elseif(ARGV2)
|
||||
message(FATAL_ERROR "check_and_add_flag called with incorrect arguments: ${ARGN}")
|
||||
endif()
|
||||
|
||||
set(is_c "$<COMPILE_LANGUAGE:C>")
|
||||
set(is_cxx "$<COMPILE_LANGUAGE:CXX>")
|
||||
set(test_flags_c)
|
||||
set(test_flags_cxx)
|
||||
|
||||
# The Visual Studio generators don't support COMPILE_LANGUAGE
|
||||
# So we fail all the C flags and only actually test CXX ones
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(is_c "0")
|
||||
set(is_cxx "1")
|
||||
else()
|
||||
# Otherwise assume the compile follows GCC syntax
|
||||
# and fail when the option is known but invalid.
|
||||
set(test_flags_c "${test_flags_c}-Werror ")
|
||||
set(test_flags_cxx "${test_flags_cxx}-Werror ")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag("${test_flags_c}${flag}" FLAG_C_${var})
|
||||
if(FLAG_C_${var})
|
||||
add_compile_options("$<$<AND:${is_c},${genexp_config_test}>:${flag}>")
|
||||
endif()
|
||||
|
||||
check_cxx_compiler_flag("${test_flags_cxx}${flag}" FLAG_CXX_${var})
|
||||
if(FLAG_CXX_${var})
|
||||
add_compile_options("$<$<AND:${is_cxx},${genexp_config_test}>:${flag}>")
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,58 +0,0 @@
|
||||
find_package(PkgConfig)
|
||||
|
||||
macro(_internal_message msg)
|
||||
if(NOT ${_is_quiet})
|
||||
message(STATUS "${msg}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(check_lib var pc lib)
|
||||
set(_is_required 0)
|
||||
set(_is_quiet 0)
|
||||
set(_arg_list ${ARGN})
|
||||
foreach(_arg ${ARGN})
|
||||
if(_arg STREQUAL "REQUIRED")
|
||||
list(REMOVE_ITEM _arg_list "REQUIRED")
|
||||
set(_is_required 1)
|
||||
endif()
|
||||
if(_arg STREQUAL "QUIET")
|
||||
list(REMOVE_ITEM _arg_list "QUIET")
|
||||
set(_is_quiet 1)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
|
||||
pkg_search_module(${var} QUIET ${pc})
|
||||
endif()
|
||||
|
||||
if(${var}_FOUND)
|
||||
if(${var}_INCLUDE_DIRS)
|
||||
include_directories(${${var}_INCLUDE_DIRS})
|
||||
endif()
|
||||
# Make sure include directories for headers found using find_path below
|
||||
# are re-added when reconfiguring
|
||||
if(${var}_INCLUDE)
|
||||
include_directories(${${var}_INCLUDE})
|
||||
endif()
|
||||
_internal_message("${lib} found")
|
||||
else()
|
||||
find_library(${var} ${lib})
|
||||
if(_arg_list)
|
||||
find_path(${var}_INCLUDE ${_arg_list})
|
||||
else()
|
||||
set(${var}_INCLUDE FALSE)
|
||||
endif()
|
||||
if(${var} AND ${var}_INCLUDE)
|
||||
include_directories(${${var}_INCLUDE})
|
||||
_internal_message("${lib} found")
|
||||
set(${var}_FOUND 1 CACHE INTERNAL "")
|
||||
else()
|
||||
if(_is_required)
|
||||
message(FATAL_ERROR "${lib} is required but not found")
|
||||
else()
|
||||
_internal_message("${lib} not found")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Add C or C++ compile definitions to the current scope
|
||||
#
|
||||
# dolphin_compile_definitions(def [def ...] [DEBUG_ONLY | RELEASE_ONLY])
|
||||
#
|
||||
# Can optionally add the definitions to Debug or Release configurations only, use this so we can
|
||||
# target multi-configuration generators like Visual Studio or Xcode.
|
||||
# Release configurations means NOT Debug, so it will work for RelWithDebInfo or MinSizeRel too.
|
||||
# The definitions are added to the COMPILE_DEFINITIONS folder property.
|
||||
# Supports generator expressions, unlike add_definitions()
|
||||
#
|
||||
# Examples:
|
||||
# dolphin_compile_definitions(FOO) -> -DFOO
|
||||
# dolphin_compile_definitions(_DEBUG DEBUG_ONLY) -> -D_DEBUG
|
||||
# dolphin_compile_definitions(NDEBUG RELEASE_ONLY) -> -DNDEBUG
|
||||
# dolphin_compile_definitions($<$<COMPILE_LANGUAGE:C>:THISISONLYFORC>)
|
||||
|
||||
function(dolphin_compile_definitions)
|
||||
set(defs ${ARGN})
|
||||
|
||||
list(GET defs -1 last_def)
|
||||
list(REMOVE_AT defs -1)
|
||||
|
||||
set(genexp_config_test "1")
|
||||
if(last_def STREQUAL "DEBUG_ONLY")
|
||||
set(genexp_config_test "$<CONFIG:Debug>")
|
||||
elseif(last_def STREQUAL "RELEASE_ONLY")
|
||||
set(genexp_config_test "$<NOT:$<CONFIG:Debug>>")
|
||||
else()
|
||||
list(APPEND defs ${last_def})
|
||||
endif()
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
"$<${genexp_config_test}:${defs}>")
|
||||
endfunction()
|
||||
@@ -1,20 +0,0 @@
|
||||
include(RemoveCompileFlag)
|
||||
|
||||
macro(dolphin_disable_warnings _target)
|
||||
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
|
||||
if (_target_cxx_flags)
|
||||
set(new_flags "")
|
||||
foreach(flag IN LISTS _target_cxx_flags)
|
||||
# all warning flags start with "/W" or "/w" or "-W" or "-w"
|
||||
if (NOT "${flag}" MATCHES "^[-/][Ww]")
|
||||
list(APPEND new_flags "${flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${new_flags}")
|
||||
endif()
|
||||
if (MSVC)
|
||||
target_compile_options(${_target} PRIVATE "/W0")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(${_target} PRIVATE "-w")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,24 +0,0 @@
|
||||
function(dolphin_inject_version_info target)
|
||||
set(INFO_PLIST_PATH "$<TARGET_BUNDLE_DIR:${target}>/Contents/Info.plist")
|
||||
add_custom_command(TARGET ${target}
|
||||
POST_BUILD
|
||||
|
||||
COMMAND /usr/libexec/PlistBuddy -c
|
||||
"Delete :CFBundleShortVersionString"
|
||||
"${INFO_PLIST_PATH}"
|
||||
|| true
|
||||
|
||||
COMMAND /usr/libexec/PlistBuddy -c
|
||||
"Delete :CFBundleLongVersionString"
|
||||
"${INFO_PLIST_PATH}"
|
||||
|| true
|
||||
|
||||
COMMAND /usr/libexec/PlistBuddy -c
|
||||
"Delete :CFBundleVersion"
|
||||
"${INFO_PLIST_PATH}"
|
||||
|| true
|
||||
|
||||
COMMAND /usr/libexec/PlistBuddy -c
|
||||
"Merge '${CMAKE_BINARY_DIR}/Source/Core/VersionInfo.plist'"
|
||||
"${INFO_PLIST_PATH}")
|
||||
endfunction()
|
||||
@@ -1,171 +0,0 @@
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CheckCXXSymbolExists)
|
||||
|
||||
# like add_library(new ALIAS old) but avoids add_library cannot create ALIAS target "new" because target "old" is imported but not globally visible. on older cmake
|
||||
# This can be replaced with a direct alias call once our minimum is cmake 3.18
|
||||
function(dolphin_alias_library new old)
|
||||
string(REPLACE "::" "" library_no_namespace ${old})
|
||||
if (NOT TARGET _alias_${library_no_namespace})
|
||||
add_library(_alias_${library_no_namespace} INTERFACE)
|
||||
target_link_libraries(_alias_${library_no_namespace} INTERFACE ${old})
|
||||
endif()
|
||||
add_library(${new} ALIAS _alias_${library_no_namespace})
|
||||
endfunction()
|
||||
|
||||
# Makes an imported target if it doesn't exist. Useful for when find scripts from older versions of cmake don't make the targets you need
|
||||
function(dolphin_make_imported_target_if_missing target lib)
|
||||
if(${lib}_FOUND AND NOT TARGET ${target})
|
||||
add_library(_${lib} INTERFACE)
|
||||
target_link_libraries(_${lib} INTERFACE "${${lib}_LIBRARIES}")
|
||||
target_include_directories(_${lib} INTERFACE "${${lib}_INCLUDE_DIRS}")
|
||||
add_library(${target} ALIAS _${lib})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(dolphin_optional_system_library out_use_system library)
|
||||
string(TOUPPER ${library} upperlib)
|
||||
set(USE_SYSTEM_${upperlib} "" CACHE STRING "Use system ${library} instead of bundled. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled, blank - Delegate to USE_SYSTEM_LIBS. Default is blank.")
|
||||
if("${USE_SYSTEM_${upperlib}}" STREQUAL "")
|
||||
if(APPROVED_VENDORED_DEPENDENCIES)
|
||||
string(TOLOWER ${library} lowerlib)
|
||||
if(lowerlib IN_LIST APPROVED_VENDORED_DEPENDENCIES)
|
||||
set(${out_use_system} AUTO PARENT_SCOPE)
|
||||
else()
|
||||
set(${out_use_system} ON PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
set(${out_use_system} ${USE_SYSTEM_LIBS} PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
set(${out_use_system} ${USE_SYSTEM_${upperlib}} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(dolphin_add_bundled_library library use_system bundled_path)
|
||||
if (${use_system} STREQUAL "AUTO")
|
||||
message(STATUS "No system ${library} was found. Using static ${library} from Externals.")
|
||||
else()
|
||||
message(STATUS "Using static ${library} from Externals")
|
||||
endif()
|
||||
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${bundled_path}/CMakeLists.txt")
|
||||
message(FATAL_ERROR "No bundled ${library} was found. Did you forget to checkout submodules?")
|
||||
endif()
|
||||
add_subdirectory(${bundled_path} EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
function(dolphin_set_library_type library type)
|
||||
if(DEFINED ${library}_TYPE AND NOT ${${library}_TYPE} STREQUAL "${type}")
|
||||
message(FATAL_ERROR
|
||||
"The selection for ${library} changed from '${${library}_TYPE}' to '${type}' after configuration.\n"
|
||||
"Please delete the build directory (or at least CMakeCache.txt) and reconfigure."
|
||||
)
|
||||
endif()
|
||||
|
||||
set(${library}_TYPE "${type}" CACHE INTERNAL "")
|
||||
endfunction()
|
||||
|
||||
function(dolphin_find_optional_system_library library bundled_path)
|
||||
dolphin_optional_system_library(use_system ${library})
|
||||
string(TOUPPER ${library} upperlib)
|
||||
if(use_system)
|
||||
# Try a list of versions
|
||||
# Will be obsoleted if cmake ever fixes https://gitlab.kitware.com/cmake/cmake/-/issues/26477
|
||||
if("DOLPHIN_TRY_VERSIONS" IN_LIST ARGN)
|
||||
list(FIND ARGN DOLPHIN_TRY_VERSIONS versions_idx)
|
||||
list(REMOVE_AT ARGN ${versions_idx})
|
||||
# Extract list of version-like elements from ARGN into version_list
|
||||
set(version_list)
|
||||
while(TRUE)
|
||||
list(LENGTH ARGN len)
|
||||
if(len EQUAL versions_idx)
|
||||
break()
|
||||
endif()
|
||||
LIST(GET ARGN ${versions_idx} ver)
|
||||
if(ver MATCHES "^[0-9]+(\\.[0-9]+)*$")
|
||||
list(APPEND version_list "${ver}")
|
||||
list(REMOVE_AT ARGN ${versions_idx})
|
||||
else()
|
||||
break()
|
||||
endif()
|
||||
endwhile()
|
||||
# Quietly check all the listed versions
|
||||
foreach(version IN LISTS version_list)
|
||||
find_package(${library} ${version} ${ARGN} QUIET)
|
||||
if(${library}_FOUND)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
# If none were found, find_package one version loudly so the user sees
|
||||
if(NOT ${library}_FOUND)
|
||||
list(GET version_list 0 first_version)
|
||||
find_package(${library} ${first_version} ${ARGN})
|
||||
endif()
|
||||
else()
|
||||
find_package(${library} ${ARGN})
|
||||
endif()
|
||||
|
||||
# Yay for cmake packages being inconsistent
|
||||
if(DEFINED ${library}_FOUND)
|
||||
set(prefix ${library})
|
||||
else()
|
||||
set(prefix ${upperlib})
|
||||
endif()
|
||||
if((NOT ${prefix}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
|
||||
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
||||
endif()
|
||||
endif()
|
||||
if(${prefix}_FOUND)
|
||||
dolphin_set_library_type(${library} "System")
|
||||
message(STATUS "Using system ${library}")
|
||||
else()
|
||||
dolphin_set_library_type(${library} "Bundled")
|
||||
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(dolphin_find_optional_system_library_pkgconfig library search alias bundled_path)
|
||||
dolphin_optional_system_library(use_system ${library})
|
||||
string(TOUPPER ${library} upperlib)
|
||||
if(use_system)
|
||||
pkg_search_module(${library} ${search} ${ARGN} IMPORTED_TARGET)
|
||||
if((NOT ${library}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
|
||||
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
||||
endif()
|
||||
endif()
|
||||
if(${library}_FOUND)
|
||||
dolphin_set_library_type(${library} "System")
|
||||
message(STATUS "Using system ${library}")
|
||||
dolphin_alias_library(${alias} PkgConfig::${library})
|
||||
else()
|
||||
dolphin_set_library_type(${library} "Bundled")
|
||||
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(dolphin_check_toolset_version LABEL VERSION_VAR MIN_VERSION)
|
||||
if(NOT DEFINED ${VERSION_VAR})
|
||||
return()
|
||||
endif()
|
||||
message(STATUS "Using ${LABEL} ${${VERSION_VAR}}")
|
||||
if(${VERSION_VAR} VERSION_LESS ${MIN_VERSION})
|
||||
message(FATAL_ERROR "Requires ${LABEL} ${MIN_VERSION} or higher")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(dolphin_check_std_version LABEL VERSION_MACRO MIN_VERSION)
|
||||
check_cxx_symbol_exists(${VERSION_MACRO} version IS_${LABEL})
|
||||
if(NOT IS_${LABEL})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include <version>
|
||||
#if ${VERSION_MACRO} < ${MIN_VERSION}
|
||||
#error
|
||||
#endif
|
||||
int main(){}
|
||||
]] HAS_MINIMUM_${LABEL})
|
||||
if(NOT HAS_MINIMUM_${LABEL})
|
||||
message(FATAL_ERROR "Requires ${LABEL} ${MIN_VERSION} or higher")
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,45 +0,0 @@
|
||||
# This module can be used in two different ways.
|
||||
#
|
||||
# When invoked as `cmake -P DolphinPostprocessBundle.cmake`, it fixes up an
|
||||
# application folder to be standalone. It bundles all required libraries from
|
||||
# the system and fixes up library IDs. Any additional shared libraries, like
|
||||
# plugins, that are found under Contents/MacOS/ will be made standalone as well.
|
||||
#
|
||||
# When called with `include(DolphinPostprocessBundle)`, it defines a helper
|
||||
# function `dolphin_postprocess_bundle` that sets up the command form of the
|
||||
# module as a post-build step.
|
||||
|
||||
if(CMAKE_GENERATOR)
|
||||
# Being called as include(DolphinPostprocessBundle), so define a helper function.
|
||||
set(_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION "${CMAKE_CURRENT_LIST_FILE}")
|
||||
function(dolphin_postprocess_bundle target)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} "-D" "DOLPHIN_BUNDLE_PATH=$<TARGET_BUNDLE_DIR:${target}>"
|
||||
-P "${_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION}"
|
||||
)
|
||||
endfunction()
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "Fixing up application bundle: ${DOLPHIN_BUNDLE_PATH}")
|
||||
|
||||
# Make sure to fix up any additional shared libraries (like plugins) that are
|
||||
# needed.
|
||||
file(GLOB_RECURSE extra_libs "${DOLPHIN_BUNDLE_PATH}/Contents/MacOS/*.dylib")
|
||||
|
||||
# BundleUtilities doesn't support DYLD_FALLBACK_LIBRARY_PATH behavior, which
|
||||
# makes it sometimes break on libraries that do weird things with @rpath. Specify
|
||||
# equivalent search directories until https://gitlab.kitware.com/cmake/cmake/issues/16625
|
||||
# is fixed and in our minimum CMake version.
|
||||
set(extra_dirs "/usr/local/lib" "/lib" "/usr/lib")
|
||||
|
||||
# BundleUtilities is overly verbose, so disable most of its messages
|
||||
function(message)
|
||||
if(NOT ARGV MATCHES "^STATUS;")
|
||||
_message(${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include(BundleUtilities)
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
fixup_bundle("${DOLPHIN_BUNDLE_PATH}" "${extra_libs}" "${extra_dirs}")
|
||||
@@ -1,20 +0,0 @@
|
||||
if(NOT DEFINED target OR NOT DEFINED link)
|
||||
message(FATAL_ERROR "`target` and `link` must be defined")
|
||||
endif()
|
||||
|
||||
file(CREATE_LINK "${target}" "${link}" RESULT result SYMBOLIC)
|
||||
if(result EQUAL 0)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(hint "On Windows, enable Developer Mode to allow symlinks (https://learn.microsoft.com/windows/advanced-settings/developer-mode).")
|
||||
endif()
|
||||
message(WARNING "Symlink failed (${result}). Falling back to copying. ${hint}")
|
||||
|
||||
file(REMOVE_RECURSE "${link}")
|
||||
if(IS_DIRECTORY "${target}")
|
||||
file(COPY "${target}/." DESTINATION "${link}")
|
||||
else()
|
||||
file(COPY_FILE "${target}" "${link}" ONLY_IF_DIFFERENT)
|
||||
endif()
|
||||
@@ -1,50 +0,0 @@
|
||||
set(ARCH "generic" CACHE STRING "Target architecture")
|
||||
|
||||
set(VALID_ARCHS x86_64 arm64 generic)
|
||||
if(NOT ARCH IN_LIST VALID_ARCHS)
|
||||
message(FATAL_ERROR "Invalid ARCH='${ARCH}'. Valid: ${VALID_ARCHS}")
|
||||
endif()
|
||||
|
||||
if(ARCH STREQUAL "generic")
|
||||
set(ENABLE_GENERIC "ON")
|
||||
else()
|
||||
set(CMAKE_SYSTEM_PROCESSOR "${ARCH}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED CMAKE_SYSTEM_NAME)
|
||||
if(EXISTS "${CMAKE_SYSROOT}/usr/include/linux")
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/Windows/System32")
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/System/Library")
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/usr/include/osreldate.h")
|
||||
set(CMAKE_SYSTEM_NAME FreeBSD)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/usr/include/c++/v1/__locale_dir/locale_base_api/openbsd.h")
|
||||
set(CMAKE_SYSTEM_NAME OpenBSD)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/usr/include/dev/dm/netbsd-dm.h")
|
||||
set(CMAKE_SYSTEM_NAME NetBSD)
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/boot/system/develop")
|
||||
set(CMAKE_SYSTEM_NAME Haiku)
|
||||
else()
|
||||
message(WARNING "Cannot detect OS from sysroot '${CMAKE_SYSROOT}/'. Cross-compilation has been disabled.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH "${CMAKE_SYSROOT}")
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
if(NOT QT_HOST_PATH)
|
||||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
|
||||
if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64")
|
||||
set(QT_HOST_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/x64")
|
||||
else()
|
||||
set(QT_HOST_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/ARM64")
|
||||
endif()
|
||||
else()
|
||||
set(QT_HOST_PATH "/usr")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,59 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindALSA
|
||||
# --------
|
||||
#
|
||||
# Find alsa
|
||||
#
|
||||
# Find the alsa libraries (asound)
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# This module defines the following variables:
|
||||
# ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
|
||||
# ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
|
||||
# ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
|
||||
# ALSA_LIBRARY - the asound library
|
||||
# ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
|
||||
|
||||
find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
|
||||
DOC "The ALSA (asound) include directory"
|
||||
)
|
||||
|
||||
find_library(ALSA_LIBRARY NAMES asound
|
||||
DOC "The ALSA (asound) library"
|
||||
)
|
||||
|
||||
if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
|
||||
file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"")
|
||||
|
||||
string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}")
|
||||
unset(alsa_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
|
||||
REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
|
||||
VERSION_VAR ALSA_VERSION_STRING)
|
||||
|
||||
if(ALSA_FOUND)
|
||||
set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
|
||||
set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
|
||||
if(NOT TARGET ALSA::ALSA)
|
||||
add_library(ALSA::ALSA UNKNOWN IMPORTED)
|
||||
set_target_properties(ALSA::ALSA PROPERTIES
|
||||
IMPORTED_LOCATION ${ALSA_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)
|
||||
@@ -1,122 +0,0 @@
|
||||
#.rst:
|
||||
# FindBacktrace
|
||||
# -------------
|
||||
#
|
||||
# Find provider for backtrace(3).
|
||||
#
|
||||
# Checks if OS supports backtrace(3) via either libc or custom library.
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# ``Backtrace_HEADER``
|
||||
# The header file needed for backtrace(3). Cached.
|
||||
# Could be forcibly set by user.
|
||||
# ``Backtrace_INCLUDE_DIRS``
|
||||
# The include directories needed to use backtrace(3) header.
|
||||
# ``Backtrace_LIBRARIES``
|
||||
# The libraries (linker flags) needed to use backtrace(3), if any.
|
||||
# ``Backtrace_FOUND``
|
||||
# Is set if and only if backtrace(3) support detected.
|
||||
#
|
||||
# The following cache variables are also available to set or use:
|
||||
#
|
||||
# ``Backtrace_LIBRARY``
|
||||
# The external library providing backtrace, if any.
|
||||
# ``Backtrace_INCLUDE_DIR``
|
||||
# The directory holding the backtrace(3) header.
|
||||
#
|
||||
# Typical usage is to generate of header file using configure_file() with the
|
||||
# contents like the following::
|
||||
#
|
||||
# #cmakedefine01 Backtrace_FOUND
|
||||
# #if Backtrace_FOUND
|
||||
# # include <${Backtrace_HEADER}>
|
||||
# #endif
|
||||
#
|
||||
# And then reference that generated header file in actual source.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2013 Vadim Zhukov
|
||||
# Copyright 2000-2016 Kitware, Inc.
|
||||
# Copyright 2000-2011 Insight Software Consortium
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
include(CMakePushCheckState)
|
||||
include(CheckSymbolExists)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# List of variables to be provided to find_package_handle_standard_args()
|
||||
set(_Backtrace_STD_ARGS Backtrace_INCLUDE_DIR)
|
||||
|
||||
if(Backtrace_HEADER)
|
||||
set(_Backtrace_HEADER_TRY "${Backtrace_HEADER}")
|
||||
else(Backtrace_HEADER)
|
||||
set(_Backtrace_HEADER_TRY "execinfo.h")
|
||||
endif(Backtrace_HEADER)
|
||||
|
||||
find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
|
||||
set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
|
||||
|
||||
if (NOT DEFINED Backtrace_LIBRARY)
|
||||
# First, check if we already have backtrace(), e.g., in libc
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY})
|
||||
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
||||
if(_Backtrace_SYM_FOUND)
|
||||
# Avoid repeating the message() call below each time CMake is run.
|
||||
if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY)
|
||||
message(STATUS "backtrace facility detected in default set of libraries")
|
||||
endif()
|
||||
set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries")
|
||||
else()
|
||||
# Check for external library, for non-glibc systems
|
||||
if(Backtrace_INCLUDE_DIR)
|
||||
# OpenBSD has libbacktrace renamed to libexecinfo
|
||||
find_library(Backtrace_LIBRARY "execinfo")
|
||||
elseif() # respect user wishes
|
||||
set(_Backtrace_HEADER_TRY "backtrace.h")
|
||||
find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY})
|
||||
find_library(Backtrace_LIBRARY "backtrace")
|
||||
endif()
|
||||
|
||||
# Prepend list with library path as it's more common practice
|
||||
set(_Backtrace_STD_ARGS Backtrace_LIBRARY ${_Backtrace_STD_ARGS})
|
||||
endif()
|
||||
|
||||
set(Backtrace_LIBRARIES ${Backtrace_LIBRARY})
|
||||
set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing backtrace(3) facility")
|
||||
|
||||
find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS})
|
||||
mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY)
|
||||
@@ -1,42 +0,0 @@
|
||||
# - Find BlueZ library
|
||||
# This module defines
|
||||
# BlueZ_INCLUDE_DIR
|
||||
# BlueZ_LIBRARIES
|
||||
# BlueZ_FOUND
|
||||
#
|
||||
# vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules (BlueZ_PKG QUIET bluez)
|
||||
|
||||
find_path(BlueZ_INCLUDE_DIR NAMES bluetooth/bluetooth.h
|
||||
PATHS
|
||||
${BlueZ_PKG_INCLUDE_DIRS}
|
||||
/usr/include/bluetooth
|
||||
/usr/include
|
||||
/usr/local/include/bluetooth
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
find_library(BlueZ_LIBRARIES NAMES bluetooth
|
||||
PATHS
|
||||
${BlueZ_PKG_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(BlueZ
|
||||
REQUIRED_VARS BlueZ_LIBRARIES BlueZ_INCLUDE_DIR)
|
||||
|
||||
if(BlueZ_FOUND)
|
||||
if(NOT TARGET BlueZ::BlueZ)
|
||||
add_library(BlueZ::BlueZ UNKNOWN IMPORTED)
|
||||
set_target_properties(BlueZ::BlueZ PROPERTIES
|
||||
IMPORTED_LOCATION ${BlueZ_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${BlueZ_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(BlueZ_INCLUDE_DIR BlueZ_LIBRARIES)
|
||||
@@ -1,15 +0,0 @@
|
||||
find_path(CUBEB_INCLUDE_DIR cubeb.h PATH_SUFFIXES cubeb)
|
||||
find_library(CUBEB_LIBRARY cubeb)
|
||||
mark_as_advanced(CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CUBEB DEFAULT_MSG
|
||||
CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
|
||||
|
||||
if(CUBEB_FOUND AND NOT TARGET cubeb::cubeb)
|
||||
add_library(cubeb::cubeb UNKNOWN IMPORTED)
|
||||
set_target_properties(cubeb::cubeb PROPERTIES
|
||||
IMPORTED_LOCATION "${CUBEB_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CUBEB_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
@@ -1,54 +0,0 @@
|
||||
# from https://raw.githubusercontent.com/WebKit/webkit/master/Source/cmake/FindEGL.cmake
|
||||
# - Try to Find EGL
|
||||
# Once done, this will define
|
||||
#
|
||||
# EGL_FOUND - system has EGL installed.
|
||||
# EGL_INCLUDE_DIRS - directories which contain the EGL headers.
|
||||
# EGL_LIBRARIES - libraries required to link against EGL.
|
||||
# EGL_DEFINITIONS - Compiler switches required for using EGL.
|
||||
#
|
||||
# Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
|
||||
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_EGL egl)
|
||||
|
||||
if (PC_EGL_FOUND)
|
||||
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
|
||||
endif ()
|
||||
|
||||
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
|
||||
HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(EGL_NAMES ${EGL_NAMES} egl EGL)
|
||||
find_library(EGL_LIBRARIES NAMES ${EGL_NAMES}
|
||||
HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
|
||||
|
||||
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)
|
||||
@@ -1,165 +0,0 @@
|
||||
# FindFFmpeg
|
||||
# ----------
|
||||
#
|
||||
# Find the native FFmpeg includes and libraries
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# FFmpeg_INCLUDE_<component>: where to find <component>.h
|
||||
# FFmpeg_LIBRARY_<component>: where to find the <component> library
|
||||
# FFmpeg_INCLUDES: aggregate all the include paths
|
||||
# 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 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
|
||||
# responsible for adding any external dependencies (such as zlib, bzlib...).
|
||||
#
|
||||
# <component> can be one of:
|
||||
# avcodec
|
||||
# avdevice
|
||||
# avfilter
|
||||
# avformat
|
||||
# postproc
|
||||
# swresample
|
||||
# swscale
|
||||
#
|
||||
|
||||
set(_FFmpeg_ALL_COMPONENTS
|
||||
avcodec
|
||||
avdevice
|
||||
avfilter
|
||||
avformat
|
||||
avutil
|
||||
postproc
|
||||
swresample
|
||||
swscale
|
||||
)
|
||||
|
||||
set(_FFmpeg_DEPS_avcodec avutil)
|
||||
set(_FFmpeg_DEPS_avdevice avcodec avformat avutil)
|
||||
set(_FFmpeg_DEPS_avfilter avutil)
|
||||
set(_FFmpeg_DEPS_avformat avcodec avutil)
|
||||
set(_FFmpeg_DEPS_postproc avutil)
|
||||
set(_FFmpeg_DEPS_swresample avutil)
|
||||
set(_FFmpeg_DEPS_swscale avutil)
|
||||
|
||||
function(find_ffmpeg LIBNAME)
|
||||
if(DEFINED ENV{FFMPEG_DIR})
|
||||
set(FFMPEG_DIR $ENV{FFMPEG_DIR})
|
||||
endif()
|
||||
|
||||
if(FFMPEG_DIR)
|
||||
list(APPEND INCLUDE_PATHS
|
||||
${FFMPEG_DIR}
|
||||
${FFMPEG_DIR}/ffmpeg
|
||||
${FFMPEG_DIR}/lib${LIBNAME}
|
||||
${FFMPEG_DIR}/include/lib${LIBNAME}
|
||||
${FFMPEG_DIR}/include/ffmpeg
|
||||
${FFMPEG_DIR}/include
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
list(APPEND LIB_PATHS
|
||||
${FFMPEG_DIR}
|
||||
${FFMPEG_DIR}/lib
|
||||
${FFMPEG_DIR}/lib${LIBNAME}
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
else()
|
||||
list(APPEND INCLUDE_PATHS
|
||||
/usr/local/include/ffmpeg
|
||||
/usr/local/include/lib${LIBNAME}
|
||||
/usr/include/ffmpeg
|
||||
/usr/include/lib${LIBNAME}
|
||||
/usr/include/ffmpeg/lib${LIBNAME}
|
||||
)
|
||||
|
||||
list(APPEND LIB_PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
|
||||
HINTS ${INCLUDE_PATHS}
|
||||
)
|
||||
|
||||
find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
|
||||
HINTS ${LIB_PATHS}
|
||||
)
|
||||
|
||||
if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
|
||||
# Didn't find it in the usual paths, try pkg-config
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} QUIET lib${LIBNAME})
|
||||
|
||||
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
|
||||
${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
|
||||
${FFmpeg_PKGCONFIG_${LIBNAME}_LIBRARY_DIRS}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(FFmpeg_INCLUDE_${LIBNAME} AND FFmpeg_LIBRARY_${LIBNAME})
|
||||
set(FFmpeg_INCLUDE_${LIBNAME} "${FFmpeg_INCLUDE_${LIBNAME}}" PARENT_SCOPE)
|
||||
set(FFmpeg_LIBRARY_${LIBNAME} "${FFmpeg_LIBRARY_${LIBNAME}}" PARENT_SCOPE)
|
||||
set(FFmpeg_${c}_FOUND TRUE PARENT_SCOPE)
|
||||
if(NOT FFmpeg_FIND_QUIETLY)
|
||||
message("-- Found ${LIBNAME}: ${FFmpeg_INCLUDE_${LIBNAME}} ${FFmpeg_LIBRARY_${LIBNAME}}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
foreach(c ${_FFmpeg_ALL_COMPONENTS})
|
||||
find_ffmpeg(${c})
|
||||
endforeach()
|
||||
|
||||
foreach(c ${_FFmpeg_ALL_COMPONENTS})
|
||||
if(FFmpeg_${c}_FOUND)
|
||||
list(APPEND FFmpeg_INCLUDES ${FFmpeg_INCLUDE_${c}})
|
||||
list(APPEND FFmpeg_LIBRARIES ${FFmpeg_LIBRARY_${c}})
|
||||
|
||||
add_library(FFmpeg::${c} IMPORTED UNKNOWN)
|
||||
set_target_properties(FFmpeg::${c} PROPERTIES
|
||||
IMPORTED_LOCATION ${FFmpeg_LIBRARY_${c}}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${FFmpeg_INCLUDE_${c}}
|
||||
)
|
||||
if(_FFmpeg_DEPS_${c})
|
||||
set(deps)
|
||||
foreach(dep ${_FFmpeg_DEPS_${c}})
|
||||
list(APPEND deps FFmpeg::${dep})
|
||||
endforeach()
|
||||
|
||||
set_target_properties(FFmpeg::${c} PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "${deps}"
|
||||
)
|
||||
unset(deps)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(FFmpeg_INCLUDES)
|
||||
list(REMOVE_DUPLICATES FFmpeg_INCLUDES)
|
||||
endif()
|
||||
|
||||
foreach(c ${FFmpeg_FIND_COMPONENTS})
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
|
||||
endforeach()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FFmpeg
|
||||
REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS}
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
foreach(c ${_FFmpeg_ALL_COMPONENTS})
|
||||
unset(_FFmpeg_DEPS_${c})
|
||||
endforeach()
|
||||
unset(_FFmpeg_ALL_COMPONENTS)
|
||||
unset(_FFmpeg_REQUIRED_VARS)
|
||||
@@ -1,17 +0,0 @@
|
||||
find_path(HIDAPI_INCLUDE_DIR NAMES hidapi.h PATH_SUFFIXES hidapi)
|
||||
find_library(HIDAPI_LIBRARY NAMES hidapi hidapi-hidraw hidapi-libusb)
|
||||
set(HIDAPI_LIBRARIES ${HIDAPI_LIBRARY})
|
||||
set(HIDAPI_INCLUDE_DIRS ${HIDAPI_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(HIDAPI DEFAULT_MSG HIDAPI_LIBRARY HIDAPI_INCLUDE_DIR)
|
||||
|
||||
if(HIDAPI_FOUND AND NOT TARGET Hidapi::Hidapi)
|
||||
add_library(Hidapi::Hidapi UNKNOWN IMPORTED)
|
||||
set_target_properties(Hidapi::Hidapi PROPERTIES
|
||||
IMPORTED_LOCATION ${HIDAPI_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${HIDAPI_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)
|
||||
@@ -1,101 +0,0 @@
|
||||
# Based on CMake's FindIconv.cmake
|
||||
# Modified to prefer non-built-in iconv over the built-in one
|
||||
# See https://gitlab.kitware.com/cmake/cmake/-/issues/24695 for details
|
||||
# This file can be deleted once that issue has been closed and the fix has
|
||||
# made it into a satisfactory number of cmake versions. FreeBSD is the only
|
||||
# system known to hit this so far, so "satisfactory" can probably be defined
|
||||
# as "enough that most FreeBSD users have a fixed cmake".
|
||||
|
||||
find_path(Iconv_INCLUDE_DIR
|
||||
NAMES "iconv.h"
|
||||
DOC "iconv include directory")
|
||||
mark_as_advanced(Iconv_INCLUDE_DIR)
|
||||
|
||||
find_library(Iconv_LIBRARY
|
||||
NAMES iconv libiconv
|
||||
NAMES_PER_DIR
|
||||
DOC "iconv library (if not in the C library)")
|
||||
mark_as_advanced(Iconv_LIBRARY)
|
||||
|
||||
# iconv can only be provided in libc on a POSIX system.
|
||||
if(UNIX AND (NOT Iconv_INCLUDE_DIR OR NOT Iconv_LIBRARY))
|
||||
include(CMakePushCheckState)
|
||||
include(CheckCXXSourceCompiles)
|
||||
cmake_push_check_state(RESET)
|
||||
# We always suppress the message here: Otherwise on supported systems
|
||||
# not having iconv in their C library (e.g. those using libiconv)
|
||||
# would always display a confusing "Looking for iconv - not found" message
|
||||
set(CMAKE_FIND_QUIETLY TRUE)
|
||||
# The following code will not work, but it's sufficient to see if it compiles.
|
||||
# Note: libiconv will define the iconv functions as macros, so CheckSymbolExists
|
||||
# will not yield correct results.
|
||||
set(Iconv_IMPLICIT_TEST_CODE
|
||||
"
|
||||
#include <stddef.h>
|
||||
#include <iconv.h>
|
||||
int main() {
|
||||
char *a, *b;
|
||||
size_t i, j;
|
||||
iconv_t ic;
|
||||
ic = iconv_open(\"to\", \"from\");
|
||||
iconv(ic, &a, &i, &b, &j);
|
||||
iconv_close(ic);
|
||||
}
|
||||
"
|
||||
)
|
||||
check_cxx_source_compiles("${Iconv_IMPLICIT_TEST_CODE}" Iconv_IS_BUILT_IN)
|
||||
cmake_pop_check_state()
|
||||
if(Iconv_IS_BUILT_IN)
|
||||
unset(Iconv_INCLUDE_DIR)
|
||||
unset(Iconv_LIBRARY)
|
||||
endif()
|
||||
else()
|
||||
set(Iconv_IS_BUILT_IN FALSE)
|
||||
endif()
|
||||
|
||||
set(_Iconv_REQUIRED_VARS)
|
||||
if(Iconv_IS_BUILT_IN)
|
||||
set(_Iconv_REQUIRED_VARS _Iconv_IS_BUILT_IN_MSG)
|
||||
set(_Iconv_IS_BUILT_IN_MSG "built in to C library")
|
||||
else()
|
||||
set(_Iconv_REQUIRED_VARS Iconv_LIBRARY Iconv_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
# NOTE: glibc's iconv.h does not define _LIBICONV_VERSION
|
||||
if(Iconv_INCLUDE_DIR AND EXISTS "${Iconv_INCLUDE_DIR}/iconv.h")
|
||||
file(STRINGS ${Iconv_INCLUDE_DIR}/iconv.h Iconv_VERSION_DEFINE REGEX "_LIBICONV_VERSION (.*)")
|
||||
|
||||
if(Iconv_VERSION_DEFINE MATCHES "(0x[A-Fa-f0-9]+)")
|
||||
set(Iconv_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||
# encoding -> version number: (major<<8) + minor
|
||||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_NUMBER} >> 8" OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_NUMBER} - (${Iconv_VERSION_MAJOR} << 8)" OUTPUT_FORMAT HEXADECIMAL)
|
||||
|
||||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_MAJOR}" OUTPUT_FORMAT DECIMAL)
|
||||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_MINOR}" OUTPUT_FORMAT DECIMAL)
|
||||
set(Iconv_VERSION "${Iconv_VERSION_MAJOR}.${Iconv_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
unset(Iconv_VERSION_DEFINE)
|
||||
unset(Iconv_VERSION_NUMBER)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Iconv
|
||||
REQUIRED_VARS ${_Iconv_REQUIRED_VARS}
|
||||
VERSION_VAR Iconv_VERSION)
|
||||
|
||||
if(Iconv_FOUND)
|
||||
if(Iconv_IS_BUILT_IN)
|
||||
set(Iconv_INCLUDE_DIRS "")
|
||||
set(Iconv_LIBRARIES "")
|
||||
else()
|
||||
set(Iconv_INCLUDE_DIRS "${Iconv_INCLUDE_DIR}")
|
||||
set(Iconv_LIBRARIES "${Iconv_LIBRARY}")
|
||||
endif()
|
||||
if(NOT TARGET Iconv::Iconv)
|
||||
add_library(Iconv::Iconv INTERFACE IMPORTED)
|
||||
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${Iconv_INCLUDE_DIRS}")
|
||||
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,33 +0,0 @@
|
||||
# - Try to find libevdev
|
||||
# Once done this will define
|
||||
# LIBEVDEV_FOUND - System has libevdev
|
||||
# LIBEVDEV_INCLUDE_DIRS - The libevdev include directories
|
||||
# LIBEVDEV_LIBRARIES - The libraries needed to use libevdev
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_LIBEVDEV QUIET libevdev)
|
||||
|
||||
FIND_PATH(
|
||||
LIBEVDEV_INCLUDE_DIR libevdev/libevdev.h
|
||||
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
${LIBEVDEV_PATH_INCLUDES}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
LIBEVDEV_LIBRARY
|
||||
NAMES evdev libevdev
|
||||
HINTS ${PC_LIBEVDEV_LIBDIR} ${PC_LIBEVDEV_LIBRARY_DIRS}
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
${LIBEVDEV_PATH_LIB}
|
||||
)
|
||||
|
||||
set(LIBEVDEV_LIBRARIES ${LIBEVDEV_LIBRARY} )
|
||||
set(LIBEVDEV_INCLUDE_DIRS ${LIBEVDEV_INCLUDE_DIR} )
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LIBEVDEV DEFAULT_MSG
|
||||
LIBEVDEV_LIBRARY LIBEVDEV_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(LIBEVDEV_INCLUDE_DIR LIBEVDEV_LIBRARY )
|
||||
@@ -1,15 +0,0 @@
|
||||
find_path(LIBMGBA_INCLUDE_DIR mgba/flags.h)
|
||||
find_library(LIBMGBA_LIBRARY mgba)
|
||||
mark_as_advanced(LIBMGBA_INCLUDE_DIR LIBMGBA_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LIBMGBA DEFAULT_MSG
|
||||
LIBMGBA_INCLUDE_DIR LIBMGBA_LIBRARY)
|
||||
|
||||
if(LIBMGBA_FOUND AND NOT mGBA::mgba)
|
||||
add_library(mGBA::mgba UNKNOWN IMPORTED)
|
||||
set_target_properties(mGBA::mgba PROPERTIES
|
||||
IMPORTED_LOCATION "${LIBMGBA_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBMGBA_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
@@ -1,28 +0,0 @@
|
||||
# - Try to find LIBUDEV
|
||||
# Once done this will define
|
||||
# LIBUDEV_FOUND - System has LIBUDEV
|
||||
# LIBUDEV_INCLUDE_DIRS - The LIBUDEV include directories
|
||||
# LIBUDEV_LIBRARIES - The libraries needed to use LIBUDEV
|
||||
|
||||
FIND_PATH(
|
||||
LIBUDEV_INCLUDE_DIR libudev.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
${LIBUDEV_PATH_INCLUDES}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
LIBUDEV_LIBRARY
|
||||
NAMES udev libudev
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
${LIBUDEV_PATH_LIB}
|
||||
)
|
||||
|
||||
set(LIBUDEV_LIBRARIES ${LIBUDEV_LIBRARY} )
|
||||
set(LIBUDEV_INCLUDE_DIRS ${LIBUDEV_INCLUDE_DIR} )
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LIBUDEV DEFAULT_MSG
|
||||
LIBUDEV_LIBRARY LIBUDEV_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(LIBUDEV_INCLUDE_DIR LIBUDEV_LIBRARY )
|
||||
@@ -1,15 +0,0 @@
|
||||
find_path(LZO_INCLUDE_DIR lzo/lzo1x.h)
|
||||
find_library(LZO_LIBRARY lzo2)
|
||||
mark_as_advanced(LZO_INCLUDE_DIR LZO_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LZO DEFAULT_MSG
|
||||
LZO_INCLUDE_DIR LZO_LIBRARY)
|
||||
|
||||
if(LZO_FOUND AND NOT TARGET LZO::LZO)
|
||||
add_library(LZO::LZO UNKNOWN IMPORTED)
|
||||
set_target_properties(LZO::LZO PROPERTIES
|
||||
IMPORTED_LOCATION "${LZO_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LZO_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
@@ -1,55 +0,0 @@
|
||||
# - Find libusb-1.0 library
|
||||
# This module defines
|
||||
# LIBUSB_INCLUDE_DIR, where to find bluetooth.h
|
||||
# LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0.
|
||||
# LIBUSB_FOUND, If false, do not try to use libusb-1.0.
|
||||
#
|
||||
# Copyright (c) 2009, Michal Cihar, <[email protected]>
|
||||
#
|
||||
# vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if(ANDROID)
|
||||
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
|
||||
message(STATUS "libusb-1.0 not found.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(TARGET LibUSB::LibUSB)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT LIBUSB_FOUND)
|
||||
pkg_check_modules(LIBUSB_PKG libusb-1.0)
|
||||
|
||||
find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
|
||||
PATHS
|
||||
${LIBUSB_PKG_INCLUDE_DIRS}
|
||||
/usr/include/libusb-1.0
|
||||
/usr/include
|
||||
/usr/local/include/libusb-1.0
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb
|
||||
PATHS
|
||||
${LIBUSB_PKG_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
|
||||
endif()
|
||||
|
||||
|
||||
if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
|
||||
add_library(LibUSB::LibUSB UNKNOWN IMPORTED)
|
||||
set_target_properties(LibUSB::LibUSB PROPERTIES
|
||||
IMPORTED_LOCATION "${LIBUSB_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBUSB_INCLUDE_DIR}"
|
||||
)
|
||||
set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
|
||||
message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
|
||||
else()
|
||||
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
|
||||
message(STATUS "libusb-1.0 not found.")
|
||||
endif()
|
||||
@@ -1,59 +0,0 @@
|
||||
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h PATH_SUFFIXES mbedtls2)
|
||||
|
||||
find_library(MBEDTLS_LIBRARY mbedtls PATH_SUFFIXES mbedtls2)
|
||||
find_library(MBEDX509_LIBRARY mbedx509 PATH_SUFFIXES mbedtls2)
|
||||
find_library(MBEDCRYPTO_LIBRARY mbedcrypto PATH_SUFFIXES mbedtls2)
|
||||
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
|
||||
|
||||
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND")
|
||||
if(EXISTS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h)
|
||||
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
|
||||
else()
|
||||
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
|
||||
endif()
|
||||
string(REGEX REPLACE "^#define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([.0-9]+)\".*" "\\1" MBEDTLS_VERSION ${MBEDTLS_VERSION_STR})
|
||||
endif()
|
||||
|
||||
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND" AND MBEDTLS_VERSION VERSION_GREATER_EQUAL 3)
|
||||
# Once CMake 3.19 is required, we can enable HANDLE_VERSION_RANGE and use that
|
||||
if(MBEDTLS_FIND_REQUIRED)
|
||||
set(type FATAL_ERROR)
|
||||
else()
|
||||
set(type STATUS)
|
||||
endif()
|
||||
if(MBEDTLS_FIND_REQUIRED OR NOT MBEDTLS_FIND_QUIETLY)
|
||||
message(${type} "Could NOT find MBEDTLS: Found unsuitable version \"${MBEDTLS_VERSION}\", but a 2.x version is required (found ${MBEDTLS_INCLUDE_DIR})")
|
||||
endif()
|
||||
set(MBEDTLS_FOUND FALSE)
|
||||
else()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MBEDTLS
|
||||
REQUIRED_VARS MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY
|
||||
VERSION_VAR MBEDTLS_VERSION)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||
|
||||
if(MBEDTLS_FOUND)
|
||||
add_library(MbedTLS::mbedcrypto UNKNOWN IMPORTED)
|
||||
set_target_properties(MbedTLS::mbedcrypto PROPERTIES
|
||||
IMPORTED_LOCATION "${MBEDCRYPTO_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
add_library(MbedTLS::mbedx509 UNKNOWN IMPORTED)
|
||||
set_target_properties(MbedTLS::mbedx509 PROPERTIES
|
||||
IMPORTED_LOCATION "${MBEDX509_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES MbedTLS::mbedcrypto
|
||||
)
|
||||
|
||||
add_library(MbedTLS::mbedtls UNKNOWN IMPORTED)
|
||||
set_target_properties(MbedTLS::mbedtls PROPERTIES
|
||||
IMPORTED_LOCATION "${MBEDTLS_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES MbedTLS::mbedx509
|
||||
)
|
||||
endif()
|
||||
@@ -1,30 +0,0 @@
|
||||
# This file only works for MiniUPnPc 1.7 or later (it requires MINIUPNPC_API_VERSION).
|
||||
# TODO Find out if any distribution still ships with /usr/include/miniupnpc.h (i.e. not in a separate directory).
|
||||
|
||||
find_path(MINIUPNPC_INCLUDE_DIR miniupnpc.h PATH_SUFFIXES miniupnpc)
|
||||
find_library(MINIUPNPC_LIBRARY miniupnpc)
|
||||
|
||||
if(MINIUPNPC_INCLUDE_DIR)
|
||||
file(STRINGS "${MINIUPNPC_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_VERSION[\t ]+.*")
|
||||
if(MINIUPNPC_VERSION_STR)
|
||||
string(REGEX REPLACE "^#define[\t ]+MINIUPNPC_VERSION[\t ]+\"([.0-9]+)\"" "\\1" MINIUPNPC_VERSION ${MINIUPNPC_VERSION_STR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MINIUPNPC
|
||||
REQUIRED_VARS MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY
|
||||
VERSION_VAR MINIUPNPC_VERSION
|
||||
)
|
||||
|
||||
set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY})
|
||||
set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR})
|
||||
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY MINIUPNPC_API_VERSION_STR)
|
||||
|
||||
if (MINIUPNPC_FOUND AND NOT TARGET miniupnpc)
|
||||
add_library(Miniupnpc::miniupnpc UNKNOWN IMPORTED)
|
||||
set_target_properties(Miniupnpc::miniupnpc PROPERTIES
|
||||
IMPORTED_LOCATION ${MINIUPNPC_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${MINIUPNPC_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
@@ -1,118 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindOpenAL
|
||||
# ----------
|
||||
#
|
||||
#
|
||||
#
|
||||
# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
|
||||
# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
|
||||
# the headers
|
||||
#
|
||||
# $OPENALDIR is an environment variable that would correspond to the
|
||||
# ./configure --prefix=$OPENALDIR used in building OpenAL.
|
||||
#
|
||||
# Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
# module.
|
||||
|
||||
# This makes the presumption that you are include al.h like
|
||||
# #include "al.h"
|
||||
# and not
|
||||
# #include <AL/al.h>
|
||||
# The reason for this is that the latter is not entirely portable.
|
||||
# Windows/Creative Labs does not by default put their headers in AL/ and
|
||||
# OS X uses the convention <OpenAL/al.h>.
|
||||
#
|
||||
# For Windows, Creative Labs seems to have added a registry key for their
|
||||
# OpenAL 1.1 installer. I have added that key to the list of search paths,
|
||||
# however, the key looks like it could be a little fragile depending on
|
||||
# if they decide to change the 1.00.0000 number for bug fix releases.
|
||||
# Also, they seem to have laid down groundwork for multiple library platforms
|
||||
# which puts the library in an extra subdirectory. Currently there is only
|
||||
# Win32 and I have hardcoded that here. This may need to be adjusted as
|
||||
# platforms are introduced.
|
||||
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
|
||||
# I do not know if the Nvidia OpenAL SDK has a registry key.
|
||||
#
|
||||
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
|
||||
# To support the framework, I originally wrote special framework detection
|
||||
# code in this module which I have now removed with CMake's introduction
|
||||
# of native support for frameworks.
|
||||
# In addition, OpenAL is open source, and it is possible to compile on Panther.
|
||||
# Furthermore, due to bugs in the initial OpenAL release, and the
|
||||
# transition to OpenAL 1.1, it is common to need to override the built-in
|
||||
# framework.
|
||||
# Per my request, CMake should search for frameworks first in
|
||||
# the following order:
|
||||
# ~/Library/Frameworks/OpenAL.framework/Headers
|
||||
# /Library/Frameworks/OpenAL.framework/Headers
|
||||
# /System/Library/Frameworks/OpenAL.framework/Headers
|
||||
#
|
||||
# On OS X, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# OPENAL_LIBRARY to override this selection or set the CMake environment
|
||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||
|
||||
find_path(OPENAL_INCLUDE_DIR al.h
|
||||
HINTS
|
||||
ENV OPENALDIR
|
||||
PATH_SUFFIXES include/AL include/OpenAL include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_OpenAL_ARCH_DIR libs/Win64)
|
||||
else()
|
||||
set(_OpenAL_ARCH_DIR libs/Win32)
|
||||
endif()
|
||||
|
||||
find_library(OPENAL_LIBRARY
|
||||
NAMES OpenAL al openal OpenAL32
|
||||
HINTS
|
||||
ENV OPENALDIR
|
||||
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
|
||||
)
|
||||
|
||||
unset(_OpenAL_ARCH_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
|
||||
|
||||
if(OPENAL_FOUND)
|
||||
if(NOT TARGET OpenAL::OpenAL)
|
||||
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
|
||||
if(OPENAL_LIBRARY MATCHES "/([^/]+)\\.framework$")
|
||||
set(_al_fw "${OPENAL_LIBRARY}/${CMAKE_MATCH_1}")
|
||||
if(EXISTS "${_al_fw}.tbd")
|
||||
set(_al_fw "${_al_fw}.tbd")
|
||||
endif()
|
||||
set_target_properties(OpenAL::OpenAL PROPERTIES
|
||||
IMPORTED_LOCATION "${_al_fw}")
|
||||
else()
|
||||
set_target_properties(OpenAL::OpenAL PROPERTIES
|
||||
IMPORTED_LOCATION "${OPENAL_LIBRARY}")
|
||||
endif()
|
||||
set_target_properties(OpenAL::OpenAL PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
|
||||
@@ -1,30 +0,0 @@
|
||||
# - Try to find OpenSLES
|
||||
# Once done this will define
|
||||
# OPENSLES_FOUND - System has OpenSLES
|
||||
# OPENSLES_INCLUDE_DIR - The OpenSLES include directory
|
||||
# OPENSLES_LIBRARY - The library needed to use OpenSLES
|
||||
# An imported target OpenSLES::OpenSLES is also created, prefer this
|
||||
|
||||
find_path(OPENSLES_INCLUDE_DIR
|
||||
NAMES SLES/OpenSLES.h
|
||||
)
|
||||
|
||||
find_library(OPENSLES_LIBRARY
|
||||
NAMES OpenSLES
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenSLES DEFAULT_MSG
|
||||
OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
|
||||
|
||||
if(OpenSLES_FOUND)
|
||||
if(NOT TARGET OpenSLES::OpenSLES)
|
||||
add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenSLES::OpenSLES PROPERTIES
|
||||
IMPORTED_LOCATION ${OPENSLES_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY )
|
||||
@@ -1,4 +0,0 @@
|
||||
find_program(POWERSHELL_EXE NAMES powershell)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PowerShell DEFAULT_MSG POWERSHELL_EXE)
|
||||
@@ -1,42 +0,0 @@
|
||||
# - Find PulseAudio library
|
||||
# This module defines
|
||||
# PulseAudio_INCLUDE_DIR
|
||||
# PulseAudio_LIBRARIES
|
||||
# PulseAudio_FOUND
|
||||
#
|
||||
# vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules (PulseAudio_PKG QUIET libpulse)
|
||||
|
||||
find_path(PulseAudio_INCLUDE_DIR NAMES pulse/pulseaudio.h
|
||||
PATHS
|
||||
${PulseAudio_PKG_INCLUDE_DIRS}
|
||||
/usr/include/pulse
|
||||
/usr/include
|
||||
/usr/local/include/pulse
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
find_library(PulseAudio_LIBRARIES NAMES pulse
|
||||
PATHS
|
||||
${PulseAudio_PKG_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PulseAudio
|
||||
REQUIRED_VARS PulseAudio_LIBRARIES PulseAudio_INCLUDE_DIR)
|
||||
|
||||
if(PulseAudio_FOUND)
|
||||
if(NOT TARGET PulseAudio::PulseAudio)
|
||||
add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED)
|
||||
set_target_properties(PulseAudio::PulseAudio PROPERTIES
|
||||
IMPORTED_LOCATION ${PulseAudio_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${PulseAudio_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PulseAudio_INCLUDE_DIR PulseAudio_LIBRARIES)
|
||||
@@ -1,230 +0,0 @@
|
||||
# This script locates the SFML library
|
||||
# ------------------------------------
|
||||
#
|
||||
# Usage
|
||||
# -----
|
||||
#
|
||||
# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
|
||||
# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
|
||||
# example:
|
||||
# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
|
||||
#
|
||||
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
|
||||
# If nothing is specified, the version won't be checked (ie. any version will be accepted).
|
||||
# example:
|
||||
# find_package(SFML COMPONENTS ...) // no specific version required
|
||||
# find_package(SFML 2 COMPONENTS ...) // any 2.x version
|
||||
# find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
|
||||
#
|
||||
# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
|
||||
# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
|
||||
# In case of static linking, the SFML_STATIC macro will also be defined by this script.
|
||||
# example:
|
||||
# set(SFML_STATIC_LIBRARIES TRUE)
|
||||
# find_package(SFML 2 COMPONENTS network system)
|
||||
#
|
||||
# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
|
||||
# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
|
||||
# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
|
||||
# are available for both release and debug modes.
|
||||
#
|
||||
# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
|
||||
# to tell CMake where SFML is.
|
||||
#
|
||||
# Output
|
||||
# ------
|
||||
#
|
||||
# This script defines the following variables:
|
||||
# - For each specified module XXX (system, window, graphics, network, audio, main):
|
||||
# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
|
||||
# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
|
||||
# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
|
||||
# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found
|
||||
# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules
|
||||
# - SFML_FOUND: true if all the required modules are found
|
||||
# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
|
||||
#
|
||||
# example:
|
||||
# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
|
||||
# include_directories(${SFML_INCLUDE_DIR})
|
||||
# add_executable(myapp ...)
|
||||
# target_link_libraries(myapp ${SFML_LIBRARIES})
|
||||
|
||||
# define the SFML_STATIC macro if static build was chosen
|
||||
if(SFML_STATIC_LIBRARIES)
|
||||
add_definitions(-DSFML_STATIC)
|
||||
endif()
|
||||
|
||||
# deduce the libraries suffix from the options
|
||||
set(FIND_SFML_LIB_SUFFIX "")
|
||||
if(SFML_STATIC_LIBRARIES)
|
||||
set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s")
|
||||
endif()
|
||||
|
||||
# find the SFML include directory
|
||||
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
|
||||
PATH_SUFFIXES include
|
||||
PATHS
|
||||
${SFML_ROOT}
|
||||
$ENV{SFML_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/
|
||||
/usr/
|
||||
/sw # Fink
|
||||
/opt/local/ # DarwinPorts
|
||||
/opt/csw/ # Blastwave
|
||||
/opt/)
|
||||
|
||||
# check the version number
|
||||
set(SFML_VERSION_OK TRUE)
|
||||
if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
|
||||
# extract the major and minor version numbers from SFML/Config.hpp
|
||||
# we have to handle framework a little bit differently :
|
||||
if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
|
||||
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
|
||||
else()
|
||||
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
|
||||
endif()
|
||||
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
|
||||
STRING(REGEX MATCH "#define SFML_VERSION_MAJOR[ \t]+([0-9]+)" SFML_VERSION_MAJOR_MATCH "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX MATCH "#define SFML_VERSION_MINOR[ \t]+([0-9]+)" SFML_VERSION_MINOR_MATCH "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE "#define SFML_VERSION_MAJOR[ \t]+([0-9]+)" "\\1" SFML_VERSION_MAJOR "${SFML_VERSION_MAJOR_MATCH}")
|
||||
STRING(REGEX REPLACE "#define SFML_VERSION_MINOR[ \t]+([0-9]+)" "\\1" SFML_VERSION_MINOR "${SFML_VERSION_MINOR_MATCH}")
|
||||
math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}")
|
||||
|
||||
# if we could extract them, compare with the requested version number
|
||||
if (SFML_VERSION_MAJOR)
|
||||
# transform version numbers to an integer
|
||||
math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10 + ${SFML_VERSION_MINOR}")
|
||||
|
||||
# compare them
|
||||
if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
|
||||
set(SFML_VERSION_OK FALSE)
|
||||
endif()
|
||||
else()
|
||||
# SFML version is < 3.0
|
||||
if (SFML_REQUESTED_VERSION GREATER 29)
|
||||
set(SFML_VERSION_OK FALSE)
|
||||
if (SFML_REQUESTED_VERSION GREATER 19)
|
||||
set(SFML_VERSION_MAJOR 1)
|
||||
else()
|
||||
set(SFML_VERSION_MAJOR 2)
|
||||
endif()
|
||||
set(SFML_VERSION_MINOR x)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# find the requested modules
|
||||
set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
|
||||
set(FIND_SFML_LIB_PATHS
|
||||
${SFML_ROOT}
|
||||
$ENV{SFML_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt)
|
||||
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
|
||||
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
|
||||
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
|
||||
set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}${FIND_SFML_LIB_SUFFIX})
|
||||
|
||||
# no suffix for sfml-main, it is always a static library
|
||||
if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
|
||||
set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
|
||||
endif()
|
||||
|
||||
# debug library
|
||||
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
|
||||
NAMES ${FIND_SFML_COMPONENT_NAME}-d
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS ${FIND_SFML_LIB_PATHS})
|
||||
|
||||
# release library
|
||||
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
|
||||
NAMES ${FIND_SFML_COMPONENT_NAME}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS ${FIND_SFML_LIB_PATHS})
|
||||
|
||||
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
|
||||
# library found
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
|
||||
|
||||
# if both are found, set SFML_XXX_LIBRARY to contain both
|
||||
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
|
||||
optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
|
||||
# if only one debug/release variant is found, set the other to be equal to the found one
|
||||
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
|
||||
# debug and not release
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
|
||||
endif()
|
||||
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
|
||||
# release and not debug
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
else()
|
||||
# library not found
|
||||
set(SFML_FOUND FALSE)
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
|
||||
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
|
||||
set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
|
||||
endif()
|
||||
|
||||
# mark as advanced
|
||||
MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
|
||||
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
|
||||
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
|
||||
|
||||
# add to the global list of libraries
|
||||
set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
|
||||
endforeach()
|
||||
|
||||
# handle errors
|
||||
if(NOT SFML_VERSION_OK)
|
||||
# SFML version not ok
|
||||
set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR})")
|
||||
set(SFML_FOUND FALSE)
|
||||
elseif(NOT SFML_FOUND)
|
||||
# include directory or library not found
|
||||
set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
|
||||
endif()
|
||||
if (NOT SFML_FOUND)
|
||||
if(SFML_FIND_REQUIRED)
|
||||
# fatal error
|
||||
message(FATAL_ERROR ${FIND_SFML_ERROR})
|
||||
elseif(NOT SFML_FIND_QUIETLY)
|
||||
# error but continue
|
||||
message(STATUS "${FIND_SFML_ERROR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# handle success
|
||||
if(SFML_FOUND)
|
||||
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
|
||||
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
|
||||
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
|
||||
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
|
||||
if(NOT TARGET sfml-${FIND_SFML_COMPONENT_LOWER})
|
||||
add_library(sfml-${FIND_SFML_COMPONENT_LOWER} UNKNOWN IMPORTED)
|
||||
set_target_properties(sfml-${FIND_SFML_COMPONENT_LOWER} PROPERTIES
|
||||
IMPORTED_LOCATION "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SFML_INCLUDE_DIR}"
|
||||
)
|
||||
if(NOT ${FIND_SFML_COMPONENT_LOWER} STREQUAL system)
|
||||
set_target_properties(sfml-${FIND_SFML_COMPONENT_LOWER} PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES sfml-system
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
@@ -1,29 +0,0 @@
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_SYSTEMD QUIET "libsystemd")
|
||||
|
||||
if (PC_SYSTEMD_FOUND)
|
||||
add_definitions(${PC_SYSTEMD_CFLAGS} ${PC_SYSTEMD_CFLAGS_OTHER})
|
||||
endif(PC_SYSTEMD_FOUND)
|
||||
|
||||
find_path(
|
||||
SYSTEMD_INCLUDE_DIRS
|
||||
NAMES systemd/sd-daemon.h
|
||||
HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(
|
||||
SYSTEMD_LIBRARIES
|
||||
NAMES systemd
|
||||
HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
SYSTEMD
|
||||
REQUIRED_VARS SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS
|
||||
)
|
||||
mark_as_advanced(
|
||||
SYSTEMD_FOUND
|
||||
SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS
|
||||
)
|
||||
@@ -1,14 +0,0 @@
|
||||
find_path(pugixml_INCLUDE_DIRS pugixml.hpp)
|
||||
find_library(pugixml_LIBRARIES NAMES pugixml)
|
||||
mark_as_advanced(pugixml_INCLUDE_DIRS pugixml_LIBRARIES)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(pugixml REQUIRED_VARS pugixml_LIBRARIES pugixml_INCLUDE_DIRS)
|
||||
|
||||
if(pugixml_FOUND AND NOT TARGET pugixml)
|
||||
add_library(pugixml UNKNOWN IMPORTED)
|
||||
set_target_properties(pugixml PROPERTIES
|
||||
IMPORTED_LOCATION "${pugixml_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${pugixml_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
@@ -1,11 +0,0 @@
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# The default MSVC flags for Release and RelWithDebInfo are poorly chosen
|
||||
# (see issue https://gitlab.kitware.com/cmake/cmake/-/issues/20812)
|
||||
# By default, inlining is disabled for RelWithDebInfo.
|
||||
# Manually redefine MSVC flags to match Visual Studio defaults
|
||||
# and ensure that Release builds generate debug info.
|
||||
foreach(f CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELEASE)
|
||||
# optimize, define NDEBUG, generate debug info
|
||||
set(${f} "/O2 /DNDEBUG /Z7")
|
||||
endforeach()
|
||||
endif()
|
||||
@@ -1,5 +0,0 @@
|
||||
# This file exists to be consumed via `add_custom_command`
|
||||
# so that file changes are picked up without needing a full reconfigure
|
||||
|
||||
file(SHA1 ${JSON_FILE} ACHIEVEMENT_APPROVED_LIST_HASH)
|
||||
configure_file(${TEMPLATE_FILE} ${OUTPUT_FILE} @ONLY)
|
||||
@@ -1,16 +0,0 @@
|
||||
# from https://stackoverflow.com/a/49216539
|
||||
# The linked answer does some weird preconfiguring by manually splitting the CMAKE_CXX_FLAGS variable and applying it to a target,
|
||||
# but as far as I can tell none of that is necessary, this works just fine as-is.
|
||||
|
||||
#
|
||||
# Removes the specified compile flag from the specified target.
|
||||
# _target - The target to remove the compile flag from
|
||||
# _flag - The compile flag to remove
|
||||
#
|
||||
macro(remove_cxx_flag_from_target _target _flag)
|
||||
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
|
||||
if(_target_cxx_flags)
|
||||
list(REMOVE_ITEM _target_cxx_flags ${_flag})
|
||||
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${_target_cxx_flags}")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,75 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# for revision info
|
||||
if(GIT_FOUND)
|
||||
# defines DOLPHIN_WC_REVISION
|
||||
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_DESCRIBE
|
||||
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# remove hash (and trailing "-0" if needed) from description
|
||||
string(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}")
|
||||
|
||||
# defines DOLPHIN_WC_BRANCH
|
||||
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_COMMITS_AHEAD_MASTER
|
||||
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD ^master
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_COMMITS_AHEAD_MASTER
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# defines DOLPHIN_WC_TAG
|
||||
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --exact-match HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP DOLPHIN_WC_BUILD_DATE "%Y-%m-%d" UTC)
|
||||
|
||||
# version number
|
||||
set(DOLPHIN_VERSION_MAJOR "2609")
|
||||
set(DOLPHIN_VERSION_MINOR "0")
|
||||
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
|
||||
|
||||
# If Dolphin is not built from a Git repository, default the version info to
|
||||
# reasonable values.
|
||||
if(NOT DOLPHIN_WC_REVISION)
|
||||
set(DOLPHIN_WC_DESCRIBE "${DOLPHIN_VERSION_MAJOR}.${DOLPHIN_VERSION_MINOR}")
|
||||
set(DOLPHIN_WC_REVISION "${DOLPHIN_WC_DESCRIBE} (no further info)")
|
||||
set(DOLPHIN_WC_BRANCH "master")
|
||||
set(DOLPHIN_WC_COMMITS_AHEAD_MASTER 0)
|
||||
endif()
|
||||
|
||||
# If this is a tag (i.e. a release), then set the current patch version and
|
||||
# the number of commits ahead to zero.
|
||||
if(DOLPHIN_WC_TAG)
|
||||
set(DOLPHIN_VERSION_PATCH "0")
|
||||
set(DOLPHIN_WC_COMMITS_AHEAD_MASTER 0)
|
||||
endif()
|
||||
|
||||
function(configure_source_file path)
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/${path}.in"
|
||||
"${PROJECT_BINARY_DIR}/${path}.tmp"
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/${path}.tmp" "${PROJECT_BINARY_DIR}/${path}")
|
||||
|
||||
file(REMOVE "${PROJECT_BINARY_DIR}/${path}.tmp")
|
||||
endfunction()
|
||||
|
||||
configure_source_file("Source/Core/Common/scmrev.h")
|
||||
|
||||
if(APPLE)
|
||||
configure_source_file("Source/Core/VersionInfo.plist")
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
configure_source_file("Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml")
|
||||
endif()
|
||||
-974
@@ -1,974 +0,0 @@
|
||||
########################################
|
||||
# General setup
|
||||
#
|
||||
cmake_minimum_required(VERSION 3.25...4.2.1)
|
||||
|
||||
cmake_policy(SET CMP0080 OLD) # allow using BundleUtilities at configure time
|
||||
|
||||
# Minimum OS X version.
|
||||
# This is inserted into the Info.plist as well.
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0.0" CACHE STRING "")
|
||||
|
||||
# When we don't set a sysroot, AppleClang will put /usr/local/include at a higher
|
||||
# priority than -isystem paths, which can cause weird include issues in Externals
|
||||
if(NOT IOS AND NOT TVOS)
|
||||
set(CMAKE_OSX_SYSROOT macosx CACHE STRING "")
|
||||
endif( )
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FlagsOverride.cmake")
|
||||
|
||||
# CMake 3.28 and later scan c++ source files for module imports by default. Since we don't use
|
||||
# modules scanning is pointless, so disable it. This also prevents Clang from generating an error
|
||||
# if the clang-scan-deps tool isn't installed:
|
||||
# "CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found".
|
||||
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
|
||||
|
||||
project(dolphin-emu)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
|
||||
|
||||
# Support functions
|
||||
include(CheckAndAddFlag)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckSymbolExists)
|
||||
include(DolphinCompileDefinitions)
|
||||
include(DolphinDisableWarningsMSVC)
|
||||
include(DolphinLibraryTools)
|
||||
include(GNUInstallDirs)
|
||||
include(RemoveCompileFlag)
|
||||
|
||||
# When using the Visual Studio generator, only show our targets and not the ones from Externals.
|
||||
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT dolphin-emu)
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
set(COMPILER ${CMAKE_CXX_COMPILER_ID})
|
||||
if (COMPILER STREQUAL "GNU")
|
||||
set(COMPILER "GCC") # prefer printing GCC instead of GNU
|
||||
endif()
|
||||
|
||||
# Minimum required versions
|
||||
# Toolsets
|
||||
set(Xcode_min_version 14.3)
|
||||
set(MSVC_toolset_min_version 143)
|
||||
# Compilers
|
||||
set(GCC_min_version 12)
|
||||
set(Clang_min_version 15)
|
||||
set(AppleClang_min_version 14.0.3)
|
||||
set(MSVC_min_version 19.32)
|
||||
# Standard libraries
|
||||
set(libstdc++_min_version 12) # This should match GCC_min_version's major version.
|
||||
set(libc++_min_version 150000) # This should match Clang_min_version in the format "xxyyzz" instead of "xx.yy.zz"
|
||||
|
||||
dolphin_check_toolset_version("Xcode" XCODE_VERSION ${Xcode_min_version})
|
||||
dolphin_check_toolset_version("MSVC Toolset" MSVC_TOOLSET_VERSION ${MSVC_toolset_min_version})
|
||||
|
||||
message(STATUS "Using ${COMPILER} ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
|
||||
if(NOT DEFINED ${COMPILER}_min_version)
|
||||
message(WARNING "Unknown compiler ${COMPILER}, assuming it is new enough")
|
||||
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${${COMPILER}_min_version})
|
||||
message(FATAL_ERROR "Requires ${COMPILER} ${${COMPILER}_min_version} or higher")
|
||||
endif()
|
||||
|
||||
# libstdc++ is almost always used on Linux, even when using clang as the compiler.
|
||||
# libc++ is used on the likes of Android, Apple devices, FreeBSD, and a few (very) rare Linux distros like Chimera Linux.
|
||||
# Windows uses its own standard library named STL, which we check as part of the toolset above. (outside of MinGW which can use either libstdc++ or libc++)
|
||||
dolphin_check_std_version("GNU_libstdc++" _GLIBCXX_RELEASE ${libstdc++_min_version})
|
||||
dolphin_check_std_version("LLVM_libc++" _LIBCPP_VERSION ${libc++_min_version})
|
||||
|
||||
# Name of the Dolphin distributor. If you redistribute Dolphin builds (forks,
|
||||
# unofficial builds) please consider identifying your distribution with a
|
||||
# unique name here.
|
||||
set(DISTRIBUTOR "None" CACHE STRING "Name of the distributor.")
|
||||
|
||||
set(DOLPHIN_DEFAULT_UPDATE_TRACK "" CACHE STRING "Name of the default update track. If empty, disables auto-update.")
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
option(ENABLE_X11 "Enables X11 Support" ON)
|
||||
endif()
|
||||
if(NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
||||
option(ENABLE_EGL "Enables EGL OpenGL Interface" ON)
|
||||
endif()
|
||||
|
||||
if(NOT ANDROID)
|
||||
option(ENABLE_CLI_TOOL "Enable dolphin-tool, a CLI-based utility for functions such as managing disc images" ON)
|
||||
endif()
|
||||
|
||||
|
||||
set(USE_SYSTEM_LIBS "AUTO" CACHE STRING "Use system libraries instead of bundled libraries. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled. Default is AUTO")
|
||||
if(APPROVED_VENDORED_DEPENDENCIES)
|
||||
message(WARNING "APPROVED_VENDORED_DEPENDENCIES is deprecated. Please migrate to setting USE_SYSTEM_LIBS to ON and setting USE_SYSTEM_<dependency> to either AUTO or OFF to allow bundled libs.")
|
||||
endif()
|
||||
option(USE_UPNP "Enables UPnP port mapping support" ON)
|
||||
option(ENABLE_NOGUI "Enable NoGUI frontend" OFF)
|
||||
option(ENABLE_QT "Enable Qt (Default)" ON)
|
||||
option(ENABLE_LTO "Enables Link Time Optimization" OFF)
|
||||
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
|
||||
option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF)
|
||||
option(ENABLE_ALSA "Enables ALSA sound backend" ON)
|
||||
option(ENABLE_PULSEAUDIO "Enables PulseAudio sound backend" ON)
|
||||
option(ENABLE_CUBEB "Enables Cubeb sound backend" ON)
|
||||
option(ENABLE_LLVM "Enables LLVM support, for disassembly" ON)
|
||||
option(ENABLE_TESTS "Enables building the unit tests" ON)
|
||||
option(ENABLE_VULKAN "Enables vulkan video backend" ON)
|
||||
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current game on Discord" ON)
|
||||
option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON)
|
||||
option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON)
|
||||
option(USE_RETRO_ACHIEVEMENTS "Enables integration with retroachievements.org" ON)
|
||||
option(ENABLE_CCACHE "Enables CCache compiler cache" OFF)
|
||||
option(LIBRETRO "Build as a libretro library" OFF)
|
||||
|
||||
# Maintainers: if you consider blanket disabling this for your users, please
|
||||
# consider the following points:
|
||||
# * No data is being sent without explicit user approval (pop up box at first
|
||||
# launch).
|
||||
# * The Dolphin team relies on the data in order to understand the behavior
|
||||
# of our software in the wild.
|
||||
option(ENABLE_ANALYTICS "Enables opt-in Analytics collection" ON)
|
||||
|
||||
option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
|
||||
|
||||
option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF)
|
||||
option(FASTLOG "Enable all logs" OFF)
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
|
||||
endif()
|
||||
|
||||
# TODO: Add DSPSpy
|
||||
option(DSPTOOL "Build dsptool" OFF)
|
||||
|
||||
# RetroAchievements developer tools require Windows hooks
|
||||
if(WIN32)
|
||||
option(RC_CLIENT_SUPPORTS_RAINTEGRATION "Enables RetroAchievements developer tools" ON)
|
||||
endif()
|
||||
|
||||
# Enable SDL by default on operating systems that aren't Android.
|
||||
if(NOT ANDROID)
|
||||
option(ENABLE_SDL "Enables SDL as a generic controller backend" ON)
|
||||
else()
|
||||
option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
enable_language(OBJC)
|
||||
enable_language(OBJCXX)
|
||||
option(MACOS_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF)
|
||||
option(POSTPROCESS_BUNDLE "Postprocess bundle for redistributability" OFF)
|
||||
# Enable adhoc code signing by default (otherwise makefile builds on ARM will not work)
|
||||
option(MACOS_CODE_SIGNING "Enable codesigning" ON)
|
||||
option(USE_BUNDLED_MOLTENVK "Build MoltenVK from Externals with Dolphin-specific patches" ON)
|
||||
set(MACOS_CODE_SIGNING_IDENTITY "-" CACHE STRING "The identity used for codesigning.")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
option(ENABLE_VTUNE "Enable Intel VTune integration for JIT code." OFF)
|
||||
|
||||
if(NOT ANDROID)
|
||||
option(ENABLE_HWDB "Enables the udev hardware database" ON)
|
||||
option(ENABLE_EVDEV "Enables the evdev controller backend" ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable folders for IDE
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# Set up paths
|
||||
set(datadir ${CMAKE_INSTALL_FULL_DATADIR}/dolphin-emu CACHE PATH "datadir")
|
||||
add_definitions(-DDATA_DIR="${datadir}/")
|
||||
|
||||
if(CMAKE_SYSROOT)
|
||||
# If we should use a sysroot, tell pkg-config to search for packages in there, not on the host
|
||||
set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig")
|
||||
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_SYSROOT}")
|
||||
endif()
|
||||
|
||||
# Output directory for the Dolphin binary
|
||||
# We need to use a generator expression here to ensure that multi-config generators
|
||||
# (like Visual Studio) put the binaries in the right place.
|
||||
# See https://cmake.org/cmake/help/v4.2/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}/Binaries>)
|
||||
|
||||
# Output directory for PDB files. PDBs are only generated on Windows with MSVC.
|
||||
# We set a common directory for all PDBs to avoid littering the Binaries/ directory.
|
||||
set(CMAKE_PDB_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}/pdb>)
|
||||
|
||||
if(ENABLE_CCACHE)
|
||||
include(CCache)
|
||||
if(NOT CCACHE_BIN)
|
||||
message(WARNING "Ccache was enabled but not found. This build will not use Ccache.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Architecture detection and arch specific settings
|
||||
message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
# Detect 64bit or 32bit
|
||||
# CMake doesn't provide a simple way to determine 32bit or 64bit
|
||||
# If we ever support a architecture that is 64bit with 32bit pointers then this'll break
|
||||
# Of course the chances of that are slim(x32?) so who cares
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_ARCH_64 1)
|
||||
add_definitions(-D_ARCH_64=1)
|
||||
else()
|
||||
set(_ARCH_32 1)
|
||||
add_definitions(-D_ARCH_32=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GENERIC)
|
||||
if(WIN32)
|
||||
message(FATAL_ERROR "Generic builds are not supported on Windows!")
|
||||
endif()
|
||||
message(STATUS "Warning! Building generic build!")
|
||||
set(_M_GENERIC 1)
|
||||
add_definitions(-D_M_GENERIC=1)
|
||||
elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x64|x86_64|amd64|AMD64")
|
||||
set(_M_X86_64 1)
|
||||
add_definitions(-D_M_X86_64=1)
|
||||
check_and_add_flag(HAVE_SSE2 -msse2)
|
||||
elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
||||
set(_M_ARM_64 1)
|
||||
add_definitions(-D_M_ARM_64=1)
|
||||
# CRC instruction set is used in the CRC32 hash function
|
||||
check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc)
|
||||
else()
|
||||
message(FATAL_ERROR "You're building on an unsupported platform: "
|
||||
"'${CMAKE_SYSTEM_PROCESSOR}' with ${CMAKE_SIZEOF_VOID_P}-byte pointers."
|
||||
" Enable generic build if you really want a JIT-less binary.")
|
||||
endif()
|
||||
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
||||
set(DOLPHIN_HOST ARM64)
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x64|x86_64|amd64|AMD64")
|
||||
set(DOLPHIN_HOST x64)
|
||||
endif()
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Ninja")
|
||||
check_and_add_flag(DIAGNOSTICS_COLOR -fdiagnostics-color)
|
||||
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
# Only MSBuild needs this, other generators will compile one file at a time
|
||||
add_compile_options("/MP")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
check_and_add_flag(EXCEPTIONS /EHsc)
|
||||
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
||||
|
||||
# Disable RTTI
|
||||
add_compile_options(/GR-)
|
||||
|
||||
# Set warning level 4 (the highest)
|
||||
add_compile_options(/W4)
|
||||
|
||||
# Treat all warnings as errors
|
||||
add_compile_options(/WX)
|
||||
|
||||
# Disable some warnings
|
||||
add_compile_options(
|
||||
/wd4201 # nonstandard extension used : nameless struct/union
|
||||
/wd4127 # conditional expression is constant
|
||||
/wd4100 # 'identifier' : unreferenced formal parameter
|
||||
/wd4200 # InputCommon fix temp.
|
||||
/wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
||||
/wd4121 # 'symbol' : alignment of a member was sensitive to packing
|
||||
/wd4324 # Padding was added at the end of a structure because you specified a __declspec(align) value.
|
||||
/wd4714 # function 'function' marked as __forceinline not inlined
|
||||
/wd4351 # new behavior: elements of array 'array' will be default initialized
|
||||
# TODO: Enable this warning once possible
|
||||
/wd4245 # conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
# Currently jits use some annoying code patterns which makes this common
|
||||
)
|
||||
|
||||
# Additional warnings
|
||||
add_compile_options(
|
||||
/w15262 # Unannotated fallthrough between switch labels
|
||||
/w44263 # Non-virtual member function hides base class virtual function
|
||||
/w44265 # Class has virtual functions, but destructor is not virtual
|
||||
/w44946 # Reinterpret cast between related types
|
||||
)
|
||||
|
||||
# All files are encoded as UTF-8
|
||||
add_compile_options(/utf-8)
|
||||
|
||||
# Ignore warnings in external headers
|
||||
add_compile_options(/external:anglebrackets)
|
||||
add_compile_options(/external:W0)
|
||||
add_compile_options(/external:templates-)
|
||||
|
||||
# Request deterministic builds
|
||||
add_compile_options(/experimental:deterministic)
|
||||
add_link_options(/experimental:deterministic)
|
||||
|
||||
# Enable function-level linking
|
||||
add_compile_options(/Gy)
|
||||
# Generate intrinsic functions
|
||||
add_compile_options(/Oi)
|
||||
# Enable buffer security check on Debug, disable otherwise
|
||||
add_compile_options($<IF:$<CONFIG:Debug>,/GS,/GS->)
|
||||
# Remove unreferenced inline functions/data to reduce link time and catch bugs
|
||||
# Note: In msbuild build, this gets set by msbuild by default
|
||||
add_compile_options(/Zc:inline)
|
||||
# Fix various other non-conformant behaviors
|
||||
add_compile_options(/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,templateScope,throwingNew)
|
||||
# Enforce strict volatile semantics as per ISO C++
|
||||
add_compile_options(/volatile:iso)
|
||||
|
||||
# Use 'precise' floating point model
|
||||
add_compile_options(/fp:precise)
|
||||
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT")
|
||||
# Generate debug data
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /DEBUG")
|
||||
# Eliminate dead code and data
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /OPT:REF /OPT:ICF")
|
||||
else()
|
||||
add_definitions(-D_DEFAULT_SOURCE)
|
||||
|
||||
# gcc uses some optimizations which might break stuff without this flag
|
||||
check_and_add_flag(NO_STRICT_ALIASING -fno-strict-aliasing)
|
||||
check_and_add_flag(NO_EXCEPTIONS -fno-exceptions)
|
||||
|
||||
check_and_add_flag(VISIBILITY_INLINES_HIDDEN -fvisibility-inlines-hidden)
|
||||
check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden)
|
||||
|
||||
check_and_add_flag(FOMIT_FRAME_POINTER -fomit-frame-pointer NO_DEBINFO_ONLY)
|
||||
|
||||
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
||||
check_and_add_flag(GGDB -ggdb DEBUG_ONLY)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# GNU ar: Create thin archive files.
|
||||
# Requires binutils-2.19 or later.
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
if(NOT MACOS_USE_DEFAULT_SEARCH_PATH)
|
||||
# Hack up the path to prioritize the path to built-in OS libraries to
|
||||
# increase the chance of not depending on a bunch of copies of them
|
||||
# installed by MacPorts, Fink, Homebrew, etc, and ending up copying
|
||||
# them into the bundle. Since we optionally depend on libraries which
|
||||
# are not part of OS X (ffmpeg, etc.), however, don't remove the default
|
||||
# path entirely as was done in a previous version of this file. This is
|
||||
# still kinda evil, since it defeats the user's path settings...
|
||||
# See http://www.cmake.org/cmake/help/v3.0/command/find_program.html
|
||||
list(APPEND CMAKE_PREFIX_PATH "/usr")
|
||||
endif()
|
||||
|
||||
# Prevents Xcode from overriding the -fno-strict-aliasing flag
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
|
||||
|
||||
# Specify target CPUs.
|
||||
if(_ARCH_64 AND _M_X86_64)
|
||||
check_and_add_flag(HAVE_MSSSE3 -mssse3)
|
||||
check_and_add_flag(HAVE_ARCH_CORE2 -march=core2)
|
||||
endif()
|
||||
# Linker flags.
|
||||
# Drop unreachable code and data.
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")
|
||||
|
||||
# Set FMT_EXCEPTIONS = 0, for consistency with -fno-exceptions earlier.
|
||||
# If we set only -fno-exceptions, fmt fails to compile when included from
|
||||
# Objective-C++ because fmt tries try to use throw because __EXCEPTIONS is defined.
|
||||
add_definitions(-DFMT_EXCEPTIONS=0)
|
||||
|
||||
find_library(APPKIT_LIBRARY AppKit)
|
||||
find_library(APPSERV_LIBRARY ApplicationServices)
|
||||
find_library(CARBON_LIBRARY Carbon)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(CORESERV_LIBRARY CoreServices)
|
||||
find_library(FORCEFEEDBACK_LIBRARY ForceFeedback)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(IOB_LIBRARY IOBluetooth)
|
||||
find_library(IOK_LIBRARY IOKit)
|
||||
find_library(OPENGL_LIBRARY OpenGL)
|
||||
endif()
|
||||
|
||||
if(ENABLE_LTO)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT supported OUTPUT error)
|
||||
|
||||
if(supported)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
else()
|
||||
message(STATUS "IPO / LTO not supported: <${error}>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# BSDs put packages in /usr/local instead of /usr, so we need to
|
||||
# force CMake to look in those directories by default, too.
|
||||
# All commands and submodule commands also need to see these
|
||||
# changes, so just setting them in the project scope via
|
||||
# include_directories and link_directories is not sufficient
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local")
|
||||
set(CMAKE_REQUIRED_INCLUDES "/usr/local/include")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
|
||||
endif()
|
||||
|
||||
# Dolphin requires threads.
|
||||
find_package(Threads)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
||||
"Build type (Release/Debug/RelWithDebInfo/MinSizeRel)" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GPROF)
|
||||
check_and_add_flag(HAVE_PG -pg)
|
||||
if(NOT FLAG_C_HAVE_PG)
|
||||
message(FATAL_ERROR "Compiler option -pg is not supported")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
|
||||
endif()
|
||||
|
||||
if(FASTLOG)
|
||||
add_definitions(-DDEBUGFAST)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
add_definitions(
|
||||
-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
|
||||
-DWINDOWS_FOUNDATION_UNIVERSALAPICONTRACT_VERSION=0x50000
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_VTUNE)
|
||||
set(VTUNE_DIR "/opt/intel/vtune_amplifier")
|
||||
add_definitions(-DUSE_VTUNE)
|
||||
include_directories("${VTUNE_DIR}/include")
|
||||
set(VTUNE_LIBRARIES
|
||||
"${VTUNE_DIR}/lib64/libjitprofiling.a"
|
||||
"${VTUNE_DIR}/lib64/libittnotify.a"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
message(STATUS "Building for Android")
|
||||
if(NOT ENABLE_HEADLESS)
|
||||
add_definitions(-DANDROID)
|
||||
if(ENABLE_NOGUI)
|
||||
message(STATUS "Building Android app, disabling NoGUI frontend.")
|
||||
set(ENABLE_NOGUI 0)
|
||||
endif()
|
||||
else()
|
||||
# Lie to cmake a bit. We are cross compiling to Android
|
||||
# but not as a shared library. We want an executable.
|
||||
set(ANDROID 0)
|
||||
endif()
|
||||
set(ENABLE_QT 0)
|
||||
set(USE_DISCORD_PRESENCE 0)
|
||||
|
||||
# We are cross compiling, search only the toolchain for libraries and includes
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
endif()
|
||||
|
||||
if(IOS)
|
||||
message(STATUS "Building for iOS")
|
||||
add_definitions(-DIPHONEOS)
|
||||
add_definitions(-DFMT_EXCEPTIONS=0)
|
||||
endif()
|
||||
|
||||
if(LIBRETRO)
|
||||
set(ENABLE_ALSA OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_ANALYTICS OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_AUTOUPDATE OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_CLI_TOOL OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_CUBEB OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_EVDEV OFF CACHE BOOL "" FORCE)
|
||||
set(ENCODE_FRAMEDUMPS OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_LLVM OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_NOGUI OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_QT OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_PULSEAUDIO OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_SDL OFF CACHE BOOL "" FORCE)
|
||||
set(USE_DISCORD_PRESENCE OFF CACHE BOOL "" FORCE)
|
||||
set(USE_RETRO_ACHIEVEMENTS OFF CACHE BOOL "" FORCE)
|
||||
set(USE_UPNP OFF CACHE BOOL "" FORCE)
|
||||
add_definitions(-D__LIBRETRO__)
|
||||
check_and_add_flag(FPIC -fpic)
|
||||
if(APPLE)
|
||||
set(MACOS_CODE_SIGNING OFF CACHE BOOL "" FORCE)
|
||||
set(USE_BUNDLED_MOLTENVK OFF CACHE BOOL "" FORCE)
|
||||
set(USE_SYSTEM_LIBS OFF CACHE STRING "" FORCE)
|
||||
# prevent minizip from finding system libs via pkg-config
|
||||
set(MZ_FORCE_FETCH_LIBS ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(IOS)
|
||||
set(MZ_OPENSSL OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(WIN32)
|
||||
# Xbox remove dependency on Zlib
|
||||
set(USE_SYSTEM_ZLIB OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER MATCHES ".*(arm-webos-linux-gnueabi-|aarch64-webos-linux-gnu).*")
|
||||
set(WEBOS TRUE CACHE BOOL "Building for webOS")
|
||||
add_definitions(-D__WEBOS__)
|
||||
add_definitions(-DSKIP_WIMOTESCANNER_THREAD -DSKIP_GCMEMCARD_THREAD -DSKIP_SAVESTATE_THREAD -DSKIP_NETWORK_WORKER_THREAD)
|
||||
add_definitions(-DSKIP_ASSETLOADER_THREAD -DSKIP_WICONNECT24_WORKER_THREAD -DSKIP_RESOURCE_WORKER_THREAD -DSKIP_KDSCHEDULER_TIMER_THREAD)
|
||||
set(ENABLE_VULKAN OFF CACHE BOOL "" FORCE)
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
|
||||
remove_definitions(-marm -march=armv7-a)
|
||||
add_compile_options(-mcpu=cortex-a53 -mfloat-abi=softfp)
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "Debug build: enabling extra debug flags")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fno-omit-frame-pointer")
|
||||
endif()
|
||||
set(USE_SYSTEM_CURL OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_HEADLESS)
|
||||
message(STATUS "Enabling Headless! Disabling GUI.")
|
||||
set(ENABLE_QT 0)
|
||||
set(USE_DISCORD_PRESENCE 0)
|
||||
endif()
|
||||
|
||||
# Set file offset size to 64 bits. On modern Unixes, this is typically already the case. Exceptions:
|
||||
#
|
||||
# glibc may default to 32 bits. This can be configured by setting _FILE_OFFSET_BITS=64.
|
||||
#
|
||||
# bionic (Android) defaults to 32 bits for 32-bit ABIs. Here too we can use _FILE_OFFSET_BITS=64,
|
||||
# but only on API 25 and up. Since we're currently supporting older API levels and 32-bit Android
|
||||
# isn't a build configuration we officially support, let's leave this as it is for now.
|
||||
# More details: https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
|
||||
if(NOT ANDROID AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
add_definitions(-D_LARGEFILE_SOURCE)
|
||||
endif()
|
||||
|
||||
if(LIBRETRO AND ANDROID AND CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
add_definitions(-D_LARGEFILE_SOURCE)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Dependency checking
|
||||
#
|
||||
# TODO: We should have options for dependencies included in the externals to
|
||||
# override autodetection of system libraries and force the usage of the
|
||||
# externals.
|
||||
include(CheckLib)
|
||||
include(CheckCXXSourceRuns)
|
||||
|
||||
set(OpenGL_GL_PREFERENCE GLVND CACHE STRING "Linux-only: if GLVND, use the vendor-neutral GL libraries (default). If LEGACY, use the legacy ones (might be necessary to have optirun/primusrun work)")
|
||||
set_property(CACHE OpenGL_GL_PREFERENCE PROPERTY STRINGS GLVND LEGACY)
|
||||
find_package(OpenGL)
|
||||
if (OPENGL_GL)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(ENABLE_X11)
|
||||
pkg_check_modules(X11 x11 IMPORTED_TARGET)
|
||||
if(X11_FOUND)
|
||||
add_definitions(-DHAVE_X11=1)
|
||||
pkg_check_modules(XRANDR xrandr IMPORTED_TARGET)
|
||||
if(XRANDR_FOUND)
|
||||
add_definitions(-DHAVE_XRANDR=1)
|
||||
endif()
|
||||
pkg_check_modules(X11_INPUT REQUIRED xi>=1.5.0 IMPORTED_TARGET)
|
||||
message(STATUS "X11 support enabled")
|
||||
else()
|
||||
message(WARNING "X11 support enabled but not found. This build will not support X11.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_EGL)
|
||||
find_package(EGL)
|
||||
if(EGL_FOUND)
|
||||
add_definitions(-DHAVE_EGL=1)
|
||||
message(STATUS "EGL OpenGL interface enabled")
|
||||
else()
|
||||
message(WARNING "EGL support enabled but not found. This build will not support EGL.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENCODE_FRAMEDUMPS)
|
||||
if(WIN32)
|
||||
if(_M_X86_64)
|
||||
set(FFMPEG_DIR Externals/FFmpeg-bin/x64)
|
||||
elseif(_M_ARM_64)
|
||||
set(FFMPEG_DIR Externals/FFmpeg-bin/ARM64)
|
||||
endif()
|
||||
endif()
|
||||
find_package(FFmpeg COMPONENTS avcodec avformat avutil swresample swscale)
|
||||
if(FFmpeg_FOUND)
|
||||
if(APPLE)
|
||||
find_library(COREMEDIA_LIBRARY CoreMedia)
|
||||
find_library(VIDEOTOOLBOX_LIBRARY VideoToolbox)
|
||||
find_library(COREVIDEO_LIBRARY CoreVideo)
|
||||
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||
endif()
|
||||
message(STATUS "libav/ffmpeg found, enabling AVI frame dumps")
|
||||
add_definitions(-DHAVE_FFMPEG)
|
||||
if(WIN32)
|
||||
# Our prebuilt binaries depend on Bcrypt
|
||||
set_property(TARGET FFmpeg::avutil APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES "Bcrypt.lib"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "libav/ffmpeg not found, disabling AVI frame dumps")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_HWDB)
|
||||
find_package(LIBUDEV REQUIRED)
|
||||
if(LIBUDEV_FOUND)
|
||||
message(STATUS "libudev found, enabling hardware database")
|
||||
add_definitions(-DHAVE_LIBUDEV=1)
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't find libudev. Can't build hardware database.\nDisable ENABLE_HWDB if you wish to build without hardware database support")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_EVDEV)
|
||||
find_package(LIBUDEV REQUIRED)
|
||||
find_package(LIBEVDEV REQUIRED)
|
||||
if(LIBUDEV_FOUND AND LIBEVDEV_FOUND)
|
||||
message(STATUS "libevdev/libudev found, enabling evdev controller backend")
|
||||
add_definitions(-DHAVE_LIBUDEV=1)
|
||||
add_definitions(-DHAVE_LIBEVDEV=1)
|
||||
else()
|
||||
if(NOT LIBRETRO)
|
||||
message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
message(STATUS "Using named pipes as controller inputs")
|
||||
add_definitions(-DUSE_PIPES=1)
|
||||
message(STATUS "Watching game memory for changes")
|
||||
add_definitions(-DUSE_MEMORYWATCHER=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ANALYTICS)
|
||||
message(STATUS "Enabling analytics collection (subject to end-user opt-in)")
|
||||
add_definitions(-DUSE_ANALYTICS=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_AUTOUPDATE)
|
||||
message(STATUS "Enabling automatic update support")
|
||||
add_definitions(-DAUTOUPDATE=1)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Setup include directories (and make sure they are preferred over the Externals)
|
||||
#
|
||||
include_directories(Source/Core)
|
||||
if(ANDROID)
|
||||
include_directories(Source/Android)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Process externals and setup their include directories
|
||||
#
|
||||
# NOTES about adding Externals:
|
||||
# - If an external provides a target, or one can be introduced with find_package, consider using it.
|
||||
# - If a target doesn't exist, consider introducing a target for it with add_library and adding all necessary
|
||||
# includes, definitions, etc, to that target. This way, only libraries that need those attributes simply
|
||||
# need to link that target in, as opposed to them being provided to every library
|
||||
# (which is the case with the directory-based include_directories, add_definitions, etc)
|
||||
#
|
||||
# - make sure to tell cmake to link them statically or dynamically (most
|
||||
# should be linked statically)
|
||||
# - place the CMakeLists.txt in the first-level subdirectory, e.g.
|
||||
# Externals/zlib/CMakeLists.txt (that is: NOT in some Src/ subdirectory)
|
||||
#
|
||||
if (_M_X86_64)
|
||||
add_subdirectory(Externals/Bochs_disasm)
|
||||
endif()
|
||||
add_subdirectory(Externals/cpp-optparse)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(FMT
|
||||
fmt>=10.1 fmt::fmt Externals/fmt
|
||||
)
|
||||
|
||||
add_subdirectory(Externals/imgui)
|
||||
add_subdirectory(Externals/implot)
|
||||
|
||||
dolphin_find_optional_system_library(glslang Externals/glslang DOLPHIN_TRY_VERSIONS 15 16)
|
||||
|
||||
# SPIRV-Cross is used on Windows for GLSL to HLSL conversion for the Direct3D 11 and Direct3D 12
|
||||
# video backends, and on Apple devices for the Metal video backend.
|
||||
if(WIN32 OR APPLE)
|
||||
add_subdirectory(Externals/spirv_cross)
|
||||
endif()
|
||||
add_subdirectory(Externals/tinygltf)
|
||||
|
||||
if(ENABLE_VULKAN)
|
||||
add_definitions(-DHAS_VULKAN)
|
||||
|
||||
if(APPLE AND USE_BUNDLED_MOLTENVK)
|
||||
add_subdirectory(Externals/MoltenVK)
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID AND _M_ARM_64)
|
||||
add_subdirectory(Externals/libadrenotools)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT (WIN32 AND _M_ARM_64))
|
||||
# OpenGL is available on all platforms except windows-arm64
|
||||
add_definitions(-DHAS_OPENGL)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(ANDROID)
|
||||
set(USE_SYSTEM_Iconv OFF)
|
||||
endif()
|
||||
dolphin_find_optional_system_library(Iconv Externals/libiconv 1.14)
|
||||
endif()
|
||||
|
||||
dolphin_find_optional_system_library(pugixml Externals/pugixml)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(ENET libenet>=1.3.18 enet::enet Externals/enet)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(xxhash libxxhash>=0.8.2 xxhash::xxhash Externals/xxhash)
|
||||
|
||||
dolphin_find_optional_system_library(BZip2 Externals/bzip2)
|
||||
|
||||
dolphin_find_optional_system_library(LibLZMA Externals/liblzma)
|
||||
# Imported target added in CMake 3.14
|
||||
dolphin_make_imported_target_if_missing(LibLZMA::LibLZMA LIBLZMA)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(ZSTD libzstd>=1.4.0 zstd::zstd Externals/zstd)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(ZLIB zlib>=1.3.1 ZLIB::ZLIB Externals/zlib-ng)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(minizip-ng
|
||||
"minizip-ng>=4.0.4" MINIZIP::minizip-ng Externals/minizip-ng
|
||||
)
|
||||
|
||||
dolphin_find_optional_system_library(LZO Externals/LZO)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(lz4 liblz4>=1.8 LZ4::LZ4 Externals/lz4)
|
||||
|
||||
dolphin_find_optional_system_library_pkgconfig(SPNG spng spng::spng Externals/libspng)
|
||||
|
||||
# Using static FreeSurround from Externals
|
||||
# There is no system FreeSurround library.
|
||||
message(STATUS "Using static FreeSurround from Externals")
|
||||
add_subdirectory(Externals/FreeSurround)
|
||||
|
||||
if (APPLE OR WIN32)
|
||||
message(STATUS "Using ed25519 from Externals")
|
||||
add_subdirectory(Externals/ed25519)
|
||||
include_directories(Externals/ed25519)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CUBEB)
|
||||
dolphin_find_optional_system_library(CUBEB Externals/cubeb)
|
||||
add_definitions(-DHAVE_CUBEB)
|
||||
endif()
|
||||
|
||||
if(NOT ANDROID AND NOT IOS AND NOT WEBOS)
|
||||
dolphin_find_optional_system_library(LibUSB Externals/libusb)
|
||||
add_definitions(-D__LIBUSB__)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SDL)
|
||||
dolphin_find_optional_system_library(SDL3 Externals/SDL 3.2.0)
|
||||
add_definitions(-DHAVE_SDL3)
|
||||
endif()
|
||||
|
||||
dolphin_find_optional_system_library(SFML Externals/SFML 3.0 COMPONENTS Network System)
|
||||
|
||||
if(USE_UPNP)
|
||||
dolphin_find_optional_system_library(MINIUPNPC Externals/miniupnpc 1.6)
|
||||
add_definitions(-DUSE_UPNP)
|
||||
endif()
|
||||
|
||||
dolphin_find_optional_system_library(MBEDTLS Externals/mbedtls 2.28)
|
||||
|
||||
dolphin_find_optional_system_library(CURL Externals/curl)
|
||||
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
dolphin_find_optional_system_library(HIDAPI Externals/hidapi)
|
||||
endif()
|
||||
|
||||
if(USE_DISCORD_PRESENCE)
|
||||
message(STATUS "Using static DiscordRPC from Externals")
|
||||
add_subdirectory(Externals/discord-rpc EXCLUDE_FROM_ALL)
|
||||
include_directories(Externals/discord-rpc/include)
|
||||
endif()
|
||||
|
||||
if(USE_MGBA)
|
||||
dolphin_find_optional_system_library(LIBMGBA Externals/mGBA 0.11)
|
||||
endif()
|
||||
|
||||
if(LIBRETRO AND TARGET mgba)
|
||||
set_property(TARGET mgba APPEND PROPERTY COMPILE_DEFINITIONS DISABLE_THREADING)
|
||||
set_property(TARGET mgba PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
find_package(SYSTEMD)
|
||||
if(SYSTEMD_FOUND)
|
||||
message(STATUS "libsystemd found, enabling traversal server watchdog support")
|
||||
add_definitions(-DHAVE_LIBSYSTEMD)
|
||||
else()
|
||||
message(STATUS "libsystemd not found, disabling traversal server watchdog support")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
include_directories(Externals/wil/include)
|
||||
include_directories(Externals/OpenAL/include)
|
||||
endif()
|
||||
|
||||
include_directories(Externals/picojson)
|
||||
|
||||
add_subdirectory(Externals/expr)
|
||||
|
||||
add_subdirectory(Externals/FatFs)
|
||||
|
||||
if (USE_RETRO_ACHIEVEMENTS)
|
||||
add_subdirectory(Externals/rcheevos)
|
||||
endif()
|
||||
|
||||
if (NOT IOS)
|
||||
add_subdirectory(Externals/watcher)
|
||||
endif()
|
||||
|
||||
# Any other platform or BSD is currently unsupported by cpp-ipc
|
||||
if(WIN32 OR LINUX OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "QNX")
|
||||
add_subdirectory(Externals/cpp-ipc)
|
||||
add_definitions(-DHAVE_CPPIPC)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Pre-build events: Define configuration variables and write SCM info header
|
||||
#
|
||||
|
||||
# Remove in-tree revision information generated by Visual Studio
|
||||
# This is because the compiler will check in-tree first and use this, even if it is outdated
|
||||
file(REMOVE "${PROJECT_SOURCE_DIR}/Source/Core/Common/scmrev.h")
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common)
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common/scmrev.h)
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common/scmrev.h)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Source/Core)
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Source/Core/VersionInfo.plist)
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/Source/Core/VersionInfo.plist)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Flatpak)
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml)
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(NOT GIT_FOUND)
|
||||
set(GIT_EXECUTABLE "")
|
||||
endif()
|
||||
add_custom_target(
|
||||
dolphin_scmrev
|
||||
${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -DDISTRIBUTOR=${DISTRIBUTOR} -DDOLPHIN_DEFAULT_UPDATE_TRACK=${DOLPHIN_DEFAULT_UPDATE_TRACK} -DGIT_FOUND=${GIT_FOUND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DDOLPHIN_WC_REVISION=${DOLPHIN_WC_REVISION} -DDOLPHIN_WC_DESCRIBE=${DOLPHIN_WC_DESCRIBE} -DDOLPHIN_WC_BRANCH=${DOLPHIN_WC_BRANCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/ScmRevGen.cmake
|
||||
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common/scmrev.h" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/DolphinQt/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/MacUpdater/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# This is here so #include "Common/scmrev.h" finds the generated header.
|
||||
include_directories("${PROJECT_BINARY_DIR}/Source/Core")
|
||||
|
||||
########################################
|
||||
# Unit testing.
|
||||
#
|
||||
if(ENABLE_TESTS)
|
||||
dolphin_find_optional_system_library_pkgconfig(GTEST
|
||||
gtest gtest::gtest Externals/gtest
|
||||
)
|
||||
# dolphin_find_optional_system_library_pkgconfig() doesn't add an alias if it
|
||||
# uses the bundled libraries, so we add one ourselves.
|
||||
if (NOT TARGET gtest::gtest)
|
||||
add_library(gtest::gtest ALIAS gtest)
|
||||
endif()
|
||||
# Force gtest to link the C runtime dynamically on Windows in order to avoid
|
||||
# runtime mismatches.
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
else()
|
||||
message(STATUS "Unit tests are disabled")
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Process Dolphin source now that all setup is complete
|
||||
#
|
||||
add_subdirectory(Source)
|
||||
|
||||
########################################
|
||||
# Install shared data files
|
||||
#
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
|
||||
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/Sys PATTERN)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin")
|
||||
install(FILES COPYING DESTINATION ${datadir})
|
||||
install(DIRECTORY LICENSES DESTINATION ${datadir}/LICENSES PATTERN)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
|
||||
# Install the application icon and menu item
|
||||
install(FILES Data/dolphin-emu.svg
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)
|
||||
install(FILES Data/dolphin-emu.png
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps)
|
||||
install(FILES Data/dolphin-emu.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||
# Install manpages
|
||||
install(FILES Data/dolphin-emu.6
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
|
||||
install(FILES Data/dolphin-emu-nogui.6
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
|
||||
endif()
|
||||
|
||||
# packaging information
|
||||
set(CPACK_PACKAGE_NAME "dolphin-emu")
|
||||
set(CPACK_PACKAGE_VENDOR "Dolphin Team")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${DOLPHIN_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${DOLPHIN_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/Data/cpack_package_description.txt)
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A GameCube and Wii emulator")
|
||||
|
||||
set(CPACK_RPM_PACKAGE_GROUP System/Emulators/Other)
|
||||
set(CPACK_RPM_PACKAGE_LICENSE GPL-2.0)
|
||||
# TODO: CPACK_RESOURCE_FILE_README
|
||||
# TODO: CPACK_RESOURCE_FILE_WELCOME
|
||||
# TODO: CPACK_PACKAGE_ICON
|
||||
# TODO: CPACK_NSIS_*
|
||||
# TODO: Use CPack components for DSPSpy, etc => cpack_add_component
|
||||
|
||||
# Debian Specific. Install dpkg-dev for automatic deps generation
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "Games")
|
||||
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;ZIP")
|
||||
set(CPACK_SOURCE_IGNORE_FILES "\\\\.#;/#;.*~;\\\\.swp;/\\\\.git")
|
||||
list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}")
|
||||
|
||||
# CPack must be included after the CPACK_* variables are set in order for those
|
||||
# variables to take effect.
|
||||
Include(CPack)
|
||||
@@ -1,432 +0,0 @@
|
||||
{
|
||||
"version": 6,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "ninja-generator",
|
||||
"generator": "Ninja",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-generator",
|
||||
"generator": "Visual Studio 18 2026",
|
||||
"toolset": {
|
||||
"value": "v145",
|
||||
"strategy": "set"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "release",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_CONFIGURATION_TYPES": "Release"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_CONFIGURATION_TYPES": "Debug"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "generic",
|
||||
"toolchainFile": "CMake/DolphinToolchain.cmake",
|
||||
"cacheVariables": {
|
||||
"ARCH": "generic"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "x64",
|
||||
"toolchainFile": "CMake/DolphinToolchain.cmake",
|
||||
"cacheVariables": {
|
||||
"ARCH": "x86_64"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "arm64",
|
||||
"toolchainFile": "CMake/DolphinToolchain.cmake",
|
||||
"cacheVariables": {
|
||||
"ARCH": "arm64"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "release-generic",
|
||||
"inherits": ["release", "generic"],
|
||||
"binaryDir": "${sourceDir}/build/release/generic",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "release-x64",
|
||||
"inherits": ["release", "x64"],
|
||||
"binaryDir": "${sourceDir}/build/release/x64",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "release-arm64",
|
||||
"inherits": ["release", "arm64"],
|
||||
"binaryDir": "${sourceDir}/build/release/arm64",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "debug-generic",
|
||||
"inherits": ["debug", "generic"],
|
||||
"binaryDir": "${sourceDir}/build/debug/generic",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "debug-x64",
|
||||
"inherits": ["debug", "x64"],
|
||||
"binaryDir": "${sourceDir}/build/debug/x64",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "debug-arm64",
|
||||
"inherits": ["debug", "arm64"],
|
||||
"binaryDir": "${sourceDir}/build/debug/arm64",
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "visualstudio-generic",
|
||||
"inherits": ["generic", "visualstudio-generator"],
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-x64",
|
||||
"inherits": ["x64", "visualstudio-generator"],
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "set"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-arm64",
|
||||
"inherits": ["arm64", "visualstudio-generator"],
|
||||
"architecture": {
|
||||
"value": "arm64",
|
||||
"strategy": "set"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "ninja-generic",
|
||||
"inherits": ["generic", "ninja-generator"],
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "ninja-x64",
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"inherits": ["x64", "ninja-generator"],
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "ninja-arm64",
|
||||
"architecture": {
|
||||
"value": "arm64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"inherits": ["arm64", "ninja-generator"],
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "visualstudio-release-generic",
|
||||
"displayName": "Configure: Release - Visual Studio - Generic",
|
||||
"inherits": ["release-generic", "visualstudio-generic"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-release-x64",
|
||||
"displayName": "Configure: Release - Visual Studio - x64",
|
||||
"inherits": ["release-x64", "visualstudio-x64"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-release-arm64",
|
||||
"displayName": "Configure: Release - Visual Studio - ARM64",
|
||||
"inherits": ["release-arm64", "visualstudio-arm64"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-generic",
|
||||
"displayName": "Configure: Debug - Visual Studio - Generic",
|
||||
"inherits": ["debug-generic", "visualstudio-generic"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-x64",
|
||||
"displayName": "Configure: Debug - Visual Studio - x64",
|
||||
"inherits": ["debug-x64", "visualstudio-x64"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-arm64",
|
||||
"displayName": "Configure: Debug - Visual Studio - ARM64",
|
||||
"inherits": ["debug-arm64", "visualstudio-arm64"],
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-generic",
|
||||
"displayName": "Configure: Release - Ninja - Generic",
|
||||
"inherits": ["release-generic", "ninja-generic"]
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-x64",
|
||||
"displayName": "Configure: Release - Ninja - x64",
|
||||
"inherits": ["release-x64", "ninja-x64"]
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-arm64",
|
||||
"displayName": "Configure: Release - Ninja - ARM64",
|
||||
"inherits": ["release-arm64", "ninja-arm64"]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-generic",
|
||||
"displayName": "Configure: Debug - Ninja - Generic",
|
||||
"inherits": ["debug-generic", "ninja-generic"]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-x64",
|
||||
"displayName": "Configure: Debug - Ninja - x64",
|
||||
"inherits": ["debug-x64", "ninja-x64"]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-arm64",
|
||||
"displayName": "Configure: Debug - Ninja - ARM64",
|
||||
"inherits": ["debug-arm64", "ninja-arm64"]
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "visualstudio-build-release-generic",
|
||||
"displayName": "Build: Release - Visual Studio - Generic",
|
||||
"configurePreset": "visualstudio-release-generic",
|
||||
"configuration": "Release",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-build-release-x64",
|
||||
"displayName": "Build: Release - Visual Studio - x64",
|
||||
"configurePreset": "visualstudio-release-x64",
|
||||
"configuration": "Release",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-build-release-arm64",
|
||||
"displayName": "Build: Release - Visual Studio - ARM64",
|
||||
"configurePreset": "visualstudio-release-arm64",
|
||||
"configuration": "Release",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-build-debug-generic",
|
||||
"displayName": "Build: Debug - Visual Studio - Generic",
|
||||
"configurePreset": "visualstudio-debug-generic",
|
||||
"configuration": "Debug",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-build-debug-x64",
|
||||
"displayName": "Build: Debug - Visual Studio - x64",
|
||||
"configurePreset": "visualstudio-debug-x64",
|
||||
"configuration": "Debug",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-build-debug-arm64",
|
||||
"displayName": "Build: Debug - Visual Studio - ARM64",
|
||||
"configurePreset": "visualstudio-debug-arm64",
|
||||
"configuration": "Debug",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-release-generic",
|
||||
"displayName": "Build: Release - Ninja - Generic",
|
||||
"configurePreset": "ninja-release-generic"
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-release-x64",
|
||||
"displayName": "Build: Release - Ninja - x64",
|
||||
"configurePreset": "ninja-release-x64"
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-release-arm64",
|
||||
"displayName": "Build: Release - Ninja - ARM64",
|
||||
"configurePreset": "ninja-release-arm64"
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-debug-generic",
|
||||
"displayName": "Build: Debug - Ninja - Generic",
|
||||
"configurePreset": "ninja-debug-generic"
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-debug-x64",
|
||||
"displayName": "Build: Debug - Ninja - x64",
|
||||
"configurePreset": "ninja-debug-x64"
|
||||
},
|
||||
{
|
||||
"name": "ninja-build-debug-arm64",
|
||||
"displayName": "Build: Debug - Ninja - ARM64",
|
||||
"configurePreset": "ninja-debug-arm64"
|
||||
}
|
||||
],
|
||||
"workflowPresets": [
|
||||
{
|
||||
"name": "visualstudio-release-generic",
|
||||
"displayName": "Release - Visual Studio - Generic",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-release-generic" },
|
||||
{ "type": "build", "name": "visualstudio-build-release-generic" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-release-x64",
|
||||
"displayName": "Release - Visual Studio - x64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-release-x64" },
|
||||
{ "type": "build", "name": "visualstudio-build-release-x64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-release-arm64",
|
||||
"displayName": "Release - Visual Studio - ARM64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-release-arm64" },
|
||||
{ "type": "build", "name": "visualstudio-build-release-arm64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-generic",
|
||||
"displayName": "Debug - Visual Studio - Generic",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-debug-generic" },
|
||||
{ "type": "build", "name": "visualstudio-build-debug-generic" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-x64",
|
||||
"displayName": "Debug - Visual Studio - x64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-debug-x64" },
|
||||
{ "type": "build", "name": "visualstudio-build-debug-x64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "visualstudio-debug-arm64",
|
||||
"displayName": "Debug - Visual Studio - ARM64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "visualstudio-debug-arm64" },
|
||||
{ "type": "build", "name": "visualstudio-build-debug-arm64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-generic",
|
||||
"displayName": "Release - Ninja - Generic",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-release-generic" },
|
||||
{ "type": "build", "name": "ninja-build-release-generic" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-x64",
|
||||
"displayName": "Release - Ninja - x64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-release-x64" },
|
||||
{ "type": "build", "name": "ninja-build-release-x64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-release-arm64",
|
||||
"displayName": "Release - Ninja - ARM64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-release-arm64" },
|
||||
{ "type": "build", "name": "ninja-build-release-arm64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-generic",
|
||||
"displayName": "Debug - Ninja - Generic",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-debug-generic" },
|
||||
{ "type": "build", "name": "ninja-build-debug-generic" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-x64",
|
||||
"displayName": "Debug - Ninja - x64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-debug-x64" },
|
||||
{ "type": "build", "name": "ninja-build-debug-x64" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ninja-debug-arm64",
|
||||
"displayName": "Debug - Ninja - ARM64",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "ninja-debug-arm64" },
|
||||
{ "type": "build", "name": "ninja-build-debug-arm64" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
add_library(bdisasm STATIC
|
||||
dis_decode.cc
|
||||
dis_groups.cc
|
||||
resolve.cc
|
||||
syntax.cc
|
||||
)
|
||||
dolphin_disable_warnings(bdisasm)
|
||||
|
||||
if (WIN32)
|
||||
target_sources(bdisasm
|
||||
PRIVATE
|
||||
stdafx.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(bdisasm
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
add_library(FatFs STATIC
|
||||
ff.c
|
||||
ffunicode.c
|
||||
diskio.h
|
||||
ff.h
|
||||
ffconf.h
|
||||
)
|
||||
|
||||
target_include_directories(FatFs
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
set(SRCS
|
||||
source/ChannelMaps.cpp
|
||||
source/KissFFT.cpp
|
||||
source/KissFFTR.cpp
|
||||
source/FreeSurroundDecoder.cpp
|
||||
)
|
||||
|
||||
add_library(FreeSurround STATIC ${SRCS})
|
||||
dolphin_disable_warnings(FreeSurround)
|
||||
target_include_directories(FreeSurround PUBLIC include)
|
||||
target_compile_options(FreeSurround PRIVATE -w)
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
add_library(lzo2 STATIC
|
||||
minilzo.c
|
||||
)
|
||||
dolphin_disable_warnings(lzo2)
|
||||
|
||||
target_include_directories(lzo2
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
add_library(LZO::LZO ALIAS lzo2)
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(MOLTENVK_VERSION "v1.2.8")
|
||||
|
||||
ExternalProject_Add(MoltenVK
|
||||
GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git
|
||||
GIT_TAG ${MOLTENVK_VERSION}
|
||||
|
||||
CONFIGURE_COMMAND ${CMAKE_CURRENT_LIST_DIR}/configure.sh <LOG_DIR> <SOURCE_DIR> ${MOLTENVK_VERSION}
|
||||
|
||||
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patch.sh ${CMAKE_SOURCE_DIR}/Externals/MoltenVK/patches/ ${MOLTENVK_VERSION}
|
||||
|
||||
BUILD_COMMAND make -C <SOURCE_DIR> macos
|
||||
BUILD_IN_SOURCE ON
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib
|
||||
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
LOG_OUTPUT_ON_FAILURE ON
|
||||
)
|
||||
Vendored
-35
@@ -1,35 +0,0 @@
|
||||
set(SDL_SHARED OFF)
|
||||
set(SDL_STATIC ON)
|
||||
set(SDL_TEST_LIBRARY OFF)
|
||||
set(SDL_TESTS OFF)
|
||||
set(SDL_DISABLE_INSTALL ON)
|
||||
set(SDL_DISABLE_INSTALL_DOCS ON)
|
||||
set(SDL_INSTALL_TESTS OFF)
|
||||
set(SDL_UNIX_CONSOLE_BUILD ON)
|
||||
|
||||
set(SDL_AUDIO OFF)
|
||||
set(SDL_VIDEO OFF)
|
||||
set(SDL_GPU OFF)
|
||||
set(SDL_RENDER OFF)
|
||||
set(SDL_CAMERA OFF)
|
||||
set(SDL_DIALOG OFF)
|
||||
set(SDL_TRAY OFF)
|
||||
|
||||
if(CCACHE_BIN)
|
||||
set(SDL_CCACHE ON)
|
||||
set(CCACHE_BINARY ${CCACHE_BIN})
|
||||
endif()
|
||||
|
||||
if(LibUSB_TYPE STREQUAL Bundled)
|
||||
set(LibUSB_FOUND TRUE)
|
||||
set(SDL_HIDAPI_LIBUSB_SHARED OFF)
|
||||
endif()
|
||||
|
||||
add_subdirectory(SDL)
|
||||
|
||||
if (TARGET SDL3)
|
||||
dolphin_disable_warnings(SDL3)
|
||||
endif()
|
||||
if (TARGET SDL3-static)
|
||||
dolphin_disable_warnings(SDL3-static)
|
||||
endif()
|
||||
Vendored
-34
@@ -1,34 +0,0 @@
|
||||
set(SRC_NETWORK
|
||||
SFML/src/SFML/Network/Http.cpp
|
||||
SFML/src/SFML/Network/IpAddress.cpp
|
||||
SFML/src/SFML/Network/Packet.cpp
|
||||
SFML/src/SFML/Network/Socket.cpp
|
||||
SFML/src/SFML/Network/SocketSelector.cpp
|
||||
SFML/src/SFML/Network/TcpListener.cpp
|
||||
SFML/src/SFML/Network/TcpSocket.cpp
|
||||
SFML/src/SFML/Network/UdpSocket.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND SRC_NETWORK SFML/src/SFML/Network/Win32/SocketImpl.cpp)
|
||||
else()
|
||||
list(APPEND SRC_NETWORK SFML/src/SFML/Network/Unix/SocketImpl.cpp)
|
||||
endif()
|
||||
|
||||
set(SRC_SYSTEM
|
||||
SFML/src/SFML/System/Err.cpp
|
||||
SFML/include/SFML/System/String.hpp
|
||||
SFML/src/SFML/System/String.cpp
|
||||
SFML/src/SFML/System/Utils.cpp
|
||||
)
|
||||
|
||||
add_library(sfml-network STATIC ${SRC_NETWORK})
|
||||
add_library(sfml-system STATIC ${SRC_SYSTEM})
|
||||
target_compile_features(sfml-network PUBLIC cxx_std_20)
|
||||
target_compile_features(sfml-system PUBLIC cxx_std_20)
|
||||
target_compile_definitions(sfml-system PUBLIC SFML_STATIC)
|
||||
target_include_directories(sfml-system PUBLIC SFML/include PRIVATE SFML/src)
|
||||
target_include_directories(sfml-network PUBLIC SFML/include PRIVATE SFML/src)
|
||||
target_link_libraries(sfml-network PUBLIC sfml-system)
|
||||
dolphin_disable_warnings(sfml-network)
|
||||
dolphin_disable_warnings(sfml-system)
|
||||
Vendored
-79
@@ -1,79 +0,0 @@
|
||||
project(bzip2 C)
|
||||
|
||||
# TODO: Use bzip2 1.1.0's native support for CMake static builds once it releases.
|
||||
|
||||
include(CheckTypeSize)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
|
||||
# Check to see if we have large file support
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
|
||||
# We add these other definitions here because CheckTypeSize.cmake
|
||||
# in CMake 2.4.x does not automatically do so and we want
|
||||
# compatibility with CMake 2.4.x.
|
||||
if(HAVE_SYS_TYPES_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
|
||||
endif()
|
||||
if(HAVE_STDINT_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
|
||||
endif()
|
||||
if(HAVE_STDDEF_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
|
||||
endif()
|
||||
check_type_size(off64_t OFF64_T)
|
||||
if(HAVE_OFF64_T)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE=1)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
|
||||
|
||||
# Check for fseeko
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
if(NOT HAVE_FSEEKO)
|
||||
add_definitions(-DNO_FSEEKO)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Check for unistd.h
|
||||
#
|
||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||
if(HAVE_UNISTD_H)
|
||||
add_definitions(-DHAVE_UNISTD_H)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
#============================================================================
|
||||
# bzip2
|
||||
#============================================================================
|
||||
|
||||
set(BZIP2_PUBLIC_HDRS
|
||||
bzip2/bzlib.h
|
||||
)
|
||||
set(BZIP2_PRIVATE_HDRS
|
||||
bzip2/bzlib_private.h
|
||||
)
|
||||
set(BZIP2_SRCS
|
||||
bzip2/blocksort.c
|
||||
bzip2/huffman.c
|
||||
bzip2/crctable.c
|
||||
bzip2/randtable.c
|
||||
bzip2/compress.c
|
||||
bzip2/decompress.c
|
||||
bzip2/bzlib.c
|
||||
)
|
||||
|
||||
add_library(bzip2 STATIC ${BZIP2_SRCS} ${BZIP2_PUBLIC_HDRS} ${BZIP2_PRIVATE_HDRS})
|
||||
add_library(BZip2::BZip2 ALIAS bzip2)
|
||||
dolphin_disable_warnings(bzip2)
|
||||
|
||||
target_include_directories(bzip2
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bzip2
|
||||
)
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
add_subdirectory(cpp-ipc EXCLUDE_FROM_ALL)
|
||||
|
||||
dolphin_disable_warnings(ipc)
|
||||
|
||||
if (NOT MSVC)
|
||||
target_compile_options(ipc PRIVATE "-fexceptions")
|
||||
endif ()
|
||||
|
||||
add_library(cpp-ipc::ipc ALIAS ipc)
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
set(SRCS
|
||||
cpp-optparse/OptionParser.cpp
|
||||
cpp-optparse/OptionParser.h
|
||||
)
|
||||
|
||||
add_library(cpp-optparse STATIC ${SRCS})
|
||||
target_compile_features(cpp-optparse PUBLIC cxx_std_11)
|
||||
target_compile_options(cpp-optparse PRIVATE -fexceptions)
|
||||
dolphin_disable_warnings(cpp-optparse)
|
||||
|
||||
target_include_directories(cpp-optparse
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpp-optparse
|
||||
)
|
||||
Vendored
-360
@@ -1,360 +0,0 @@
|
||||
# TODO
|
||||
# - backend selection via command line, rather than simply detecting headers.
|
||||
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
project(cubeb
|
||||
VERSION 0.0.0)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
option(BUILD_RUST_LIBS "Build rust backends" OFF)
|
||||
option(BUNDLE_SPEEX "Bundle the speex library" OFF)
|
||||
option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON)
|
||||
option(USE_SANITIZERS "Use sanitizers" ON)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
|
||||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
endif()
|
||||
|
||||
if(USE_SANITIZERS)
|
||||
if(NOT COMMAND add_sanitizers)
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cubeb/cmake/sanitizers-cmake/cmake")
|
||||
find_package(Sanitizers)
|
||||
if(NOT COMMAND add_sanitizers)
|
||||
message(FATAL_ERROR "Could not find sanitizers-cmake: run\n\tgit submodule update --init --recursive\nin base git checkout")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
macro(add_sanitizers UNUSED)
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
if (BUILD_RUST_LIBS)
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-pulse-rs")
|
||||
set(USE_PULSE_RUST 1)
|
||||
endif()
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs")
|
||||
set(USE_AUDIOUNIT_RUST 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# On OS/2, visibility attribute is not supported.
|
||||
if(NOT OS2)
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_WARNING_LEVEL 4)
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -fno-exceptions -fno-rtti")
|
||||
else()
|
||||
#string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Disable RTTI
|
||||
#string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Disable Exceptions
|
||||
endif()
|
||||
|
||||
add_library(cubeb
|
||||
cubeb/src/cubeb.c
|
||||
cubeb/src/cubeb_mixer.cpp
|
||||
cubeb/src/cubeb_resampler.cpp
|
||||
cubeb/src/cubeb_log.cpp
|
||||
cubeb/src/cubeb_strings.c
|
||||
cubeb/src/cubeb_utils.cpp
|
||||
)
|
||||
dolphin_disable_warnings(cubeb)
|
||||
target_include_directories(cubeb
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cubeb/include> $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
set_target_properties(cubeb PROPERTIES
|
||||
VERSION ${cubeb_VERSION}
|
||||
SOVERSION ${cubeb_VERSION_MAJOR}
|
||||
)
|
||||
|
||||
add_sanitizers(cubeb)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(cubeb EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exports/cubeb_export.h)
|
||||
target_include_directories(cubeb
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/exports>
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cubeb/include/${PROJECT_NAME} TYPE INCLUDE)
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/exports/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
configure_package_config_file(
|
||||
"cubeb/Config.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(TARGETS cubeb EXPORT "${PROJECT_NAME}Targets")
|
||||
install(
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
NAMESPACE "${PROJECT_NAME}::"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
if(NOT BUNDLE_SPEEX)
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(speexdsp IMPORTED_TARGET speexdsp)
|
||||
if(speexdsp_FOUND)
|
||||
add_library(speex ALIAS PkgConfig::speexdsp)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET speex)
|
||||
add_library(speex OBJECT cubeb/subprojects/speex/resample.c)
|
||||
dolphin_disable_warnings(speex)
|
||||
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
target_include_directories(speex INTERFACE cubeb/subprojects)
|
||||
target_compile_definitions(speex PUBLIC
|
||||
OUTSIDE_SPEEX
|
||||
FLOATING_POINT
|
||||
EXPORT=
|
||||
RANDOM_PREFIX=speex
|
||||
)
|
||||
endif()
|
||||
|
||||
# $<BUILD_INTERFACE:> required because of https://gitlab.kitware.com/cmake/cmake/-/issues/15415
|
||||
target_link_libraries(cubeb PRIVATE $<BUILD_INTERFACE:speex>)
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
|
||||
# Threads needed by cubeb_log, _pulse, _alsa, _jack, _sndio, _oss and _sun
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
target_link_libraries(cubeb PRIVATE Threads::Threads)
|
||||
|
||||
if(LAZY_LOAD_LIBS)
|
||||
check_include_files(pulse/pulseaudio.h USE_PULSE)
|
||||
check_include_files(alsa/asoundlib.h USE_ALSA)
|
||||
check_include_files(jack/jack.h USE_JACK)
|
||||
check_include_files(sndio.h USE_SNDIO)
|
||||
#check_include_files(aaudio/AAudio.h USE_AAUDIO)
|
||||
set(USE_AAUDIO OFF) # too new for the Android versions we're targetting
|
||||
|
||||
if(USE_PULSE OR USE_ALSA OR USE_JACK OR USE_SNDIO OR USE_AAUDIO)
|
||||
target_link_libraries(cubeb PRIVATE ${CMAKE_DL_LIBS})
|
||||
|
||||
if(ANDROID)
|
||||
target_compile_definitions(cubeb PRIVATE __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(libpulse IMPORTED_TARGET libpulse)
|
||||
if(libpulse_FOUND)
|
||||
set(USE_PULSE ON)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBPULSE_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE PkgConfig::libpulse)
|
||||
endif()
|
||||
|
||||
pkg_check_modules(alsa IMPORTED_TARGET alsa)
|
||||
if(alsa_FOUND)
|
||||
set(USE_ALSA ON)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBASOUND_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE PkgConfig::alsa)
|
||||
endif()
|
||||
|
||||
pkg_check_modules(jack IMPORTED_TARGET jack)
|
||||
if(jack_FOUND)
|
||||
set(USE_JACK ON)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBJACK_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE PkgConfig::jack)
|
||||
endif()
|
||||
|
||||
check_include_files(sndio.h USE_SNDIO)
|
||||
if(USE_SNDIO AND NOT LIBRETRO)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBSNDIO_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE sndio)
|
||||
endif()
|
||||
|
||||
#check_include_files(aaudio/AAudio.h USE_AAUDIO)
|
||||
set(USE_AAUDIO OFF) # too new for the Android versions we're targetting
|
||||
if(USE_AAUDIO)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBAAUDIO_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE aaudio)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_PULSE)
|
||||
target_sources(cubeb PRIVATE cubeb/src/cubeb_pulse.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_PULSE)
|
||||
endif()
|
||||
|
||||
if(USE_ALSA)
|
||||
target_sources(cubeb PRIVATE cubeb/src/cubeb_alsa.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_ALSA)
|
||||
endif()
|
||||
|
||||
if(USE_JACK)
|
||||
target_sources(cubeb PRIVATE cubeb/src/cubeb_jack.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_JACK)
|
||||
endif()
|
||||
|
||||
if(USE_SNDIO)
|
||||
target_sources(cubeb PRIVATE cubeb/src/cubeb_sndio.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_SNDIO)
|
||||
endif()
|
||||
|
||||
if(USE_AAUDIO)
|
||||
target_sources(cubeb PRIVATE cubeb/src/cubeb_aaudio.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AAUDIO)
|
||||
|
||||
# set this definition to enable low latency mode. Possibly bad for battery
|
||||
target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_LOW_LATENCY)
|
||||
|
||||
# set this definition to enable power saving mode. Possibly resulting
|
||||
# in high latency
|
||||
# target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_LOW_POWER_SAVING)
|
||||
|
||||
# set this mode to make the backend use an exclusive stream.
|
||||
# will decrease latency.
|
||||
# target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_EXCLUSIVE_STREAM)
|
||||
endif()
|
||||
|
||||
check_include_files(AudioUnit/AudioUnit.h USE_AUDIOUNIT)
|
||||
if(USE_AUDIOUNIT)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_audiounit.cpp
|
||||
cubeb/src/cubeb_osx_run_loop.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT)
|
||||
target_link_libraries(cubeb PRIVATE "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices")
|
||||
endif()
|
||||
|
||||
check_include_files(audioclient.h USE_WASAPI)
|
||||
if(USE_WASAPI)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_wasapi.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_WASAPI)
|
||||
target_link_libraries(cubeb PRIVATE avrt ole32 ksuser)
|
||||
endif()
|
||||
|
||||
check_include_files("windows.h;mmsystem.h" USE_WINMM)
|
||||
if(USE_WINMM)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_winmm.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_WINMM)
|
||||
target_link_libraries(cubeb PRIVATE winmm)
|
||||
endif()
|
||||
|
||||
check_include_files(SLES/OpenSLES.h USE_OPENSL)
|
||||
if(USE_OPENSL)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_opensl.cpp
|
||||
cubeb/src/cubeb-jni.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_OPENSL)
|
||||
target_link_libraries(cubeb PRIVATE OpenSLES)
|
||||
endif()
|
||||
|
||||
check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
|
||||
if(HAVE_SYS_SOUNDCARD_H)
|
||||
try_compile(USE_OSS "${PROJECT_BINARY_DIR}/compile_tests"
|
||||
${PROJECT_SOURCE_DIR}/cubeb/cmake/compile_tests/oss_is_v4.c)
|
||||
if(USE_OSS)
|
||||
# strlcpy is not available on BSD systems that use glibc,
|
||||
# like Debian kfreebsd, so try using libbsd if available
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(strlcpy string.h HAVE_STRLCPY)
|
||||
if(NOT HAVE_STRLCPY)
|
||||
pkg_check_modules(libbsd-overlay IMPORTED_TARGET libbsd-overlay)
|
||||
if(libbsd-overlay_FOUND)
|
||||
target_link_libraries(cubeb PRIVATE PkgConfig::libbsd-overlay)
|
||||
set(HAVE_STRLCPY true)
|
||||
endif()
|
||||
endif()
|
||||
if (HAVE_STRLCPY)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_oss.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_OSS)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_include_files(android/log.h USE_AUDIOTRACK)
|
||||
if(USE_AUDIOTRACK)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_audiotrack.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOTRACK)
|
||||
target_link_libraries(cubeb PRIVATE log)
|
||||
endif()
|
||||
|
||||
check_include_files(sys/audioio.h USE_SUN)
|
||||
if(USE_SUN)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_sun.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_SUN)
|
||||
endif()
|
||||
|
||||
check_include_files(kai.h USE_KAI)
|
||||
if(USE_KAI)
|
||||
target_sources(cubeb PRIVATE
|
||||
cubeb/src/cubeb_kai.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_KAI)
|
||||
target_link_libraries(cubeb PRIVATE kai)
|
||||
endif()
|
||||
|
||||
if(USE_PULSE AND USE_PULSE_RUST)
|
||||
include(ExternalProject)
|
||||
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
|
||||
ExternalProject_Add(
|
||||
cubeb_pulse_rs
|
||||
DOWNLOAD_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND cargo build COMMAND cargo build --release
|
||||
BUILD_ALWAYS ON
|
||||
BINARY_DIR "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-pulse-rs"
|
||||
INSTALL_COMMAND ""
|
||||
LOG_BUILD ON)
|
||||
add_dependencies(cubeb cubeb_pulse_rs)
|
||||
target_compile_definitions(cubeb PRIVATE USE_PULSE_RUST)
|
||||
target_link_libraries(cubeb PRIVATE
|
||||
debug "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a"
|
||||
optimized "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse)
|
||||
endif()
|
||||
|
||||
if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
|
||||
include(ExternalProject)
|
||||
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
|
||||
ExternalProject_Add(
|
||||
cubeb_coreaudio_rs
|
||||
DOWNLOAD_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND cargo build COMMAND cargo build --release
|
||||
BUILD_ALWAYS ON
|
||||
BINARY_DIR "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs"
|
||||
INSTALL_COMMAND ""
|
||||
LOG_BUILD ON)
|
||||
add_dependencies(cubeb cubeb_coreaudio_rs)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT_RUST)
|
||||
target_link_libraries(cubeb PRIVATE
|
||||
debug "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a"
|
||||
optimized "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
|
||||
endif()
|
||||
add_library(cubeb::cubeb ALIAS cubeb)
|
||||
Vendored
-58
@@ -1,58 +0,0 @@
|
||||
set(BUILD_CURL_EXE OFF)
|
||||
set(BUILD_EXAMPLES OFF)
|
||||
set(BUILD_LIBCURL_DOCS OFF)
|
||||
set(BUILD_MISC_DOCS OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(BUILD_STATIC_LIBS ON)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(CURL_ENABLE_EXPORT_TARGET OFF)
|
||||
set(ENABLE_CURL_MANUAL OFF)
|
||||
|
||||
set(HTTP_ONLY ON)
|
||||
|
||||
set(CURL_USE_LIBPSL OFF)
|
||||
set(CURL_USE_LIBSSH2 OFF)
|
||||
set(CURL_ZLIB OFF CACHE BOOL "" FORCE)
|
||||
set(CURL_ZSTD OFF CACHE BOOL "" FORCE)
|
||||
set(CURL_BROTLI OFF CACHE BOOL "" FORCE)
|
||||
set(ZLIB_FOUND FALSE) # TODO: Remove once we update to cURL >=8.17.1 https://github.com/curl/curl/pull/20147
|
||||
set(ZSTD_FOUND FALSE) # TODO: Same as above
|
||||
set(BROTLI_FOUND FALSE) # TODO: Same as above
|
||||
set(USE_LIBIDN2 OFF)
|
||||
set(USE_NGHTTP2 OFF)
|
||||
|
||||
if(UNIX)
|
||||
# We use mbedtls on Unix(-like) systems and Android.
|
||||
set(CURL_USE_OPENSSL OFF)
|
||||
|
||||
# This is set if the dolphin_find_optional_system_library call from the main CMakeLists.txt
|
||||
# is able to find mbedtls on the system.
|
||||
if(MBEDTLS_FOUND)
|
||||
# We can just enable CURL_USE_MBEDTLS.
|
||||
set(CURL_USE_MBEDTLS ON)
|
||||
else()
|
||||
# HACK: Set some internal variables to pretend like mbedtls was found on the system.
|
||||
# We can't use CURL_USE_MBEDTLS with our copy from Externals, as that flag expects
|
||||
# mbedtls to be installed (the CMakeLists attempts to search for it with find_package).
|
||||
set(_ssl_enabled ON)
|
||||
set(USE_MBEDTLS ON)
|
||||
set(_curl_ca_bundle_supported TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CURL_USE_SCHANNEL ON)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(CURL_CA_PATH "/system/etc/security/cacerts" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
add_subdirectory(curl)
|
||||
|
||||
if(UNIX AND NOT MBEDTLS_FOUND)
|
||||
# HACK: Manually link with the mbedtls libraries.
|
||||
target_link_libraries(libcurl_static PRIVATE
|
||||
MbedTLS::mbedtls
|
||||
MbedTLS::mbedx509)
|
||||
endif()
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
cmake_minimum_required (VERSION 3.2.0...4.1.1)
|
||||
project (DiscordRPC)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# format
|
||||
file(GLOB_RECURSE ALL_SOURCE_FILES
|
||||
include/*.h
|
||||
src/*.cpp src/*.h src/*.c
|
||||
)
|
||||
|
||||
# add subdirs
|
||||
|
||||
add_subdirectory(src)
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/thirdparty/include)
|
||||
|
||||
option(ENABLE_IO_THREAD "Start up a separate I/O thread, otherwise I'd need to call an update function" ON)
|
||||
option(USE_STATIC_CRT "Use /MT[d] for dynamic library" OFF)
|
||||
option(WARNINGS_AS_ERRORS "When enabled, compiles with `-Werror` (on *nix platforms)." OFF)
|
||||
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
set(BASE_RPC_SRC
|
||||
${PROJECT_SOURCE_DIR}/include/discord_rpc.h
|
||||
discord_rpc.cpp
|
||||
${PROJECT_SOURCE_DIR}/include/discord_register.h
|
||||
rpc_connection.h
|
||||
rpc_connection.cpp
|
||||
serialization.h
|
||||
serialization.cpp
|
||||
connection.h
|
||||
backoff.h
|
||||
msg_queue.h
|
||||
)
|
||||
|
||||
if (${BUILD_SHARED_LIBS})
|
||||
if(WIN32)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} dllmain.cpp)
|
||||
endif(WIN32)
|
||||
endif(${BUILD_SHARED_LIBS})
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DDISCORD_WINDOWS)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_win.cpp discord_register_win.cpp)
|
||||
add_library(discord-rpc ${BASE_RPC_SRC})
|
||||
dolphin_disable_warnings(discord-rpc)
|
||||
if (MSVC)
|
||||
if(USE_STATIC_CRT)
|
||||
foreach(CompilerFlag
|
||||
CMAKE_CXX_FLAGS
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE)
|
||||
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
||||
endforeach()
|
||||
endif(USE_STATIC_CRT)
|
||||
target_compile_options(discord-rpc PRIVATE /EHsc
|
||||
/Wall
|
||||
/wd4100 # unreferenced formal parameter
|
||||
/wd4514 # unreferenced inline
|
||||
/wd4625 # copy constructor deleted
|
||||
/wd5026 # move constructor deleted
|
||||
/wd4626 # move assignment operator deleted
|
||||
/wd4668 # not defined preprocessor macro
|
||||
/wd4710 # function not inlined
|
||||
/wd4711 # function was inlined
|
||||
/wd4820 # structure padding
|
||||
/wd4946 # reinterpret_cast used between related classes
|
||||
/wd5027 # move assignment operator was implicitly defined as deleted
|
||||
)
|
||||
endif(MSVC)
|
||||
target_link_libraries(discord-rpc PRIVATE psapi advapi32)
|
||||
endif(WIN32)
|
||||
|
||||
if(UNIX)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_unix.cpp)
|
||||
|
||||
if (APPLE)
|
||||
add_definitions(-DDISCORD_OSX)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} discord_register_osx.m)
|
||||
else (APPLE)
|
||||
add_definitions(-DDISCORD_LINUX)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} discord_register_linux.cpp)
|
||||
endif(APPLE)
|
||||
|
||||
add_library(discord-rpc ${BASE_RPC_SRC})
|
||||
target_link_libraries(discord-rpc PUBLIC pthread)
|
||||
target_compile_options(discord-rpc PRIVATE
|
||||
-g
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
)
|
||||
|
||||
if (${WARNINGS_AS_ERRORS})
|
||||
target_compile_options(discord-rpc PRIVATE -Werror)
|
||||
endif (${WARNINGS_AS_ERRORS})
|
||||
|
||||
target_compile_options(discord-rpc PRIVATE
|
||||
-Wno-unknown-pragmas # pragma push thing doesn't work on clang
|
||||
-Wno-old-style-cast # it's fine
|
||||
-Wno-c++98-compat # that was almost 2 decades ago
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-missing-noreturn
|
||||
-Wno-padded # structure padding
|
||||
-Wno-covered-switch-default
|
||||
-Wno-exit-time-destructors # not sure about these
|
||||
-Wno-global-constructors
|
||||
)
|
||||
|
||||
if (${BUILD_SHARED_LIBS})
|
||||
target_compile_options(discord-rpc PRIVATE -fPIC)
|
||||
endif (${BUILD_SHARED_LIBS})
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(discord-rpc PRIVATE "-framework AppKit")
|
||||
endif (APPLE)
|
||||
endif(UNIX)
|
||||
|
||||
target_include_directories(discord-rpc PRIVATE ${RAPIDJSON}/include)
|
||||
|
||||
if (NOT ${ENABLE_IO_THREAD})
|
||||
target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DISABLE_IO_THREAD)
|
||||
endif (NOT ${ENABLE_IO_THREAD})
|
||||
|
||||
if (${BUILD_SHARED_LIBS})
|
||||
target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DYNAMIC_LIB)
|
||||
target_compile_definitions(discord-rpc PRIVATE -DDISCORD_BUILDING_SDK)
|
||||
endif(${BUILD_SHARED_LIBS})
|
||||
|
||||
# install
|
||||
|
||||
install(
|
||||
TARGETS discord-rpc
|
||||
EXPORT "discord-rpc"
|
||||
RUNTIME
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
INCLUDES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
"../include/discord_rpc.h"
|
||||
"../include/discord_register.h"
|
||||
DESTINATION "include"
|
||||
)
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
project(ed25519 C)
|
||||
|
||||
add_library(ed25519
|
||||
add_scalar.c
|
||||
ge.c
|
||||
keypair.c
|
||||
seed.c
|
||||
sign.c
|
||||
fe.c
|
||||
key_exchange.c
|
||||
sc.c
|
||||
sha512.c
|
||||
verify.c)
|
||||
dolphin_disable_warnings(ed25519)
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
add_subdirectory(enet)
|
||||
|
||||
dolphin_disable_warnings(enet)
|
||||
add_library(enet::enet ALIAS enet)
|
||||
target_include_directories(enet PUBLIC enet/include)
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
add_library(expr INTERFACE)
|
||||
target_include_directories(expr INTERFACE include/)
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
add_subdirectory(fmt)
|
||||
dolphin_disable_warnings(fmt)
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
set(ENABLE_PCH OFF)
|
||||
set(BUILD_EXTERNAL OFF)
|
||||
set(SKIP_GLSLANG_INSTALL ON)
|
||||
set(ENABLE_GLSLANG_BINARIES OFF)
|
||||
set(ENABLE_HLSL OFF)
|
||||
set(ENABLE_OPT OFF)
|
||||
set(ENABLE_CTEST OFF)
|
||||
set(ENABLE_EXCEPTIONS OFF)
|
||||
add_subdirectory(glslang)
|
||||
|
||||
if (TARGET glslang)
|
||||
target_include_directories(glslang
|
||||
# Silence warnings on glslang by flagging it as a system include
|
||||
SYSTEM PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/glslang>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/glslang/Public>
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
dolphin_disable_warnings(glslang)
|
||||
endif()
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
project(hidapi)
|
||||
|
||||
add_library(hidapi STATIC hidapi-src/hidapi/hidapi.h)
|
||||
dolphin_disable_warnings(hidapi)
|
||||
target_include_directories(hidapi PUBLIC hidapi-src/hidapi)
|
||||
|
||||
if(APPLE)
|
||||
target_sources(hidapi PRIVATE hidapi-src/mac/hid.c)
|
||||
elseif(WIN32)
|
||||
target_sources(hidapi PRIVATE hidapi-src/windows/hid.c)
|
||||
else()
|
||||
find_package(LIBUDEV)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LIBUDEV_FOUND)
|
||||
target_sources(hidapi PRIVATE hidapi-src/linux/hid.c)
|
||||
target_link_libraries(hidapi PRIVATE udev)
|
||||
else()
|
||||
target_sources(hidapi PRIVATE hidapi-src/libusb/hid.c)
|
||||
target_link_libraries(hidapi PRIVATE LibUSB::LibUSB)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(Hidapi::Hidapi ALIAS hidapi)
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
set(SRCS
|
||||
imgui/imgui.cpp
|
||||
imgui/imgui_demo.cpp
|
||||
imgui/imgui_draw.cpp
|
||||
imgui/imgui_tables.cpp
|
||||
imgui/imgui_widgets.cpp
|
||||
)
|
||||
|
||||
add_library(imgui STATIC ${SRCS})
|
||||
dolphin_disable_warnings(imgui)
|
||||
|
||||
target_include_directories(imgui
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/imgui"
|
||||
)
|
||||
|
||||
target_compile_definitions(imgui
|
||||
PUBLIC
|
||||
IMGUI_USER_CONFIG="imgui_user_config.h"
|
||||
)
|
||||
|
||||
target_link_libraries(imgui
|
||||
PRIVATE
|
||||
fmt::fmt
|
||||
)
|
||||
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
set(SRCS
|
||||
implot/implot.cpp
|
||||
implot/implot_items.cpp
|
||||
)
|
||||
|
||||
add_library(implot STATIC ${SRCS})
|
||||
dolphin_disable_warnings(implot)
|
||||
target_include_directories(implot
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/implot"
|
||||
PRIVATE imgui
|
||||
)
|
||||
|
||||
target_link_libraries(implot
|
||||
PRIVATE imgui
|
||||
PRIVATE fmt::fmt
|
||||
)
|
||||
|
||||
# https://github.com/epezent/implot/pull/565
|
||||
target_compile_options(implot PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/FI${CMAKE_CURRENT_SOURCE_DIR}/implot_isnan_fix.h>
|
||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-include ${CMAKE_CURRENT_SOURCE_DIR}/implot_isnan_fix.h>
|
||||
)
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
project(libiconv VERSION 1.18 LANGUAGES C)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(libcharset)
|
||||
|
||||
add_library(iconv STATIC
|
||||
lib/iconv.c
|
||||
)
|
||||
|
||||
target_link_libraries(iconv PUBLIC libcharset)
|
||||
target_include_directories(iconv
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/lib>
|
||||
)
|
||||
|
||||
dolphin_disable_warnings(iconv)
|
||||
add_library(Iconv::Iconv ALIAS iconv)
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
option(ENABLE_EXTRA "Enable a few rarely used encodings" OFF)
|
||||
option(ENABLE_RELOCATABLE "Allow the package to run at any location in the file system" ON)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
check_include_file("stddef.h" HAVE_STDDEF_H)
|
||||
check_include_file("stdlib.h" HAVE_STDLIB_H)
|
||||
check_include_file("string.h" HAVE_STRING_H)
|
||||
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(getc_unlocked HAVE_GETC_UNLOCKED)
|
||||
check_function_exists(mbrtowc HAVE_MBRTOWC)
|
||||
check_function_exists(setlocale HAVE_SETLOCALE)
|
||||
check_function_exists(wcrtomb HAVE_WCRTOMB)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITY)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(nl_langinfo "langinfo.h" HAVE_LANGINFO_CODESET)
|
||||
check_symbol_exists(iconv_open "iconv.h" HAVE_LANGINFO_CODESET)
|
||||
check_symbol_exists(O_NOFOLLOW "fcntl.h" HAVE_WORKING_O_NOFOLLOW)
|
||||
|
||||
include(CheckTypeSize)
|
||||
check_type_size(mbstate_t MBSTATE_T)
|
||||
check_type_size(mode_t MODE_T)
|
||||
check_type_size(ssize_t SSIZE_T)
|
||||
|
||||
if(NOT HAVE_MBSTATE_T)
|
||||
set(MBSTATE_T "int")
|
||||
else()
|
||||
unset(MBSTATE_T)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_MODE_T)
|
||||
set(MODE_T "int")
|
||||
else()
|
||||
unset(MODE_T)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_SSIZE_T)
|
||||
set(SSIZE_T "int")
|
||||
else()
|
||||
unset(SSIZE_T)
|
||||
endif()
|
||||
|
||||
include(TestBigEndian)
|
||||
test_big_endian(IS_BIG_ENDIAN)
|
||||
if(IS_BIG_ENDIAN)
|
||||
set(WORDS_LITTLEENDIAN 0)
|
||||
else()
|
||||
set(WORDS_LITTLEENDIAN 1)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h
|
||||
@ONLY
|
||||
)
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
project(libcharset VERSION 1.5 LANGUAGES C)
|
||||
|
||||
option(ENABLE_RELOCATABLE "Allow the package to run at any location in the file system" ON)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
check_include_file("dlfcn.h" HAVE_DLFCN_H)
|
||||
check_include_file("inttypes.h" HAVE_INTTYPES_H)
|
||||
check_include_file("mach-o/dyld.h" HAVE_MACH_O_DYLD_H)
|
||||
check_include_file("minix/config.h" HAVE_MINIX_CONFIG_H)
|
||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
||||
check_include_file("stdio.h" HAVE_STDIO_H)
|
||||
check_include_file("stdlib.h" HAVE_STDLIB_H)
|
||||
check_include_file("strings.h" HAVE_STRINGS_H)
|
||||
check_include_file("string.h" HAVE_STRING_H)
|
||||
check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||
check_include_file("wchar.h" HAVE_WCHAR_H)
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(copy_file_range HAVE_COPY_FILE_RANGE)
|
||||
check_function_exists(setlocale HAVE_SETLOCALE)
|
||||
check_function_exists(symlink HAVE_SYMLINK)
|
||||
check_function_exists(_NSGetExecutablePath HAVE__NSGETEXECUTABLEPATH)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITY)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(nl_langinfo "langinfo.h" HAVE_LANGINFO_CODESET)
|
||||
check_symbol_exists(O_NOATIME "fcntl.h" HAVE_WORKING_O_NOATIME)
|
||||
check_symbol_exists(O_NOFOLLOW "fcntl.h" HAVE_WORKING_O_NOFOLLOW)
|
||||
|
||||
set(STDC_HEADERS
|
||||
${HAVE_STDINT_H}
|
||||
${HAVE_STDIO_H}
|
||||
${HAVE_STDLIB_H}
|
||||
${HAVE_STRING_H}
|
||||
${HAVE_STRINGS_H}
|
||||
)
|
||||
|
||||
set(SYSTEM_DEFINES
|
||||
_ALL_SOURCE
|
||||
_DARWIN_C_SOURCE
|
||||
__EXTENSIONS__
|
||||
_GNU_SOURCE
|
||||
_HPUX_ALT_XOPEN_SOCKET_API
|
||||
_MINIX
|
||||
_NETBSD_SOURCE
|
||||
_OPENBSD_SOURCE
|
||||
_POSIX_SOURCE
|
||||
_POSIX_1_SOURCE
|
||||
_POSIX_PTHREAD_SEMANTICS
|
||||
__STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__
|
||||
__STDC_WANT_IEC_60559_DFP_EXT__
|
||||
__STDC_WANT_IEC_60559_EXT__
|
||||
__STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
__STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
__STDC_WANT_LIB_EXT2__
|
||||
__STDC_WANT_MATH_SPEC_FUNCS__
|
||||
_TANDEM_SOURCE
|
||||
_XOPEN_SOURCE
|
||||
)
|
||||
|
||||
foreach(def ${SYSTEM_DEFINES})
|
||||
add_compile_definitions(${def})
|
||||
endforeach()
|
||||
|
||||
set(PACKAGE_NAME "${PROJECT_NAME}")
|
||||
set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
set(PACKAGE_TARNAME "${PROJECT_NAME}")
|
||||
set(PACKAGE_BUGREPORT "")
|
||||
set(PACKAGE_URL "")
|
||||
set(PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
set(LT_OBJDIR ".libs")
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h
|
||||
@ONLY
|
||||
)
|
||||
|
||||
add_library(libcharset STATIC
|
||||
lib/localcharset.c
|
||||
)
|
||||
|
||||
target_include_directories(libcharset
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
)
|
||||
Vendored
-230
@@ -1,230 +0,0 @@
|
||||
project(lzma C)
|
||||
|
||||
include(CheckTypeSize)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
|
||||
# Check to see if we have large file support
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
|
||||
# We add these other definitions here because CheckTypeSize.cmake
|
||||
# in CMake 2.4.x does not automatically do so and we want
|
||||
# compatibility with CMake 2.4.x.
|
||||
if(HAVE_SYS_TYPES_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
|
||||
endif()
|
||||
if(HAVE_STDINT_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
|
||||
endif()
|
||||
if(HAVE_STDDEF_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
|
||||
endif()
|
||||
check_type_size(off64_t OFF64_T)
|
||||
if(HAVE_OFF64_T)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE=1)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
|
||||
|
||||
# Check for fseeko
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
if(NOT HAVE_FSEEKO)
|
||||
add_definitions(-DNO_FSEEKO)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Check for unistd.h
|
||||
#
|
||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||
if(HAVE_UNISTD_H)
|
||||
add_definitions(-DHAVE_UNISTD_H)
|
||||
endif()
|
||||
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
add_definitions(-DLZMA_API_STATIC)
|
||||
|
||||
if(NOT MINGW)
|
||||
add_definitions(-DHAVE_WCWIDTH=1)
|
||||
endif()
|
||||
|
||||
#============================================================================
|
||||
# lzma
|
||||
#============================================================================
|
||||
|
||||
set(LZMA_PUBLIC_HDRS
|
||||
api/lzma.h
|
||||
api/lzma/base.h
|
||||
api/lzma/bcj.h
|
||||
api/lzma/block.h
|
||||
api/lzma/check.h
|
||||
api/lzma/container.h
|
||||
api/lzma/delta.h
|
||||
api/lzma/filter.h
|
||||
api/lzma/hardware.h
|
||||
api/lzma/index.h
|
||||
api/lzma/index_hash.h
|
||||
api/lzma/lzma12.h
|
||||
api/lzma/stream_flags.h
|
||||
api/lzma/version.h
|
||||
api/lzma/vli.h
|
||||
)
|
||||
|
||||
set(LZMA_SRCS
|
||||
check/check.c
|
||||
check/check.h
|
||||
check/crc32_fast.c
|
||||
check/crc32_table_be.h
|
||||
check/crc32_table.c
|
||||
check/crc32_table_le.h
|
||||
check/crc64_fast.c
|
||||
check/crc64_table_be.h
|
||||
check/crc64_table.c
|
||||
check/crc64_table_le.h
|
||||
check/crc_macros.h
|
||||
check/sha256.c
|
||||
common/alone_decoder.c
|
||||
common/alone_decoder.h
|
||||
common/alone_encoder.c
|
||||
common/auto_decoder.c
|
||||
common/block_buffer_decoder.c
|
||||
common/block_buffer_encoder.c
|
||||
common/block_buffer_encoder.h
|
||||
common/block_decoder.c
|
||||
common/block_decoder.h
|
||||
common/block_encoder.c
|
||||
common/block_encoder.h
|
||||
common/block_header_decoder.c
|
||||
common/block_header_encoder.c
|
||||
common/block_util.c
|
||||
common/common.c
|
||||
common/common.h
|
||||
common/easy_buffer_encoder.c
|
||||
common/easy_decoder_memusage.c
|
||||
common/easy_encoder.c
|
||||
common/easy_encoder_memusage.c
|
||||
common/easy_preset.c
|
||||
common/easy_preset.h
|
||||
common/filter_buffer_decoder.c
|
||||
common/filter_buffer_encoder.c
|
||||
common/filter_common.c
|
||||
common/filter_common.h
|
||||
common/filter_decoder.c
|
||||
common/filter_decoder.h
|
||||
common/filter_encoder.c
|
||||
common/filter_encoder.h
|
||||
common/filter_flags_decoder.c
|
||||
common/filter_flags_encoder.c
|
||||
common/hardware_cputhreads.c
|
||||
common/hardware_physmem.c
|
||||
common/index.c
|
||||
common/index_decoder.c
|
||||
common/index_encoder.c
|
||||
common/index_encoder.h
|
||||
common/index.h
|
||||
common/index_hash.c
|
||||
common/memcmplen.h
|
||||
common/outqueue.c
|
||||
common/outqueue.h
|
||||
common/stream_buffer_decoder.c
|
||||
common/stream_buffer_encoder.c
|
||||
common/stream_decoder.c
|
||||
common/stream_decoder.h
|
||||
common/stream_encoder.c
|
||||
common/stream_encoder_mt.c
|
||||
common/stream_flags_common.c
|
||||
common/stream_flags_common.h
|
||||
common/stream_flags_decoder.c
|
||||
common/stream_flags_encoder.c
|
||||
common/vli_decoder.c
|
||||
common/vli_encoder.c
|
||||
common/vli_size.c
|
||||
delta/delta_common.c
|
||||
delta/delta_common.h
|
||||
delta/delta_decoder.c
|
||||
delta/delta_decoder.h
|
||||
delta/delta_encoder.c
|
||||
delta/delta_encoder.h
|
||||
delta/delta_private.h
|
||||
lz/lz_decoder.c
|
||||
lz/lz_decoder.h
|
||||
lz/lz_encoder.c
|
||||
lz/lz_encoder.h
|
||||
lz/lz_encoder_hash.h
|
||||
lz/lz_encoder_hash_table.h
|
||||
lz/lz_encoder_mf.c
|
||||
lzma/fastpos.h
|
||||
lzma/fastpos_table.c
|
||||
lzma/lzma2_decoder.c
|
||||
lzma/lzma2_decoder.h
|
||||
lzma/lzma2_encoder.c
|
||||
lzma/lzma2_encoder.h
|
||||
lzma/lzma_common.h
|
||||
lzma/lzma_decoder.c
|
||||
lzma/lzma_decoder.h
|
||||
lzma/lzma_encoder.c
|
||||
lzma/lzma_encoder.h
|
||||
lzma/lzma_encoder_optimum_fast.c
|
||||
lzma/lzma_encoder_optimum_normal.c
|
||||
lzma/lzma_encoder_presets.c
|
||||
lzma/lzma_encoder_private.h
|
||||
rangecoder/price.h
|
||||
rangecoder/price_table.c
|
||||
rangecoder/range_common.h
|
||||
rangecoder/range_decoder.h
|
||||
rangecoder/range_encoder.h
|
||||
simple/simple_coder.c
|
||||
simple/simple_coder.h
|
||||
simple/simple_decoder.c
|
||||
simple/simple_decoder.h
|
||||
simple/simple_encoder.c
|
||||
simple/simple_encoder.h
|
||||
simple/simple_private.h
|
||||
tuklib/mythread.h
|
||||
tuklib/sysdefs.h
|
||||
tuklib/tuklib_common.h
|
||||
tuklib/tuklib_config.h
|
||||
tuklib/tuklib_cpucores.c
|
||||
tuklib/tuklib_cpucores.h
|
||||
tuklib/tuklib_exit.c
|
||||
tuklib/tuklib_exit.h
|
||||
tuklib/tuklib_gettext.h
|
||||
tuklib/tuklib_integer.h
|
||||
tuklib/tuklib_mbstr_fw.c
|
||||
tuklib/tuklib_mbstr.h
|
||||
tuklib/tuklib_mbstr_width.c
|
||||
tuklib/tuklib_open_stdxxx.c
|
||||
tuklib/tuklib_open_stdxxx.h
|
||||
tuklib/tuklib_physmem.c
|
||||
tuklib/tuklib_physmem.h
|
||||
tuklib/tuklib_progname.c
|
||||
tuklib/tuklib_progname.h
|
||||
)
|
||||
|
||||
add_library(lzma STATIC ${LZMA_SRCS} ${LZMA_PUBLIC_HDRS})
|
||||
add_library(LibLZMA::LibLZMA ALIAS lzma)
|
||||
dolphin_disable_warnings(lzma)
|
||||
|
||||
target_compile_definitions(lzma PUBLIC LZMA_API_STATIC)
|
||||
|
||||
target_include_directories(lzma
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/api
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/check
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/delta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lz
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lzma
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rangecoder
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/simple
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tuklib
|
||||
)
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
option(SPNG_SHARED "Build shared lib" OFF)
|
||||
option(SPNG_STATIC "Build static lib" ON)
|
||||
option(BUILD_EXAMPLES "Build examples" OFF)
|
||||
|
||||
set(_PREV_CMAKE_SKIP_INSTALL_RULES "${CMAKE_SKIP_INSTALL_RULES}")
|
||||
set(CMAKE_SKIP_INSTALL_RULES TRUE)
|
||||
|
||||
add_subdirectory(libspng)
|
||||
|
||||
set(CMAKE_SKIP_INSTALL_RULES "${_PREV_CMAKE_SKIP_INSTALL_RULES}")
|
||||
|
||||
add_library(spng::spng ALIAS spng_static)
|
||||
Vendored
-139
@@ -1,139 +0,0 @@
|
||||
add_library(usb STATIC EXCLUDE_FROM_ALL
|
||||
libusb/libusb/core.c
|
||||
libusb/libusb/descriptor.c
|
||||
libusb/libusb/hotplug.c
|
||||
libusb/libusb/io.c
|
||||
libusb/libusb/strerror.c
|
||||
libusb/libusb/sync.c
|
||||
)
|
||||
dolphin_disable_warnings(usb)
|
||||
|
||||
set_target_properties(usb PROPERTIES VERSION 1.0.26)
|
||||
if(MSVC)
|
||||
target_include_directories(usb BEFORE PUBLIC libusb/libusb PRIVATE libusb/msvc)
|
||||
else()
|
||||
target_include_directories(usb
|
||||
# turns out other projects also have "config.h", so make sure the
|
||||
# LibUSB one comes first
|
||||
BEFORE
|
||||
|
||||
PUBLIC libusb/libusb
|
||||
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR CYGWIN)
|
||||
target_sources(usb PRIVATE
|
||||
libusb/libusb/os/threads_windows.c
|
||||
libusb/libusb/os/windows_common.c
|
||||
libusb/libusb/os/windows_usbdk.c
|
||||
libusb/libusb/os/windows_winusb.c
|
||||
libusb/libusb/os/events_windows.c
|
||||
)
|
||||
set(PLATFORM_WINDOWS TRUE)
|
||||
elseif(APPLE)
|
||||
target_sources(usb PRIVATE libusb/libusb/os/darwin_usb.c)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
find_library(OBJC_LIBRARY objc)
|
||||
find_library(SECURITY_LIBRARY Security)
|
||||
target_link_libraries(usb PRIVATE
|
||||
${COREFOUNDATION_LIBRARY}
|
||||
${IOKIT_LIBRARY}
|
||||
${OBJC_LIBRARY}
|
||||
${SECURITY_LIBRARY}
|
||||
)
|
||||
# # Dolphin on Android doesn't use libusb.
|
||||
#elseif(ANDROID)
|
||||
# target_sources(usb PRIVATE
|
||||
# libusb/libusb/os/linux_usbfs.c
|
||||
# libusb/libusb/os/linux_netlink.c
|
||||
# )
|
||||
# find_library(LOG_LIBRARY log)
|
||||
# target_link_libraries(usb PRIVATE ${LOG_LIBRARY})
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
target_sources(usb PRIVATE libusb/libusb/os/linux_usbfs.c)
|
||||
find_package(LIBUDEV)
|
||||
if(LIBUDEV_FOUND)
|
||||
target_sources(usb PRIVATE libusb/libusb/os/linux_udev.c)
|
||||
target_link_libraries(usb PRIVATE "${LIBUDEV_LIBRARIES}")
|
||||
target_include_directories(usb PRIVATE "${LIBUDEV_INCLUDE_DIR}")
|
||||
set(HAVE_LIBUDEV TRUE)
|
||||
else()
|
||||
target_sources(usb PRIVATE libusb/libusb/os/linux_netlink.c)
|
||||
endif()
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
target_sources(usb PRIVATE libusb/libusb/os/netbsd_usb.c)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
target_sources(usb PRIVATE libusb/libusb/os/openbsd_usb.c)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
target_sources(usb PRIVATE
|
||||
libusb/libusb/os/events_posix.c
|
||||
libusb/libusb/os/threads_posix.c
|
||||
)
|
||||
find_package(Threads REQUIRED)
|
||||
if(THREADS_HAVE_PTHREAD_ARG)
|
||||
target_compile_options(usb PUBLIC "-pthread")
|
||||
endif()
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
target_link_libraries(usb PRIVATE "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
set(PLATFORM_POSIX TRUE)
|
||||
endif()
|
||||
|
||||
# Create config.h
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFiles)
|
||||
#include(CheckLibraryExists)
|
||||
include(CheckTypeSize)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
check_include_files(asm/types.h HAVE_ASM_TYPES_H)
|
||||
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
||||
check_symbol_exists(EFD_CLOEXEC "sys/eventfd.h" HAVE_DECL_EFD_CLOEXEC)
|
||||
check_symbol_exists(EFD_NONBLOCK "sys/eventfd.h" HAVE_DECL_EFD_NONBLOCK)
|
||||
check_symbol_exists(TFD_CLOEXEC "sys/timerfd.h" HAVE_DECL_TFD_CLOEXEC)
|
||||
check_symbol_exists(TFD_NONBLOCK "sys/timerfd.h" HAVE_DECL_TFD_NONBLOCK)
|
||||
check_include_files(dlfcn.h HAVE_DLFCN_H)
|
||||
check_include_files(sys/eventfd.h HAVE_EVENTFD)
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(IOKit/usb/IOUSBHostFamilyDefinitions.h HAVE_IOKIT_USB_IOUSBHOSTFAMILYDEFINITIONS_H)
|
||||
#check_library_exists(udev HAVE_LIBUDEV)
|
||||
check_include_files(memory.h HAVE_MEMORY_H)
|
||||
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES poll.h)
|
||||
check_type_size("nfds_t" NFDS_T)
|
||||
unset(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
|
||||
check_function_exists(pipe2 HAVE_PIPE2)
|
||||
check_function_exists(pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK)
|
||||
check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
|
||||
check_function_exists(pthread_threadid_np HAVE_PTHREAD_THREADID_NP)
|
||||
check_include_files(stdint.h HAVE_STDINT_H)
|
||||
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_include_files(string.h HAVE_STRING_H)
|
||||
check_type_size("struct timespec" STRUCT_TIMESPEC)
|
||||
check_function_exists(syslog HAVE_SYSLOG)
|
||||
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_files(sys/timerfd.h HAVE_TIMERFD)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
configure_file(config.h.in config.h)
|
||||
|
||||
# We don't create an ALIAS here so that dependencies (SDL) that try_compile libusb
|
||||
# don't fail due to LibUSB::LibUSB being an alias target
|
||||
add_library(LibUSB::LibUSB INTERFACE IMPORTED GLOBAL)
|
||||
target_link_libraries(LibUSB::LibUSB
|
||||
INTERFACE
|
||||
usb
|
||||
)
|
||||
target_include_directories(LibUSB::LibUSB
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libusb/libusb
|
||||
)
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# We only want the static library, nothing else.
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||
set(LZ4_BUILD_CLI OFF)
|
||||
set(LZ4_BUILD_LEGACY_LZ4C OFF)
|
||||
set(LZ4_BUNDLED_MODE ON)
|
||||
|
||||
add_subdirectory(lz4/build/cmake)
|
||||
|
||||
dolphin_disable_warnings(lz4_static)
|
||||
add_library(LZ4::LZ4 ALIAS lz4_static)
|
||||
target_compile_definitions(lz4_static PRIVATE XXH_NAMESPACE=LZ4_)
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
set(LIBMGBA_ONLY ON)
|
||||
set(USE_LZMA ON)
|
||||
add_subdirectory(mgba EXCLUDE_FROM_ALL)
|
||||
dolphin_disable_warnings(mgba)
|
||||
|
||||
target_compile_definitions(mgba PUBLIC HAVE_CRC32 ENABLE_VFS ENABLE_DIRECTORIES)
|
||||
target_link_libraries(mgba ZLIB::ZLIB)
|
||||
|
||||
if(NOT MSVC)
|
||||
target_compile_options(mgba PRIVATE -Wno-unused-parameter -Wno-unused-result -Wno-unused-variable)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
target_compile_definitions(mgba PUBLIC ENABLE_VFS_FD)
|
||||
target_compile_definitions(mgba PRIVATE -Dfutimes=futimens)
|
||||
endif()
|
||||
|
||||
add_library(mGBA::mgba ALIAS mgba)
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
list (APPEND thirdparty_src)
|
||||
list (APPEND thirdparty_lib)
|
||||
list (APPEND thirdparty_inc_public)
|
||||
list (APPEND thirdparty_inc)
|
||||
list (APPEND thirdparty_def)
|
||||
|
||||
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/config.h get MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED RESULT_VARIABLE result)
|
||||
|
||||
if(${result} EQUAL 0)
|
||||
add_subdirectory(everest)
|
||||
endif()
|
||||
|
||||
set(thirdparty_src ${thirdparty_src} PARENT_SCOPE)
|
||||
set(thirdparty_lib ${thirdparty_lib} PARENT_SCOPE)
|
||||
set(thirdparty_inc_public ${thirdparty_inc_public} PARENT_SCOPE)
|
||||
set(thirdparty_inc ${thirdparty_inc} PARENT_SCOPE)
|
||||
set(thirdparty_def ${thirdparty_def} PARENT_SCOPE)
|
||||
@@ -1,28 +0,0 @@
|
||||
list (APPEND everest_src)
|
||||
list (APPEND everest_inc_public)
|
||||
list (APPEND everest_inc)
|
||||
list (APPEND everest_def)
|
||||
|
||||
set(everest_src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/library/everest.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/library/x25519.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/library/Hacl_Curve25519_joined.c
|
||||
)
|
||||
|
||||
list(APPEND everest_inc_public ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
list(APPEND everest_inc ${CMAKE_CURRENT_SOURCE_DIR}/include/everest ${CMAKE_CURRENT_SOURCE_DIR}/include/everest/kremlib)
|
||||
|
||||
if(INSTALL_MBEDTLS_HEADERS)
|
||||
|
||||
install(DIRECTORY include/everest
|
||||
DESTINATION include
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
endif(INSTALL_MBEDTLS_HEADERS)
|
||||
|
||||
set(thirdparty_src ${thirdparty_src} ${everest_src} PARENT_SCOPE)
|
||||
set(thirdparty_inc_public ${thirdparty_inc_public} ${everest_inc_public} PARENT_SCOPE)
|
||||
set(thirdparty_inc ${thirdparty_inc} ${everest_inc} PARENT_SCOPE)
|
||||
set(thirdparty_def ${thirdparty_def} ${everest_def} PARENT_SCOPE)
|
||||
Vendored
-274
@@ -1,274 +0,0 @@
|
||||
#
|
||||
# CMake build system design considerations:
|
||||
#
|
||||
# - Include directories:
|
||||
# + Do not define include directories globally using the include_directories
|
||||
# command but rather at the target level using the
|
||||
# target_include_directories command. That way, it is easier to guarantee
|
||||
# that targets are built using the proper list of include directories.
|
||||
# + Use the PUBLIC and PRIVATE keywords to specifiy the scope of include
|
||||
# directories. That way, a target linking to a library (using the
|
||||
# target_link_librairies command) inherits from the library PUBLIC include
|
||||
# directories and not from the PRIVATE ones.
|
||||
# + Note: there is currently one remaining include_directories command in the
|
||||
# CMake files. It is related to ZLIB support which is planned to be removed.
|
||||
# When the support is removed, the associated include_directories command
|
||||
# will be removed as well as this note.
|
||||
# - MBEDTLS_TARGET_PREFIX: CMake targets are designed to be alterable by calling
|
||||
# CMake in order to avoid target name clashes, via the use of
|
||||
# MBEDTLS_TARGET_PREFIX. The value of this variable is prefixed to the
|
||||
# mbedtls, mbedx509, mbedcrypto and apidoc targets.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12...4.1.1)
|
||||
|
||||
# https://cmake.org/cmake/help/latest/policy/CMP0011.html
|
||||
# Setting this policy is required in CMake >= 3.18.0, otherwise a warning is generated. The OLD
|
||||
# policy setting is deprecated, and will be removed in future versions.
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
# https://cmake.org/cmake/help/latest/policy/CMP0012.html
|
||||
# Setting the CMP0012 policy to NEW is required for FindPython3 to work with CMake 3.18.2
|
||||
# (there is a bug in this particular version), otherwise, setting the CMP0012 policy is required
|
||||
# for CMake versions >= 3.18.3 otherwise a deprecated warning is generated. The OLD policy setting
|
||||
# is deprecated and will be removed in future versions.
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
if(TEST_CPP)
|
||||
project("mbed TLS" C CXX)
|
||||
else()
|
||||
project("mbed TLS" C)
|
||||
endif()
|
||||
|
||||
# Set the project root directory.
|
||||
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
|
||||
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
|
||||
|
||||
option(ENABLE_PROGRAMS "Build mbed TLS programs." OFF)
|
||||
|
||||
option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF)
|
||||
# Dolphin: werror makes updating compilers painful
|
||||
option(MBEDTLS_FATAL_WARNINGS "Compiler warnings treated as errors" OFF)
|
||||
|
||||
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
|
||||
string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}")
|
||||
string(REGEX MATCH "IAR" CMAKE_COMPILER_IS_IAR "${CMAKE_C_COMPILER_ID}")
|
||||
string(REGEX MATCH "MSVC" CMAKE_COMPILER_IS_MSVC "${CMAKE_C_COMPILER_ID}")
|
||||
|
||||
# the test suites currently have compile errors with MSVC
|
||||
if(CMAKE_COMPILER_IS_MSVC)
|
||||
option(ENABLE_TESTING "Build mbed TLS tests." OFF)
|
||||
else()
|
||||
option(ENABLE_TESTING "Build mbed TLS tests." OFF)
|
||||
endif()
|
||||
|
||||
# Warning string - created as a list for compatibility with CMake 2.8
|
||||
set(WARNING_BORDER "*******************************************************\n")
|
||||
set(NULL_ENTROPY_WARN_L1 "**** WARNING! MBEDTLS_TEST_NULL_ENTROPY defined!\n")
|
||||
set(NULL_ENTROPY_WARN_L2 "**** THIS BUILD HAS NO DEFINED ENTROPY SOURCES\n")
|
||||
set(NULL_ENTROPY_WARN_L3 "**** AND IS *NOT* SUITABLE FOR PRODUCTION USE\n")
|
||||
|
||||
set(NULL_ENTROPY_WARNING "${WARNING_BORDER}"
|
||||
"${NULL_ENTROPY_WARN_L1}"
|
||||
"${NULL_ENTROPY_WARN_L2}"
|
||||
"${NULL_ENTROPY_WARN_L3}"
|
||||
"${WARNING_BORDER}")
|
||||
|
||||
set(CTR_DRBG_128_BIT_KEY_WARN_L1 "**** WARNING! MBEDTLS_CTR_DRBG_USE_128_BIT_KEY defined!\n")
|
||||
set(CTR_DRBG_128_BIT_KEY_WARN_L2 "**** Using 128-bit keys for CTR_DRBG limits the security of generated\n")
|
||||
set(CTR_DRBG_128_BIT_KEY_WARN_L3 "**** keys and operations that use random values generated to 128-bit security\n")
|
||||
|
||||
set(CTR_DRBG_128_BIT_KEY_WARNING "${WARNING_BORDER}"
|
||||
"${CTR_DRBG_128_BIT_KEY_WARN_L1}"
|
||||
"${CTR_DRBG_128_BIT_KEY_WARN_L2}"
|
||||
"${CTR_DRBG_128_BIT_KEY_WARN_L3}"
|
||||
"${WARNING_BORDER}")
|
||||
|
||||
# Python 3 is only needed here to check for configuration warnings.
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.15.0)
|
||||
set(Python3_FIND_STRATEGY LOCATION)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(Python3_Interpreter_FOUND)
|
||||
set(MBEDTLS_PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
endif()
|
||||
else()
|
||||
find_package(PythonInterp 3)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(MBEDTLS_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
endif()
|
||||
if(MBEDTLS_PYTHON_EXECUTABLE)
|
||||
|
||||
# If 128-bit keys are configured for CTR_DRBG, display an appropriate warning
|
||||
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
|
||||
RESULT_VARIABLE result)
|
||||
if(${result} EQUAL 0)
|
||||
message(WARNING ${CTR_DRBG_128_BIT_KEY_WARNING})
|
||||
endif()
|
||||
|
||||
# If NULL Entropy is configured, display an appropriate warning
|
||||
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_TEST_NULL_ENTROPY
|
||||
RESULT_VARIABLE result)
|
||||
if(${result} EQUAL 0)
|
||||
message(WARNING ${NULL_ENTROPY_WARNING})
|
||||
|
||||
if(NOT UNSAFE_BUILD)
|
||||
message(FATAL_ERROR "\
|
||||
\n\
|
||||
Warning! You have enabled MBEDTLS_TEST_NULL_ENTROPY. \
|
||||
This option is not safe for production use and negates all security \
|
||||
It is intended for development use only. \
|
||||
\n\
|
||||
To confirm you want to build with this option, re-run cmake with the \
|
||||
option: \n\
|
||||
cmake -DUNSAFE_BUILD=ON ")
|
||||
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If this is the root project add longer list of available CMAKE_BUILD_TYPE values
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||
CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
# Create a symbolic link from ${base_name} in the binary directory
|
||||
# to the corresponding path in the source directory.
|
||||
function(link_to_source base_name)
|
||||
# Get OS dependent path to use in `execute_process`
|
||||
if (CMAKE_HOST_WIN32)
|
||||
#mklink is an internal command of cmd.exe it can only work with \
|
||||
string(REPLACE "/" "\\" link "${CMAKE_CURRENT_BINARY_DIR}/${base_name}")
|
||||
string(REPLACE "/" "\\" target "${CMAKE_CURRENT_SOURCE_DIR}/${base_name}")
|
||||
else()
|
||||
set(link "${CMAKE_CURRENT_BINARY_DIR}/${base_name}")
|
||||
set(target "${CMAKE_CURRENT_SOURCE_DIR}/${base_name}")
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${link})
|
||||
if (CMAKE_HOST_UNIX)
|
||||
set(command ln -s ${target} ${link})
|
||||
else()
|
||||
if (IS_DIRECTORY ${target})
|
||||
set(command cmd.exe /c mklink /j ${link} ${target})
|
||||
else()
|
||||
set(command cmd.exe /c mklink /h ${link} ${target})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${command}
|
||||
RESULT_VARIABLE result
|
||||
ERROR_VARIABLE output)
|
||||
|
||||
if (NOT ${result} EQUAL 0)
|
||||
message(FATAL_ERROR "Could not create symbolic link for: ${target} --> ${output}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction(link_to_source)
|
||||
|
||||
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNU)
|
||||
# some warnings we want are not available with old GCC versions
|
||||
# note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings")
|
||||
if (GCC_VERSION VERSION_GREATER 3.0 OR GCC_VERSION VERSION_EQUAL 3.0)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat=2 -Wno-format-nonliteral")
|
||||
endif()
|
||||
if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla")
|
||||
endif()
|
||||
if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wlogical-op")
|
||||
endif()
|
||||
if (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
|
||||
endif()
|
||||
if (GCC_VERSION VERSION_GREATER 5.0)
|
||||
CHECK_C_COMPILER_FLAG("-Wformat-signedness" C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS)
|
||||
if(C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-signedness")
|
||||
endif()
|
||||
endif()
|
||||
if (GCC_VERSION VERSION_GREATER 7.0 OR GCC_VERSION VERSION_EQUAL 7.0)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-overflow=2 -Wformat-truncation")
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
|
||||
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
|
||||
set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
|
||||
set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
set(CMAKE_C_FLAGS_CHECK "-Os")
|
||||
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
|
||||
endif(CMAKE_COMPILER_IS_GNU)
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
|
||||
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
|
||||
set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
|
||||
set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
set(CMAKE_C_FLAGS_MEMSAN "-fsanitize=memory -O3")
|
||||
set(CMAKE_C_FLAGS_MEMSANDBG "-fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2")
|
||||
set(CMAKE_C_FLAGS_CHECK "-Os")
|
||||
endif(CMAKE_COMPILER_IS_CLANG)
|
||||
|
||||
if(CMAKE_COMPILER_IS_IAR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz")
|
||||
endif(CMAKE_COMPILER_IS_IAR)
|
||||
|
||||
if(CMAKE_COMPILER_IS_MSVC)
|
||||
# Strictest warnings
|
||||
# Dolphin/MSVC: we want to disable all warnings for externals
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
||||
endif(CMAKE_COMPILER_IS_MSVC)
|
||||
|
||||
if(MBEDTLS_FATAL_WARNINGS)
|
||||
if(CMAKE_COMPILER_IS_MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
||||
endif(CMAKE_COMPILER_IS_MSVC)
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNU)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||
if(UNSAFE_BUILD)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=cpp")
|
||||
set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_ASAN} -Wno-error=cpp")
|
||||
set(CMAKE_C_FLAGS_ASANDBG "${CMAKE_C_FLAGS_ASANDBG} -Wno-error=cpp")
|
||||
endif(UNSAFE_BUILD)
|
||||
endif(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNU)
|
||||
endif(MBEDTLS_FATAL_WARNINGS)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
|
||||
if(CMAKE_COMPILER_IS_GNU OR CMAKE_COMPILER_IS_CLANG)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
|
||||
endif(CMAKE_COMPILER_IS_GNU OR CMAKE_COMPILER_IS_CLANG)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
|
||||
|
||||
if(LIB_INSTALL_DIR)
|
||||
else()
|
||||
set(LIB_INSTALL_DIR lib)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ZLIB_SUPPORT)
|
||||
find_package(ZLIB)
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
include_directories(${ZLIB_INCLUDE_DIR})
|
||||
endif(ZLIB_FOUND)
|
||||
endif(ENABLE_ZLIB_SUPPORT)
|
||||
|
||||
add_subdirectory(include)
|
||||
|
||||
add_subdirectory(3rdparty)
|
||||
list(APPEND libs ${thirdparty_lib})
|
||||
|
||||
add_subdirectory(library)
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
|
||||
|
||||
if(INSTALL_MBEDTLS_HEADERS)
|
||||
|
||||
file(GLOB headers "mbedtls/*.h")
|
||||
file(GLOB psa_headers "psa/*.h")
|
||||
|
||||
install(FILES ${headers}
|
||||
DESTINATION include/mbedtls
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|
||||
|
||||
install(FILES ${psa_headers}
|
||||
DESTINATION include/psa
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|
||||
|
||||
endif(INSTALL_MBEDTLS_HEADERS)
|
||||
|
||||
# Make config.h available in an out-of-source build. ssl-opt.sh requires it.
|
||||
if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
link_to_source(mbedtls)
|
||||
link_to_source(psa)
|
||||
endif()
|
||||
-248
@@ -1,248 +0,0 @@
|
||||
option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON)
|
||||
option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF)
|
||||
option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF)
|
||||
option(LINK_WITH_TRUSTED_STORAGE "Explicitly link mbed TLS library to trusted_storage." OFF)
|
||||
|
||||
# Set the project root directory if it's not already defined, as may happen if
|
||||
# the library folder is included directly by a parent project, without
|
||||
# including the top level CMakeLists.txt.
|
||||
if(NOT DEFINED MBEDTLS_DIR)
|
||||
set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
set(src_crypto
|
||||
aes.c
|
||||
aesni.c
|
||||
arc4.c
|
||||
aria.c
|
||||
asn1parse.c
|
||||
asn1write.c
|
||||
base64.c
|
||||
bignum.c
|
||||
blowfish.c
|
||||
camellia.c
|
||||
ccm.c
|
||||
chacha20.c
|
||||
chachapoly.c
|
||||
cipher.c
|
||||
cipher_wrap.c
|
||||
constant_time.c
|
||||
cmac.c
|
||||
ctr_drbg.c
|
||||
des.c
|
||||
dhm.c
|
||||
ecdh.c
|
||||
ecdsa.c
|
||||
ecjpake.c
|
||||
ecp.c
|
||||
ecp_curves.c
|
||||
entropy.c
|
||||
entropy_poll.c
|
||||
error.c
|
||||
gcm.c
|
||||
havege.c
|
||||
hkdf.c
|
||||
hmac_drbg.c
|
||||
md.c
|
||||
md2.c
|
||||
md4.c
|
||||
md5.c
|
||||
memory_buffer_alloc.c
|
||||
mps_reader.c
|
||||
mps_trace.c
|
||||
nist_kw.c
|
||||
oid.c
|
||||
padlock.c
|
||||
pem.c
|
||||
pk.c
|
||||
pk_wrap.c
|
||||
pkcs12.c
|
||||
pkcs5.c
|
||||
pkparse.c
|
||||
pkwrite.c
|
||||
platform.c
|
||||
platform_util.c
|
||||
poly1305.c
|
||||
psa_crypto.c
|
||||
psa_crypto_aead.c
|
||||
psa_crypto_cipher.c
|
||||
psa_crypto_client.c
|
||||
psa_crypto_driver_wrappers.c
|
||||
psa_crypto_ecp.c
|
||||
psa_crypto_hash.c
|
||||
psa_crypto_mac.c
|
||||
psa_crypto_rsa.c
|
||||
psa_crypto_se.c
|
||||
psa_crypto_slot_management.c
|
||||
psa_crypto_storage.c
|
||||
psa_its_file.c
|
||||
ripemd160.c
|
||||
rsa.c
|
||||
rsa_internal.c
|
||||
sha1.c
|
||||
sha256.c
|
||||
sha512.c
|
||||
threading.c
|
||||
timing.c
|
||||
version.c
|
||||
version_features.c
|
||||
xtea.c
|
||||
)
|
||||
|
||||
list(APPEND src_crypto ${thirdparty_src})
|
||||
|
||||
set(src_x509
|
||||
certs.c
|
||||
pkcs11.c
|
||||
x509.c
|
||||
x509_create.c
|
||||
x509_crl.c
|
||||
x509_crt.c
|
||||
x509_csr.c
|
||||
x509write_crt.c
|
||||
x509write_csr.c
|
||||
)
|
||||
|
||||
set(src_tls
|
||||
debug.c
|
||||
net_sockets.c
|
||||
ssl_cache.c
|
||||
ssl_ciphersuites.c
|
||||
ssl_cli.c
|
||||
ssl_cookie.c
|
||||
ssl_msg.c
|
||||
ssl_srv.c
|
||||
ssl_ticket.c
|
||||
ssl_tls.c
|
||||
ssl_tls13_keys.c
|
||||
)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes")
|
||||
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wunreachable-code")
|
||||
endif(CMAKE_COMPILER_IS_CLANG)
|
||||
|
||||
if(WIN32)
|
||||
set(libs ${libs} ws2_32)
|
||||
endif(WIN32)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
endif()
|
||||
|
||||
if(HAIKU)
|
||||
set(libs ${libs} network)
|
||||
endif(HAIKU)
|
||||
|
||||
if(USE_PKCS11_HELPER_LIBRARY)
|
||||
set(libs ${libs} pkcs11-helper)
|
||||
endif(USE_PKCS11_HELPER_LIBRARY)
|
||||
|
||||
if(ENABLE_ZLIB_SUPPORT)
|
||||
set(libs ${libs} ${ZLIB_LIBRARIES})
|
||||
endif(ENABLE_ZLIB_SUPPORT)
|
||||
|
||||
if(LINK_WITH_PTHREAD)
|
||||
set(libs ${libs} pthread)
|
||||
endif()
|
||||
|
||||
if(LINK_WITH_TRUSTED_STORAGE)
|
||||
set(libs ${libs} trusted_storage)
|
||||
endif()
|
||||
|
||||
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
||||
message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
|
||||
endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
||||
|
||||
set(mbedtls_target "${MBEDTLS_TARGET_PREFIX}mbedtls")
|
||||
set(mbedx509_target "${MBEDTLS_TARGET_PREFIX}mbedx509")
|
||||
set(mbedcrypto_target "${MBEDTLS_TARGET_PREFIX}mbedcrypto")
|
||||
|
||||
set(mbedtls_target ${mbedtls_target} PARENT_SCOPE)
|
||||
set(mbedx509_target ${mbedx509_target} PARENT_SCOPE)
|
||||
set(mbedcrypto_target ${mbedcrypto_target} PARENT_SCOPE)
|
||||
|
||||
if (USE_STATIC_MBEDTLS_LIBRARY)
|
||||
set(mbedtls_static_target ${mbedtls_target})
|
||||
set(mbedx509_static_target ${mbedx509_target})
|
||||
set(mbedcrypto_static_target ${mbedcrypto_target})
|
||||
endif()
|
||||
|
||||
set(target_libraries ${mbedcrypto_target} ${mbedx509_target} ${mbedtls_target})
|
||||
|
||||
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
|
||||
string(APPEND mbedtls_static_target "_static")
|
||||
string(APPEND mbedx509_static_target "_static")
|
||||
string(APPEND mbedcrypto_static_target "_static")
|
||||
|
||||
list(APPEND target_libraries
|
||||
${mbedcrypto_static_target}
|
||||
${mbedx509_static_target}
|
||||
${mbedtls_static_target})
|
||||
endif()
|
||||
|
||||
if(USE_STATIC_MBEDTLS_LIBRARY)
|
||||
add_library(${mbedcrypto_static_target} STATIC ${src_crypto})
|
||||
dolphin_disable_warnings(${mbedcrypto_static_target})
|
||||
set_target_properties(${mbedcrypto_static_target} PROPERTIES OUTPUT_NAME mbedcrypto)
|
||||
target_link_libraries(${mbedcrypto_static_target} PUBLIC ${libs})
|
||||
|
||||
add_library(${mbedx509_static_target} STATIC ${src_x509})
|
||||
dolphin_disable_warnings(${mbedx509_static_target})
|
||||
set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509)
|
||||
target_link_libraries(${mbedx509_static_target} PUBLIC ${libs} ${mbedcrypto_static_target})
|
||||
|
||||
add_library(${mbedtls_static_target} STATIC ${src_tls})
|
||||
dolphin_disable_warnings(${mbedtls_static_target})
|
||||
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
|
||||
target_link_libraries(${mbedtls_static_target} PUBLIC ${libs} ${mbedx509_static_target})
|
||||
endif(USE_STATIC_MBEDTLS_LIBRARY)
|
||||
|
||||
if(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
add_library(${mbedcrypto_target} SHARED ${src_crypto})
|
||||
dolphin_disable_warnings(${mbedcrypto_target})
|
||||
set_target_properties(${mbedcrypto_target} PROPERTIES VERSION 2.28.0 SOVERSION 7)
|
||||
target_link_libraries(${mbedcrypto_target} PUBLIC ${libs})
|
||||
|
||||
add_library(${mbedx509_target} SHARED ${src_x509})
|
||||
dolphin_disable_warnings(${mbedx509_target})
|
||||
set_target_properties(${mbedx509_target} PROPERTIES VERSION 2.28.0 SOVERSION 1)
|
||||
target_link_libraries(${mbedx509_target} PUBLIC ${libs} ${mbedcrypto_target})
|
||||
|
||||
add_library(${mbedtls_target} SHARED ${src_tls})
|
||||
dolphin_disable_warnings(${mbedtls_target})
|
||||
set_target_properties(${mbedtls_target} PROPERTIES VERSION 2.28.0 SOVERSION 14)
|
||||
target_link_libraries(${mbedtls_target} PUBLIC ${libs} ${mbedx509_target})
|
||||
endif(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
|
||||
foreach(target IN LISTS target_libraries)
|
||||
add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support
|
||||
# Include public header files from /include and other directories
|
||||
# declared by /3rdparty/**/CMakeLists.txt. Include private header files
|
||||
# from /library and others declared by /3rdparty/**/CMakeLists.txt.
|
||||
# /library needs to be listed explicitly when building .c files outside
|
||||
# of /library (which currently means: under /3rdparty).
|
||||
target_include_directories(${target}
|
||||
PUBLIC ${MBEDTLS_DIR}/include/
|
||||
PUBLIC ${thirdparty_inc_public}
|
||||
PRIVATE ${MBEDTLS_DIR}/library/
|
||||
PRIVATE ${thirdparty_inc})
|
||||
target_compile_definitions(${target}
|
||||
PRIVATE ${thirdparty_def})
|
||||
install(TARGETS ${target}
|
||||
DESTINATION ${LIB_INSTALL_DIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|
||||
endforeach(target)
|
||||
|
||||
set(lib_target "${MBEDTLS_TARGET_PREFIX}lib")
|
||||
|
||||
add_custom_target(${lib_target} DEPENDS ${mbedcrypto_target} ${mbedx509_target} ${mbedtls_target})
|
||||
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
|
||||
add_dependencies(${lib_target} ${mbedcrypto_static_target} ${mbedx509_static_target} ${mbedtls_static_target})
|
||||
endif()
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
set(UPNPC_BUILD_STATIC ON)
|
||||
set(UPNPC_BUILD_SHARED OFF)
|
||||
set(UPNPC_BUILD_TESTS OFF)
|
||||
set(UPNPC_BUILD_SAMPLE OFF)
|
||||
set(UPNPC_NO_INSTALL ON)
|
||||
|
||||
add_subdirectory(miniupnp/miniupnpc)
|
||||
dolphin_disable_warnings(libminiupnpc-static)
|
||||
|
||||
add_library(Miniupnpc::miniupnpc ALIAS libminiupnpc-static)
|
||||
Vendored
-44
@@ -1,44 +0,0 @@
|
||||
set(MZ_COMPAT OFF)
|
||||
set(MZ_BUILD_TESTS OFF)
|
||||
set(MZ_BUILD_UNIT_TESTS OFF)
|
||||
set(MZ_BUILD_FUZZ_TESTS OFF)
|
||||
set(MZ_CODE_COVERAGE OFF)
|
||||
set(MZ_FETCH_LIBS OFF)
|
||||
set(MZ_BZIP2 OFF)
|
||||
set(MZ_PKCRYPT OFF)
|
||||
set(MZ_WZAES OFF)
|
||||
set(MZ_OPENSSL OFF)
|
||||
set(MZ_LIBBSD OFF)
|
||||
set(SKIP_INSTALL_ALL ON)
|
||||
|
||||
if(Iconv_TYPE STREQUAL Bundled)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Iconv TRUE)
|
||||
set(Iconv_FOUND TRUE)
|
||||
set(Iconv_LIBRARIES Iconv::Iconv)
|
||||
get_target_property(Iconv_INCLUDE_DIRS ${Iconv_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif()
|
||||
if(LibLZMA_TYPE STREQUAL Bundled)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_LibLZMA TRUE)
|
||||
set(LIBLZMA_FOUND TRUE)
|
||||
set(LIBLZMA_LIBRARIES LibLZMA::LibLZMA)
|
||||
get_target_property(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif()
|
||||
if(ZLIB_TYPE STREQUAL Bundled)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB TRUE)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
set(ZLIB_LIBRARIES ZLIB::ZLIB)
|
||||
set(ZLIB_INCLUDE_DIRS "$<TARGET_PROPERTY:ZLIB::ZLIB,INTERFACE_INCLUDE_DIRECTORIES>")
|
||||
endif()
|
||||
if(ZSTD_TYPE STREQUAL Bundled)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_ZSTD TRUE)
|
||||
set(ZSTD_FOUND TRUE)
|
||||
set(ZSTD_LIBRARIES zstd::zstd)
|
||||
get_target_property(ZSTD_INCLUDE_DIRS ${ZSTD_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif()
|
||||
|
||||
# minizip-ng otherwise uses system libraries when we provide them above
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig TRUE)
|
||||
set(PKGCONFIG_FOUND FALSE)
|
||||
|
||||
add_subdirectory(minizip-ng)
|
||||
dolphin_disable_warnings(minizip-ng)
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
set(PUGIXML_NO_EXCEPTIONS ON)
|
||||
set(PUGIXML_STATIC_CRT OFF)
|
||||
set(PUGIXML_BUILD_DEFINES OFF)
|
||||
set(PUGIXML_INSTALL OFF)
|
||||
|
||||
add_subdirectory(pugixml)
|
||||
dolphin_disable_warnings(pugixml-static)
|
||||
Vendored
-73
@@ -1,73 +0,0 @@
|
||||
add_library(rcheevos
|
||||
rcheevos/include/rc_api_editor.h
|
||||
rcheevos/include/rc_api_info.h
|
||||
rcheevos/include/rc_api_request.h
|
||||
rcheevos/include/rc_api_runtime.h
|
||||
rcheevos/include/rc_api_user.h
|
||||
rcheevos/include/rc_client.h
|
||||
rcheevos/include/rc_client_raintegration.h
|
||||
rcheevos/include/rc_consoles.h
|
||||
rcheevos/include/rc_error.h
|
||||
rcheevos/include/rc_export.h
|
||||
rcheevos/include/rc_hash.h
|
||||
rcheevos/include/rcheevos.h
|
||||
rcheevos/include/rc_runtime.h
|
||||
rcheevos/include/rc_runtime_types.h
|
||||
rcheevos/include/rc_util.h
|
||||
rcheevos/src/rapi/rc_api_common.c
|
||||
rcheevos/src/rapi/rc_api_common.h
|
||||
rcheevos/src/rapi/rc_api_editor.c
|
||||
rcheevos/src/rapi/rc_api_info.c
|
||||
rcheevos/src/rapi/rc_api_runtime.c
|
||||
rcheevos/src/rapi/rc_api_user.c
|
||||
rcheevos/src/rcheevos/alloc.c
|
||||
rcheevos/src/rcheevos/condition.c
|
||||
rcheevos/src/rcheevos/condset.c
|
||||
rcheevos/src/rcheevos/consoleinfo.c
|
||||
rcheevos/src/rcheevos/format.c
|
||||
rcheevos/src/rcheevos/lboard.c
|
||||
rcheevos/src/rcheevos/memref.c
|
||||
rcheevos/src/rcheevos/operand.c
|
||||
rcheevos/src/rcheevos/rc_internal.h
|
||||
rcheevos/src/rcheevos/rc_validate.c
|
||||
rcheevos/src/rcheevos/rc_validate.h
|
||||
rcheevos/src/rcheevos/richpresence.c
|
||||
rcheevos/src/rcheevos/runtime.c
|
||||
rcheevos/src/rcheevos/runtime_progress.c
|
||||
rcheevos/src/rcheevos/trigger.c
|
||||
rcheevos/src/rcheevos/value.c
|
||||
rcheevos/src/rhash/aes.c
|
||||
rcheevos/src/rhash/aes.h
|
||||
rcheevos/src/rhash/cdreader.c
|
||||
rcheevos/src/rhash/hash.c
|
||||
rcheevos/src/rhash/hash_disc.c
|
||||
rcheevos/src/rhash/md5.c
|
||||
rcheevos/src/rhash/md5.h
|
||||
rcheevos/src/rhash/rc_hash_internal.h
|
||||
rcheevos/src/rc_client.c
|
||||
rcheevos/src/rc_client_external.c
|
||||
rcheevos/src/rc_client_external.h
|
||||
rcheevos/src/rc_client_external_versions.h
|
||||
rcheevos/src/rc_client_internal.h
|
||||
rcheevos/src/rc_client_raintegration.c
|
||||
rcheevos/src/rc_client_raintegration_internal.h
|
||||
rcheevos/src/rc_compat.c
|
||||
rcheevos/src/rc_compat.h
|
||||
rcheevos/src/rc_util.c
|
||||
rcheevos/src/rc_version.c
|
||||
rcheevos/src/rc_version.h
|
||||
)
|
||||
dolphin_disable_warnings(rcheevos)
|
||||
|
||||
target_include_directories(rcheevos PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/rcheevos/include")
|
||||
target_include_directories(rcheevos INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_DISABLE_LUA=1" "RCHEEVOS_URL_SSL")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_CLIENT_SUPPORTS_HASH")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_CLIENT_SUPPORTS_EXTERNAL")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_HASH_NO_ENCRYPTED")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_HASH_NO_ROM")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_HASH_NO_ZIP")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
target_compile_definitions(rcheevos PRIVATE "RC_CLIENT_SUPPORTS_RAINTEGRATION")
|
||||
target_compile_definitions(rcheevos PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
set(SRCS
|
||||
SPIRV-Cross/GLSL.std.450.h
|
||||
SPIRV-Cross/spirv.h
|
||||
SPIRV-Cross/spirv.hpp
|
||||
SPIRV-Cross/spirv_cfg.cpp
|
||||
SPIRV-Cross/spirv_cfg.hpp
|
||||
SPIRV-Cross/spirv_common.hpp
|
||||
SPIRV-Cross/spirv_cpp.cpp
|
||||
SPIRV-Cross/spirv_cpp.hpp
|
||||
SPIRV-Cross/spirv_cross.cpp
|
||||
SPIRV-Cross/spirv_cross.hpp
|
||||
SPIRV-Cross/spirv_cross_c.cpp
|
||||
SPIRV-Cross/spirv_cross_c.h
|
||||
SPIRV-Cross/spirv_cross_containers.hpp
|
||||
SPIRV-Cross/spirv_cross_error_handling.hpp
|
||||
SPIRV-Cross/spirv_cross_parsed_ir.cpp
|
||||
SPIRV-Cross/spirv_cross_parsed_ir.hpp
|
||||
SPIRV-Cross/spirv_cross_util.cpp
|
||||
SPIRV-Cross/spirv_cross_util.hpp
|
||||
SPIRV-Cross/spirv_glsl.cpp
|
||||
SPIRV-Cross/spirv_glsl.hpp
|
||||
SPIRV-Cross/spirv_hlsl.cpp
|
||||
SPIRV-Cross/spirv_hlsl.hpp
|
||||
SPIRV-Cross/spirv_msl.cpp
|
||||
SPIRV-Cross/spirv_msl.hpp
|
||||
SPIRV-Cross/spirv_parser.cpp
|
||||
SPIRV-Cross/spirv_parser.hpp
|
||||
SPIRV-Cross/spirv_reflect.cpp
|
||||
SPIRV-Cross/spirv_reflect.hpp
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
# spirv_cross requires C++11 at a minimum to compile.
|
||||
add_compile_options(-std=c++11)
|
||||
|
||||
# Silence some warnings that occur frequently to reduce noise in build logs.
|
||||
add_compile_options(-Wno-shadow)
|
||||
add_compile_options(-Wno-reorder)
|
||||
add_compile_options(-Wno-sign-compare)
|
||||
add_compile_options(-Wno-parentheses)
|
||||
add_compile_options(-Wno-unused-variable)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
add_compile_options(-Wno-unused-but-set-variable)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
add_compile_options(-Wno-missing-variable-declarations)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(spirv_cross STATIC ${SRCS})
|
||||
dolphin_disable_warnings(spirv_cross)
|
||||
|
||||
target_compile_definitions(spirv_cross PUBLIC SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
|
||||
target_include_directories(spirv_cross PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Cross/include ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Cross)
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
add_library(tinygltf STATIC)
|
||||
target_compile_definitions(tinygltf PUBLIC TINYGLTF_NOEXCEPTION)
|
||||
target_compile_definitions(tinygltf PUBLIC TINYGLTF_NO_EXTERNAL_IMAGE)
|
||||
target_compile_definitions(tinygltf PUBLIC TINYGLTF_USE_CPP14)
|
||||
if (NOT MSVC)
|
||||
target_compile_features(tinygltf PRIVATE cxx_std_20)
|
||||
endif()
|
||||
target_sources(tinygltf PRIVATE
|
||||
tinygltf/tiny_gltf.cc)
|
||||
target_include_directories(tinygltf INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
dolphin_disable_warnings(tinygltf)
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
add_library(watcher INTERFACE IMPORTED GLOBAL)
|
||||
set_target_properties(watcher PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/watcher/include
|
||||
)
|
||||
|
||||
if (MINGW)
|
||||
target_compile_options(watcher INTERFACE -fexceptions)
|
||||
endif()
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
project(xxhash C)
|
||||
|
||||
add_library(xxhash STATIC xxHash/xxhash.c)
|
||||
dolphin_disable_warnings(xxhash)
|
||||
target_include_directories(xxhash
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/xxHash
|
||||
)
|
||||
add_library(xxhash::xxhash ALIAS xxhash)
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
set(ZLIB_ENABLE_TESTS OFF)
|
||||
set(ZLIB_COMPAT ON)
|
||||
set(SKIP_INSTALL_ALL ON)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared library" OFF)
|
||||
|
||||
add_subdirectory(zlib-ng)
|
||||
|
||||
# Set ZLIB variables for find_package used by other projects
|
||||
set(ZLIB_INCLUDE_DIR ${CMAKE_BINARY_DIR}/zlib-ng CACHE STRING "Path to zlib include directory")
|
||||
set(ZLIB_LIBRARY ZLIB::ZLIB CACHE STRING "Path to zlib library")
|
||||
|
||||
# Setup zlib alias project so FindZLIB doesn't recreate it
|
||||
add_library(ZLIB::ZLIB ALIAS zlib)
|
||||
dolphin_disable_warnings(zlib)
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13...4.2.0)
|
||||
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||
set(ZSTD_BUILD_PROGRAMS OFF)
|
||||
set(ZSTD_BUILD_SHARED OFF)
|
||||
|
||||
add_subdirectory(zstd EXCLUDE_FROM_ALL)
|
||||
|
||||
dolphin_disable_warnings(libzstd_static)
|
||||
add_library(zstd::zstd ALIAS libzstd_static)
|
||||
@@ -38,7 +38,7 @@ ifneq (,$(filter win win64,$(platform)))
|
||||
endif
|
||||
|
||||
# webOS SDK toolchains are plain Linux cross compilers; their name is what
|
||||
# tells them apart, as in the CMake build.
|
||||
# tells them apart.
|
||||
ifneq (,$(findstring webos,$(CC)))
|
||||
ifneq (,$(findstring unix,$(platform)))
|
||||
override platform := webos
|
||||
|
||||
+5
-8
@@ -9,7 +9,6 @@
|
||||
# HAVE_VULKAN HAVE_D3D HAVE_SPIRV_CROSS
|
||||
# HAVE_BUNDLED_ICONV Externals/libiconv instead of libc
|
||||
#
|
||||
# The lists mirror what the CMake -DLIBRETRO=ON build links into the core.
|
||||
# Units only the standalone frontends use are left out.
|
||||
|
||||
EXT_DIR := $(CORE_DIR)/Externals
|
||||
@@ -18,7 +17,7 @@ SRC_DIR := $(CORE_DIR)/Source/Core
|
||||
# ----------------------------------------------------------------------------
|
||||
# Generated files
|
||||
# ----------------------------------------------------------------------------
|
||||
# Plain substitutions of the templates the CMake build configures. The
|
||||
# Plain substitutions of the upstream templates. The
|
||||
# per-platform configure results (curl_config.h, the libusb, libiconv and
|
||||
# libcharset config.h, mGBA's flags.h) are checked in under
|
||||
# Externals/<library>/makefile instead.
|
||||
@@ -1962,7 +1961,7 @@ endif
|
||||
# ----------------------------------------------------------------------------
|
||||
# <LIB>_FLAGS applies to every object of that library, <LIB>_CFLAGS and
|
||||
# <LIB>_CXXFLAGS to its C and C++ objects only. Third-party code builds
|
||||
# with warnings off, as in the CMake build.
|
||||
# with warnings off.
|
||||
|
||||
BDISASM_FLAGS := -w -I$(EXT_DIR)/Bochs_disasm
|
||||
|
||||
@@ -2151,9 +2150,7 @@ SPIRV_CROSS_CXXFLAGS := -std=c++11
|
||||
ADRENOTOOLS_FLAGS := -w -I$(EXT_DIR)/libadrenotools/include -I$(EXT_DIR)/libadrenotools \
|
||||
-I$(EXT_DIR)/libadrenotools/lib/linkernsbypass
|
||||
|
||||
# Dolphin itself: every Source/ unit shares one set, the union of what the
|
||||
# CMake targets core, common, videocommon, the video backends, inputcommon,
|
||||
# audiocommon, discio, uicommon and dolphin_libretro see.
|
||||
# Dolphin itself: every Source/ unit shares one set.
|
||||
DOLPHIN_FLAGS := \
|
||||
-DENABLE_DIRECTORIES -DENABLE_VFS -DHAS_LIBMGBA -DHAVE_CRC32 \
|
||||
-DLZMA_API_STATIC -DPUGIXML_NO_EXCEPTIONS -DSFML_STATIC -DSPNG_STATIC \
|
||||
@@ -2206,9 +2203,9 @@ ifeq ($(OS_ANDROID),1)
|
||||
-I$(EXT_DIR)/libadrenotools/include -I$(EXT_DIR)/libadrenotools/lib/linkernsbypass
|
||||
endif
|
||||
|
||||
# Per-file additions, as the CMake build sets them.
|
||||
# Per-file additions.
|
||||
ifeq ($(OS_WIN),1)
|
||||
# watcher's Windows backend throws; CMake gives its users -fexceptions on MinGW.
|
||||
# watcher's Windows backend throws.
|
||||
FILE_FLAGS_$(abspath $(SRC_DIR)/Common/FilesystemWatcher.cpp) := -fexceptions
|
||||
endif
|
||||
ifeq ($(ARCH_X86_64),1)
|
||||
|
||||
@@ -38,30 +38,27 @@ Dolphin can only be installed on devices that satisfy the above requirements. At
|
||||
|
||||
## Building
|
||||
|
||||
You may find building instructions on the appropriate wiki page for your operating system:
|
||||
|
||||
* [Windows](https://github.com/dolphin-emu/dolphin/wiki/Building-for-Windows)
|
||||
* [Linux](https://github.com/dolphin-emu/dolphin/wiki/Building-for-Linux)
|
||||
* [macOS](https://github.com/dolphin-emu/dolphin/wiki/Building-for-macOS)
|
||||
* [Android](#android-specific-instructions) <!-- TODO: Create a "Building for Android" wiki page and link it here -->
|
||||
* [OpenBSD](https://github.com/dolphin-emu/dolphin/wiki/Building-for-OpenBSD) (unsupported)
|
||||
|
||||
Before building, make sure to pull all submodules:
|
||||
This tree builds the parallel_gamecubewii libretro core with the static Makefile.
|
||||
Pull all submodules first:
|
||||
|
||||
```sh
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
### Android-specific instructions
|
||||
Then run `make` from the top of the tree. Linux, macOS and Windows (MSYS2, any
|
||||
environment) are detected; other targets take `platform=`:
|
||||
|
||||
These instructions assume familiarity with Android development. If you do not have an
|
||||
Android dev environment set up, see [AndroidSetup.md](AndroidSetup.md).
|
||||
| Target | Command | Output |
|
||||
|---|---|---|
|
||||
| Linux, webOS | `make` | `parallel_gamecubewii_libretro.so` |
|
||||
| Windows (MinGW-w64) | `make` | `parallel_gamecubewii_libretro.dll` |
|
||||
| macOS | `make` | `parallel_gamecubewii_libretro.dylib` |
|
||||
| iOS | `make platform=ios-arm64` | `parallel_gamecubewii_libretro_ios.dylib` |
|
||||
| tvOS | `make platform=tvos-arm64` | `parallel_gamecubewii_libretro_tvos.dylib` |
|
||||
| Android | `make platform=android-arm64` (or `android-x86_64`), NDK from `ANDROID_NDK_ROOT` | `parallel_gamecubewii_libretro_android.so` |
|
||||
|
||||
If using Android Studio, import the Gradle project located in `./Source/Android`.
|
||||
|
||||
Android apps are compiled using a build system called Gradle. Dolphin's native component,
|
||||
however, is compiled using CMake. The Gradle script will attempt to run a CMake build
|
||||
automatically while building the Java code.
|
||||
Cross builds pass the compilers, e.g. `make CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++`.
|
||||
`DEBUG=1`, `LTO=-flto` and `SANITIZER=address,undefined` are available everywhere.
|
||||
|
||||
## Uninstalling
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
add_library(androidcommon STATIC
|
||||
AndroidCommon.cpp
|
||||
AndroidCommon.h
|
||||
IDCache.cpp
|
||||
IDCache.h
|
||||
)
|
||||
|
||||
target_link_libraries(androidcommon
|
||||
PRIVATE
|
||||
android
|
||||
common
|
||||
log
|
||||
"-Wl,--no-warn-mismatch"
|
||||
"-Wl,--whole-archive"
|
||||
"-Wl,--no-whole-archive"
|
||||
)
|
||||
@@ -1,79 +0,0 @@
|
||||
add_library(main SHARED
|
||||
AchievementAdapter.cpp
|
||||
ActivityTracker.cpp
|
||||
Cheats/ARCheat.cpp
|
||||
Cheats/Cheats.h
|
||||
Cheats/GeckoCheat.cpp
|
||||
Cheats/GraphicsMod.cpp
|
||||
Cheats/GraphicsModGroup.cpp
|
||||
Cheats/PatchCheat.cpp
|
||||
Config/ConfigChangedCallback.cpp
|
||||
Config/NativeConfig.cpp
|
||||
Config/PostProcessing.cpp
|
||||
GameList/GameFile.cpp
|
||||
GameList/GameFile.h
|
||||
GameList/GameFileCache.cpp
|
||||
GpuDriver.cpp
|
||||
InfinityConfig.cpp
|
||||
Input/Control.cpp
|
||||
Input/Control.h
|
||||
Input/ControlGroup.cpp
|
||||
Input/ControlGroup.h
|
||||
Input/ControlReference.cpp
|
||||
Input/ControlReference.h
|
||||
Input/CoreDevice.cpp
|
||||
Input/CoreDevice.h
|
||||
Input/EmulatedController.cpp
|
||||
Input/EmulatedController.h
|
||||
Input/InputDetector.cpp
|
||||
Input/InputOverrider.cpp
|
||||
Input/MappingCommon.cpp
|
||||
Input/NumericSetting.cpp
|
||||
Input/NumericSetting.h
|
||||
NetPlay/Netplay.cpp
|
||||
NetPlay/NetPlayUICallbacks.cpp
|
||||
NetPlay/NetPlayUICallbacks.h
|
||||
MainAndroid.cpp
|
||||
RiivolutionPatches.cpp
|
||||
SkylanderConfig.cpp
|
||||
WiiUtils.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(main
|
||||
PRIVATE
|
||||
androidcommon
|
||||
common
|
||||
core
|
||||
inputcommon
|
||||
uicommon
|
||||
)
|
||||
|
||||
target_link_libraries(main
|
||||
PRIVATE
|
||||
android
|
||||
log
|
||||
"-Wl,--no-warn-mismatch"
|
||||
"-Wl,--whole-archive"
|
||||
"-Wl,--no-whole-archive"
|
||||
)
|
||||
|
||||
target_include_directories(main
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/Externals/libadrenotools/include
|
||||
${CMAKE_SOURCE_DIR}/Externals/VulkanMemoryAllocator/include
|
||||
)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/)
|
||||
file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/Sys/)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/Data/Sys DESTINATION ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/)
|
||||
|
||||
# Delete folders that aren't used by the Android version of Dolphin
|
||||
file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/Sys/Themes/)
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} main)
|
||||
|
||||
add_subdirectory(AndroidCommon)
|
||||
|
||||
if(LIBRETRO)
|
||||
set_target_properties(main PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD TRUE)
|
||||
endif()
|
||||
@@ -1,100 +0,0 @@
|
||||
option(DOLPHIN_CXX_FLAGS "Flags used to compile Dolphin-only sources" "")
|
||||
if(DOLPHIN_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DOLPHIN_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR MINGW)
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_definitions(-DUNICODE)
|
||||
add_definitions(-D_UNICODE)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (MSVC)
|
||||
# Compile PCH
|
||||
add_subdirectory(PCH)
|
||||
else()
|
||||
check_and_add_flag(HAVE_WALL -Wall)
|
||||
# TODO: would like these but they produce overwhelming amounts of warnings
|
||||
#check_and_add_flag(EXTRA -Wextra)
|
||||
#check_and_add_flag(MISSING_FIELD_INITIALIZERS -Wmissing-field-initializers)
|
||||
#check_and_add_flag(SWITCH_DEFAULT -Wswitch-default)
|
||||
#check_and_add_flag(FLOAT_EQUAL -Wfloat-equal)
|
||||
#check_and_add_flag(CONVERSION -Wconversion)
|
||||
#check_and_add_flag(ZERO_AS_NULL_POINTER_CONSTANT -Wzero-as-null-pointer-constant)
|
||||
check_and_add_flag(TYPE_LIMITS -Wtype-limits)
|
||||
check_and_add_flag(SIGN_COMPARE -Wsign-compare)
|
||||
check_and_add_flag(IGNORED_QUALIFIERS -Wignored-qualifiers)
|
||||
check_and_add_flag(UNINITIALIZED -Wuninitialized)
|
||||
check_and_add_flag(LOGICAL_OP -Wlogical-op)
|
||||
check_and_add_flag(SHADOW -Wshadow)
|
||||
check_and_add_flag(SHADOW_FIELD_IN_CONSTRUCTOR -Wshadow-field-in-constructor)
|
||||
check_and_add_flag(INIT_SELF -Winit-self)
|
||||
check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations)
|
||||
check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations)
|
||||
check_and_add_flag(IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough)
|
||||
|
||||
# Disable -Wstringop-truncation warnings as they result in many false positives.
|
||||
# In most (all?) cases where std::strncpy is used, we want to fill the entire buffer
|
||||
# or match emulated code that also ignores the null terminator, so the warnings are not useful.
|
||||
# Given that Dolphin itself mostly uses std::string, they do not really help catch any bugs.
|
||||
check_cxx_compiler_flag(-Wstringop-truncation HAS_STRINGOP_TRUNCATION_WARNING)
|
||||
if (HAS_STRINGOP_TRUNCATION_WARNING)
|
||||
check_and_add_flag(NO_STRINGOP_TRUNCATION -Wno-stringop-truncation)
|
||||
endif()
|
||||
|
||||
# Format string issues that the compiler can detect should be compile time errors.
|
||||
check_cxx_compiler_flag(-Wformat HAS_FORMAT_WARNING)
|
||||
if (HAS_FORMAT_WARNING)
|
||||
check_and_add_flag(FORMAT_WARNING_TO_ERROR -Werror=format)
|
||||
endif()
|
||||
|
||||
# Trigraphs support is generally disabled by default, but some compilers (GCC) may still warn when
|
||||
# one hypothetical trigraph is encountered. The warning is generally not interesting.
|
||||
check_cxx_compiler_flag(-Wtrigraphs HAS_TRIGRAPHS_WARNING)
|
||||
if (HAS_TRIGRAPHS_WARNING)
|
||||
check_and_add_flag(NO_TRIGRAPHS_WARNING -Wno-trigraphs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# These aren't actually needed for C11/C++11
|
||||
# but some dependencies require them (LLVM, libav).
|
||||
add_definitions(-D__STDC_LIMIT_MACROS)
|
||||
add_definitions(-D__STDC_CONSTANT_MACROS)
|
||||
|
||||
check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
|
||||
if(HAVE_ELF_AUX_INFO)
|
||||
add_definitions(-DHAVE_ELF_AUX_INFO)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Core)
|
||||
if (ANDROID)
|
||||
add_subdirectory(Android/jni)
|
||||
endif()
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(UnitTests)
|
||||
endif()
|
||||
|
||||
if (DSPTOOL)
|
||||
add_subdirectory(DSPTool)
|
||||
endif()
|
||||
|
||||
# TODO: Add DSPSpy. Preferably make it option() and cpack component
|
||||
@@ -1,108 +0,0 @@
|
||||
add_library(audiocommon
|
||||
AudioCommon.cpp
|
||||
AudioCommon.h
|
||||
CubebStream.h
|
||||
Enums.h
|
||||
Mixer.cpp
|
||||
Mixer.h
|
||||
SurroundDecoder.cpp
|
||||
SurroundDecoder.h
|
||||
NullSoundStream.cpp
|
||||
NullSoundStream.h
|
||||
WaveFile.cpp
|
||||
WaveFile.h
|
||||
)
|
||||
|
||||
if(ENABLE_CUBEB)
|
||||
message(STATUS "Cubeb found, enabling Cubeb sound backend")
|
||||
target_sources(audiocommon PRIVATE
|
||||
CubebStream.cpp
|
||||
CubebUtils.cpp
|
||||
CubebUtils.h
|
||||
)
|
||||
target_link_libraries(audiocommon PRIVATE cubeb)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
find_package(OpenSLES)
|
||||
if(OPENSLES_FOUND)
|
||||
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
|
||||
target_sources(audiocommon PRIVATE
|
||||
OpenSLESStream.cpp
|
||||
OpenSLESStream.h
|
||||
)
|
||||
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
||||
target_compile_definitions(audiocommon PRIVATE HAVE_OPENSL_ES=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_ALSA)
|
||||
find_package(ALSA)
|
||||
if(ALSA_FOUND)
|
||||
message(STATUS "ALSA found, enabling ALSA sound backend")
|
||||
target_sources(audiocommon PRIVATE
|
||||
AlsaSoundStream.cpp
|
||||
AlsaSoundStream.h
|
||||
)
|
||||
target_link_libraries(audiocommon PRIVATE ALSA::ALSA)
|
||||
target_compile_definitions(audiocommon PRIVATE HAVE_ALSA=1)
|
||||
else()
|
||||
message(STATUS "ALSA NOT found, disabling ALSA sound backend")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "ALSA explicitly disabled, disabling ALSA sound backend")
|
||||
endif()
|
||||
|
||||
if(ENABLE_PULSEAUDIO)
|
||||
# PulseAudio ships with a PulseAudioConfig.cmake with no imported target
|
||||
# So we use our own FindPulseAudio instead with "MODULE"
|
||||
find_package(PulseAudio MODULE QUIET)
|
||||
if(PulseAudio_FOUND)
|
||||
message(STATUS "PulseAudio found, enabling PulseAudio sound backend")
|
||||
target_sources(audiocommon PRIVATE
|
||||
PulseAudioStream.cpp
|
||||
PulseAudioStream.h
|
||||
)
|
||||
target_link_libraries(audiocommon PRIVATE PulseAudio::PulseAudio)
|
||||
target_compile_definitions(audiocommon PRIVATE HAVE_PULSEAUDIO=1)
|
||||
else()
|
||||
message(STATUS "PulseAudio NOT found, disabling PulseAudio sound backend")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_sources(audiocommon PRIVATE
|
||||
# Dolphin loads openal32.dll at runtime
|
||||
OpenALStream.cpp
|
||||
OpenALStream.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_sources(audiocommon PRIVATE
|
||||
WASAPIStream.cpp
|
||||
WASAPIStream.h
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(audiocommon
|
||||
PUBLIC
|
||||
common
|
||||
|
||||
PRIVATE
|
||||
FreeSurround)
|
||||
|
||||
if(ENABLE_CUBEB)
|
||||
target_link_libraries(audiocommon PRIVATE cubeb::cubeb)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# Add precompiled header
|
||||
target_link_libraries(audiocommon PRIVATE use_pch)
|
||||
endif()
|
||||
|
||||
if(LIBRETRO)
|
||||
target_include_directories(audiocommon PRIVATE ${CMAKE_SOURCE_DIR}/Externals/libretro-common/include)
|
||||
endif()
|
||||
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user