diff options
| author | 2017-05-27 23:33:14 -0700 | |
|---|---|---|
| committer | 2017-05-27 23:33:14 -0700 | |
| commit | c21136873402ab83689aec26e61dc0e163d1002f (patch) | |
| tree | 312d75f6bc1809484f869d68f1474ec580e157d7 | |
| parent | CMake: Create an INTERFACE target for Catch (diff) | |
| download | yuzu-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.txt | 31 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 48 |
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 @@ | |||
| 2 | cmake_minimum_required(VERSION 3.6) | 2 | cmake_minimum_required(VERSION 3.6) |
| 3 | list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules") | 3 | list(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 | ||
| 5 | function(download_bundled_external remote_path lib_name prefix_var) | 9 | function(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) | |||
| 254 | git_describe(GIT_DESC --always --long --dirty) | 258 | git_describe(GIT_DESC --always --long --dirty) |
| 255 | git_branch_name(GIT_BRANCH) | 259 | git_branch_name(GIT_BRANCH) |
| 256 | 260 | ||
| 257 | add_subdirectory(externals/inih) | ||
| 258 | |||
| 259 | add_subdirectory(externals) | 261 | add_subdirectory(externals) |
| 260 | |||
| 261 | option(DYNARMIC_TESTS OFF) | ||
| 262 | set(DYNARMIC_NO_BUNDLED_FMT ON) | ||
| 263 | add_subdirectory(externals/dynarmic) | ||
| 264 | |||
| 265 | add_subdirectory(externals/glad) | ||
| 266 | |||
| 267 | add_library(microprofile INTERFACE) | ||
| 268 | target_include_directories(microprofile INTERFACE externals/microprofile) | ||
| 269 | |||
| 270 | add_library(nihstro-headers INTERFACE) | ||
| 271 | target_include_directories(nihstro-headers INTERFACE externals/nihstro/include) | ||
| 272 | |||
| 273 | if (MSVC) | ||
| 274 | add_subdirectory(externals/getopt) | ||
| 275 | endif() | ||
| 276 | |||
| 277 | # process subdirectories | ||
| 278 | add_subdirectory(externals/soundtouch) | ||
| 279 | # The SoundTouch target doesn't export the necessary include paths as properties by default | ||
| 280 | target_include_directories(SoundTouch INTERFACE "externals/soundtouch/include") | ||
| 281 | |||
| 282 | enable_testing() | ||
| 283 | |||
| 284 | add_subdirectory(src) | 262 | add_subdirectory(src) |
| 263 | enable_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 |
| 2 | add_library(catch-single-include INTERFACE) | 4 | add_library(catch-single-include INTERFACE) |
| 3 | target_include_directories(catch-single-include INTERFACE catch/single_include) | 5 | target_include_directories(catch-single-include INTERFACE catch/single_include) |
| 4 | 6 | ||
| 7 | # Crypto++ | ||
| 8 | add_subdirectory(cryptopp) | ||
| 9 | |||
| 10 | # Dynarmic | ||
| 11 | # Dynarmic will skip defining xbyak if it's already defined, we then define it below | ||
| 12 | add_library(xbyak INTERFACE) | ||
| 13 | option(DYNARMIC_TESTS OFF) | ||
| 14 | set(DYNARMIC_NO_BUNDLED_FMT ON) | ||
| 15 | add_subdirectory(dynarmic) | ||
| 16 | |||
| 17 | # libfmt | ||
| 18 | add_subdirectory(fmt) | ||
| 19 | |||
| 20 | # getopt | ||
| 21 | if (MSVC) | ||
| 22 | add_subdirectory(getopt) | ||
| 23 | endif() | ||
| 24 | |||
| 25 | # Glad | ||
| 26 | add_subdirectory(glad) | ||
| 27 | |||
| 28 | # inih | ||
| 29 | add_subdirectory(inih) | ||
| 30 | |||
| 31 | # MicroProfile | ||
| 32 | add_library(microprofile INTERFACE) | ||
| 33 | target_include_directories(microprofile INTERFACE ./microprofile) | ||
| 34 | |||
| 35 | # Nihstro | ||
| 36 | add_library(nihstro-headers INTERFACE) | ||
| 37 | target_include_directories(nihstro-headers INTERFACE ./nihstro/include) | ||
| 38 | |||
| 39 | # SoundTouch | ||
| 40 | add_subdirectory(soundtouch) | ||
| 41 | # The SoundTouch target doesn't export the necessary include paths as properties by default | ||
| 42 | target_include_directories(SoundTouch INTERFACE ./soundtouch/include) | ||
| 43 | |||
| 5 | # Xbyak | 44 | # Xbyak |
| 6 | if (ARCHITECTURE_x86_64) | 45 | if (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() |
| 12 | endif() | 52 | endif() |
| 13 | |||
| 14 | add_subdirectory(cryptopp) | ||
| 15 | |||
| 16 | add_subdirectory(fmt) | ||