diff options
| author | 2017-05-29 15:12:21 -0700 | |
|---|---|---|
| committer | 2017-05-29 15:12:21 -0700 | |
| commit | a4f88c7d7c94107df6bfada31617ff553bb5e89e (patch) | |
| tree | cb0d3adbbe115604051300ae451a22a4de751b27 /externals | |
| parent | Merge pull request #2729 from yuriks/quaternion-fix (diff) | |
| parent | CMake: Re-organize root CMakeLists.txt file (diff) | |
| download | yuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.tar.gz yuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.tar.xz yuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.zip | |
Merge pull request #2734 from yuriks/cmake-imported-libs
CMake: Use CMake target properties for all libraries
Diffstat (limited to 'externals')
| -rw-r--r-- | externals/CMakeLists.txt | 52 | ||||
| -rw-r--r-- | externals/cryptopp/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | externals/glad/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | externals/inih/CMakeLists.txt | 1 |
4 files changed, 53 insertions, 9 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 57fc5d566..1e04931ee 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -1,12 +1,52 @@ | |||
| 1 | # Definitions for all external bundled libraries | ||
| 2 | |||
| 3 | # Catch | ||
| 4 | add_library(catch-single-include INTERFACE) | ||
| 5 | target_include_directories(catch-single-include INTERFACE catch/single_include) | ||
| 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 | |||
| 1 | # Xbyak | 44 | # Xbyak |
| 2 | if (ARCHITECTURE_x86_64) | 45 | if (ARCHITECTURE_x86_64) |
| 3 | add_library(xbyak INTERFACE) | 46 | # Defined before "dynarmic" above |
| 4 | target_include_directories(xbyak INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak) | 47 | # add_library(xbyak INTERFACE) |
| 48 | target_include_directories(xbyak INTERFACE ./xbyak/xbyak) | ||
| 5 | if (NOT MSVC) | 49 | if (NOT MSVC) |
| 6 | target_compile_options(xbyak INTERFACE -fno-operator-names) | 50 | target_compile_options(xbyak INTERFACE -fno-operator-names) |
| 7 | endif() | 51 | endif() |
| 8 | endif() | 52 | endif() |
| 9 | |||
| 10 | add_subdirectory(cryptopp) | ||
| 11 | |||
| 12 | add_subdirectory(fmt) | ||
diff --git a/externals/cryptopp/CMakeLists.txt b/externals/cryptopp/CMakeLists.txt index 653af1e4b..864de18bb 100644 --- a/externals/cryptopp/CMakeLists.txt +++ b/externals/cryptopp/CMakeLists.txt | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | # - disabled installation | 10 | # - disabled installation |
| 11 | # - disabled documentation | 11 | # - disabled documentation |
| 12 | # - configured to build a static library only | 12 | # - configured to build a static library only |
| 13 | # - adds include directories to the library target | ||
| 13 | 14 | ||
| 14 | include(TestBigEndian) | 15 | include(TestBigEndian) |
| 15 | include(CheckCXXCompilerFlag) | 16 | include(CheckCXXCompilerFlag) |
| @@ -148,14 +149,15 @@ endif() | |||
| 148 | # Compile targets | 149 | # Compile targets |
| 149 | #============================================================================ | 150 | #============================================================================ |
| 150 | add_library(cryptopp STATIC ${cryptopp_SOURCES}) | 151 | add_library(cryptopp STATIC ${cryptopp_SOURCES}) |
| 152 | target_include_directories(cryptopp INTERFACE .) | ||
| 151 | 153 | ||
| 152 | #============================================================================ | 154 | #============================================================================ |
| 153 | # Third-party libraries | 155 | # Third-party libraries |
| 154 | #============================================================================ | 156 | #============================================================================ |
| 155 | 157 | ||
| 156 | if(WIN32) | 158 | if(WIN32) |
| 157 | target_link_libraries(cryptopp ws2_32) | 159 | target_link_libraries(cryptopp PRIVATE ws2_32) |
| 158 | endif() | 160 | endif() |
| 159 | 161 | ||
| 160 | find_package(Threads) | 162 | find_package(Threads) |
| 161 | target_link_libraries(cryptopp ${CMAKE_THREAD_LIBS_INIT}) | 163 | target_link_libraries(cryptopp PRIVATE ${CMAKE_THREAD_LIBS_INIT}) |
diff --git a/externals/glad/CMakeLists.txt b/externals/glad/CMakeLists.txt index a97d4aa73..6d35a844b 100644 --- a/externals/glad/CMakeLists.txt +++ b/externals/glad/CMakeLists.txt | |||
| @@ -9,6 +9,7 @@ set(HEADERS | |||
| 9 | create_directory_groups(${SRCS} ${HEADERS}) | 9 | create_directory_groups(${SRCS} ${HEADERS}) |
| 10 | add_library(glad STATIC ${SRCS} ${HEADERS}) | 10 | add_library(glad STATIC ${SRCS} ${HEADERS}) |
| 11 | target_include_directories(glad PUBLIC "include/") | 11 | target_include_directories(glad PUBLIC "include/") |
| 12 | |||
| 12 | if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") | 13 | if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") |
| 13 | target_link_libraries(glad dl) | 14 | target_link_libraries(glad PRIVATE dl) |
| 14 | endif() | 15 | endif() |
diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt index c87f78bfc..cff36a581 100644 --- a/externals/inih/CMakeLists.txt +++ b/externals/inih/CMakeLists.txt | |||
| @@ -9,3 +9,4 @@ set(HEADERS | |||
| 9 | 9 | ||
| 10 | create_directory_groups(${SRCS} ${HEADERS}) | 10 | create_directory_groups(${SRCS} ${HEADERS}) |
| 11 | add_library(inih ${SRCS} ${HEADERS}) | 11 | add_library(inih ${SRCS} ${HEADERS}) |
| 12 | target_include_directories(inih INTERFACE .) | ||