summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar liamwhite2023-05-28 13:17:50 -0400
committerGravatar GitHub2023-05-28 13:17:50 -0400
commit09743fa6814746a24bec0c438ed2ed0c0a6dd2d1 (patch)
tree517134ef01ee11f9e42a1cbdd277a3ee201bdba2
parentMerge pull request #10463 from liamwhite/this-is-why-we-need-g (diff)
parentcmake: apply defaults to all externals (diff)
downloadyuzu-09743fa6814746a24bec0c438ed2ed0c0a6dd2d1.tar.gz
yuzu-09743fa6814746a24bec0c438ed2ed0c0a6dd2d1.tar.xz
yuzu-09743fa6814746a24bec0c438ed2ed0c0a6dd2d1.zip
Merge pull request #10376 from abouvier/cmake-default
cmake: apply defaults to all externals
-rw-r--r--externals/CMakeLists.txt42
-rw-r--r--externals/glad/CMakeLists.txt2
-rw-r--r--externals/libusb/CMakeLists.txt2
-rw-r--r--externals/opus/CMakeLists.txt2
4 files changed, 26 insertions, 22 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index e59eeb489..d78d10147 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -8,15 +8,21 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
8# Disable tests in all externals supporting the standard option name 8# Disable tests in all externals supporting the standard option name
9set(BUILD_TESTING OFF) 9set(BUILD_TESTING OFF)
10 10
11# Build only static externals
12set(BUILD_SHARED_LIBS OFF)
13
14# Skip install rules for all externals
15set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON)
16
11# xbyak 17# xbyak
12if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) 18if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak)
13 add_subdirectory(xbyak EXCLUDE_FROM_ALL) 19 add_subdirectory(xbyak)
14endif() 20endif()
15 21
16# Dynarmic 22# Dynarmic
17if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic) 23if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic)
18 set(DYNARMIC_IGNORE_ASSERTS ON) 24 set(DYNARMIC_IGNORE_ASSERTS ON)
19 add_subdirectory(dynarmic EXCLUDE_FROM_ALL) 25 add_subdirectory(dynarmic)
20 add_library(dynarmic::dynarmic ALIAS dynarmic) 26 add_library(dynarmic::dynarmic ALIAS dynarmic)
21endif() 27endif()
22 28
@@ -34,7 +40,7 @@ if (NOT TARGET inih::INIReader)
34endif() 40endif()
35 41
36# mbedtls 42# mbedtls
37add_subdirectory(mbedtls EXCLUDE_FROM_ALL) 43add_subdirectory(mbedtls)
38target_include_directories(mbedtls PUBLIC ./mbedtls/include) 44target_include_directories(mbedtls PUBLIC ./mbedtls/include)
39 45
40# MicroProfile 46# MicroProfile
@@ -48,7 +54,7 @@ endif()
48 54
49# libusb 55# libusb
50if (ENABLE_LIBUSB AND NOT TARGET libusb::usb) 56if (ENABLE_LIBUSB AND NOT TARGET libusb::usb)
51 add_subdirectory(libusb EXCLUDE_FROM_ALL) 57 add_subdirectory(libusb)
52endif() 58endif()
53 59
54# SDL2 60# SDL2
@@ -67,18 +73,16 @@ if (YUZU_USE_EXTERNAL_SDL2)
67 73
68 set(HIDAPI ON) 74 set(HIDAPI ON)
69 endif() 75 endif()
70 set(SDL_STATIC ON)
71 set(SDL_SHARED OFF)
72 if (APPLE) 76 if (APPLE)
73 set(SDL_FILE ON) 77 set(SDL_FILE ON)
74 endif() 78 endif()
75 79
76 add_subdirectory(SDL EXCLUDE_FROM_ALL) 80 add_subdirectory(SDL)
77endif() 81endif()
78 82
79# ENet 83# ENet
80if (NOT TARGET enet::enet) 84if (NOT TARGET enet::enet)
81 add_subdirectory(enet EXCLUDE_FROM_ALL) 85 add_subdirectory(enet)
82 target_include_directories(enet INTERFACE ./enet/include) 86 target_include_directories(enet INTERFACE ./enet/include)
83 add_library(enet::enet ALIAS enet) 87 add_library(enet::enet ALIAS enet)
84endif() 88endif()
@@ -86,24 +90,26 @@ endif()
86# Cubeb 90# Cubeb
87if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb) 91if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb)
88 set(BUILD_TESTS OFF) 92 set(BUILD_TESTS OFF)
89 add_subdirectory(cubeb EXCLUDE_FROM_ALL) 93 set(BUILD_TOOLS OFF)
94 add_subdirectory(cubeb)
90 add_library(cubeb::cubeb ALIAS cubeb) 95 add_library(cubeb::cubeb ALIAS cubeb)
91endif() 96endif()
92 97
93# DiscordRPC 98# DiscordRPC
94if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc) 99if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc)
95 add_subdirectory(discord-rpc EXCLUDE_FROM_ALL) 100 set(BUILD_EXAMPLES OFF)
101 add_subdirectory(discord-rpc)
96 target_include_directories(discord-rpc INTERFACE ./discord-rpc/include) 102 target_include_directories(discord-rpc INTERFACE ./discord-rpc/include)
97 add_library(DiscordRPC::discord-rpc ALIAS discord-rpc) 103 add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
98endif() 104endif()
99 105
100# Sirit 106# Sirit
101add_subdirectory(sirit EXCLUDE_FROM_ALL) 107add_subdirectory(sirit)
102 108
103# httplib 109# httplib
104if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) 110if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
105 set(HTTPLIB_REQUIRE_OPENSSL ON) 111 set(HTTPLIB_REQUIRE_OPENSSL ON)
106 add_subdirectory(cpp-httplib EXCLUDE_FROM_ALL) 112 add_subdirectory(cpp-httplib)
107endif() 113endif()
108 114
109# cpp-jwt 115# cpp-jwt
@@ -111,12 +117,12 @@ if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
111 set(CPP_JWT_BUILD_EXAMPLES OFF) 117 set(CPP_JWT_BUILD_EXAMPLES OFF)
112 set(CPP_JWT_BUILD_TESTS OFF) 118 set(CPP_JWT_BUILD_TESTS OFF)
113 set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF) 119 set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF)
114 add_subdirectory(cpp-jwt EXCLUDE_FROM_ALL) 120 add_subdirectory(cpp-jwt)
115endif() 121endif()
116 122
117# Opus 123# Opus
118if (NOT TARGET Opus::opus) 124if (NOT TARGET Opus::opus)
119 add_subdirectory(opus EXCLUDE_FROM_ALL) 125 add_subdirectory(opus)
120endif() 126endif()
121 127
122# FFMpeg 128# FFMpeg
@@ -130,16 +136,14 @@ endif()
130 136
131# Vulkan-Headers 137# Vulkan-Headers
132if (YUZU_USE_EXTERNAL_VULKAN_HEADERS) 138if (YUZU_USE_EXTERNAL_VULKAN_HEADERS)
133 add_subdirectory(Vulkan-Headers EXCLUDE_FROM_ALL) 139 add_subdirectory(Vulkan-Headers)
134endif() 140endif()
135 141
136if (NOT TARGET LLVM::Demangle) 142if (NOT TARGET LLVM::Demangle)
137 add_library(demangle STATIC) 143 add_library(demangle demangle/ItaniumDemangle.cpp)
138 target_include_directories(demangle PUBLIC ./demangle) 144 target_include_directories(demangle PUBLIC ./demangle)
139 target_sources(demangle PRIVATE demangle/ItaniumDemangle.cpp)
140 add_library(LLVM::Demangle ALIAS demangle) 145 add_library(LLVM::Demangle ALIAS demangle)
141endif() 146endif()
142 147
143add_library(stb STATIC) 148add_library(stb stb/stb_dxt.cpp)
144target_include_directories(stb PUBLIC ./stb) 149target_include_directories(stb PUBLIC ./stb)
145target_sources(stb PRIVATE stb/stb_dxt.cpp)
diff --git a/externals/glad/CMakeLists.txt b/externals/glad/CMakeLists.txt
index 3dfcac2fd..0c8e285a4 100644
--- a/externals/glad/CMakeLists.txt
+++ b/externals/glad/CMakeLists.txt
@@ -1,7 +1,7 @@
1# SPDX-FileCopyrightText: 2015 Yuri Kunde Schlesner <yuriks@yuriks.net> 1# SPDX-FileCopyrightText: 2015 Yuri Kunde Schlesner <yuriks@yuriks.net>
2# SPDX-License-Identifier: GPL-2.0-or-later 2# SPDX-License-Identifier: GPL-2.0-or-later
3 3
4add_library(glad STATIC 4add_library(glad
5 src/glad.c 5 src/glad.c
6 include/KHR/khrplatform.h 6 include/KHR/khrplatform.h
7 include/glad/glad.h 7 include/glad/glad.h
diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt
index 6317ea807..6757b59da 100644
--- a/externals/libusb/CMakeLists.txt
+++ b/externals/libusb/CMakeLists.txt
@@ -122,7 +122,7 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
122 add_compile_options(/utf-8) 122 add_compile_options(/utf-8)
123 endif() 123 endif()
124 124
125 add_library(usb STATIC EXCLUDE_FROM_ALL 125 add_library(usb
126 libusb/libusb/core.c 126 libusb/libusb/core.c
127 libusb/libusb/core.c 127 libusb/libusb/core.c
128 libusb/libusb/descriptor.c 128 libusb/libusb/descriptor.c
diff --git a/externals/opus/CMakeLists.txt b/externals/opus/CMakeLists.txt
index 410ff7c08..d9a03423d 100644
--- a/externals/opus/CMakeLists.txt
+++ b/externals/opus/CMakeLists.txt
@@ -23,7 +23,7 @@ else()
23 endif() 23 endif()
24endif() 24endif()
25 25
26add_library(opus STATIC 26add_library(opus
27 # CELT sources 27 # CELT sources
28 opus/celt/bands.c 28 opus/celt/bands.c
29 opus/celt/celt.c 29 opus/celt/celt.c