summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-05-27 23:33:14 -0700
committerGravatar Yuri Kunde Schlesner2017-05-27 23:33:14 -0700
commitc21136873402ab83689aec26e61dc0e163d1002f (patch)
tree312d75f6bc1809484f869d68f1474ec580e157d7
parentCMake: Create an INTERFACE target for Catch (diff)
downloadyuzu-c21136873402ab83689aec26e61dc0e163d1002f.tar.gz
yuzu-c21136873402ab83689aec26e61dc0e163d1002f.tar.xz
yuzu-c21136873402ab83689aec26e61dc0e163d1002f.zip
CMake: Move definitions of externals to the CMakeLists in that directory
-rw-r--r--CMakeLists.txt31
-rw-r--r--externals/CMakeLists.txt48
2 files changed, 47 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e586633c..79dd54d52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,10 @@
2cmake_minimum_required(VERSION 3.6) 2cmake_minimum_required(VERSION 3.6)
3list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules") 3list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules")
4 4
5# This function downloads a binary library package from our external repo.
6# Params:
7# remote_path: path to the file to download, relative to the remote repository root
8# prefix_var: name of a variable which will be set with the path to the extracted contents
5function(download_bundled_external remote_path lib_name prefix_var) 9function(download_bundled_external remote_path lib_name prefix_var)
6 set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") 10 set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
7 if (NOT EXISTS "${prefix}") 11 if (NOT EXISTS "${prefix}")
@@ -254,34 +258,9 @@ get_git_head_revision(GIT_REF_SPEC GIT_REV)
254git_describe(GIT_DESC --always --long --dirty) 258git_describe(GIT_DESC --always --long --dirty)
255git_branch_name(GIT_BRANCH) 259git_branch_name(GIT_BRANCH)
256 260
257add_subdirectory(externals/inih)
258
259add_subdirectory(externals) 261add_subdirectory(externals)
260
261option(DYNARMIC_TESTS OFF)
262set(DYNARMIC_NO_BUNDLED_FMT ON)
263add_subdirectory(externals/dynarmic)
264
265add_subdirectory(externals/glad)
266
267add_library(microprofile INTERFACE)
268target_include_directories(microprofile INTERFACE externals/microprofile)
269
270add_library(nihstro-headers INTERFACE)
271target_include_directories(nihstro-headers INTERFACE externals/nihstro/include)
272
273if (MSVC)
274 add_subdirectory(externals/getopt)
275endif()
276
277# process subdirectories
278add_subdirectory(externals/soundtouch)
279# The SoundTouch target doesn't export the necessary include paths as properties by default
280target_include_directories(SoundTouch INTERFACE "externals/soundtouch/include")
281
282enable_testing()
283
284add_subdirectory(src) 262add_subdirectory(src)
263enable_testing()
285 264
286# Install freedesktop.org metadata files, following those specifications: 265# Install freedesktop.org metadata files, following those specifications:
287# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 266# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index db70eecd9..1e04931ee 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -1,16 +1,52 @@
1# Definitions for all external bundled libraries
2
1# Catch 3# Catch
2add_library(catch-single-include INTERFACE) 4add_library(catch-single-include INTERFACE)
3target_include_directories(catch-single-include INTERFACE catch/single_include) 5target_include_directories(catch-single-include INTERFACE catch/single_include)
4 6
7# Crypto++
8add_subdirectory(cryptopp)
9
10# Dynarmic
11# Dynarmic will skip defining xbyak if it's already defined, we then define it below
12add_library(xbyak INTERFACE)
13option(DYNARMIC_TESTS OFF)
14set(DYNARMIC_NO_BUNDLED_FMT ON)
15add_subdirectory(dynarmic)
16
17# libfmt
18add_subdirectory(fmt)
19
20# getopt
21if (MSVC)
22 add_subdirectory(getopt)
23endif()
24
25# Glad
26add_subdirectory(glad)
27
28# inih
29add_subdirectory(inih)
30
31# MicroProfile
32add_library(microprofile INTERFACE)
33target_include_directories(microprofile INTERFACE ./microprofile)
34
35# Nihstro
36add_library(nihstro-headers INTERFACE)
37target_include_directories(nihstro-headers INTERFACE ./nihstro/include)
38
39# SoundTouch
40add_subdirectory(soundtouch)
41# The SoundTouch target doesn't export the necessary include paths as properties by default
42target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
43
5# Xbyak 44# Xbyak
6if (ARCHITECTURE_x86_64) 45if (ARCHITECTURE_x86_64)
7 add_library(xbyak INTERFACE) 46 # Defined before "dynarmic" above
8 target_include_directories(xbyak INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak) 47 # add_library(xbyak INTERFACE)
48 target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
9 if (NOT MSVC) 49 if (NOT MSVC)
10 target_compile_options(xbyak INTERFACE -fno-operator-names) 50 target_compile_options(xbyak INTERFACE -fno-operator-names)
11 endif() 51 endif()
12endif() 52endif()
13
14add_subdirectory(cryptopp)
15
16add_subdirectory(fmt)