diff options
| author | 2016-04-24 23:39:25 +0800 | |
|---|---|---|
| committer | 2016-04-24 23:39:25 +0800 | |
| commit | df81fa11fc8972a5775a57ccde1e0ef8d7fbfe64 (patch) | |
| tree | 21f5e69d89dcd56ae37b25e4b41f4cb5dd4ae552 | |
| parent | Merge pull request #1576 from smspillaz/fix-build-errors-03272016 (diff) | |
| download | yuzu-df81fa11fc8972a5775a57ccde1e0ef8d7fbfe64.tar.gz yuzu-df81fa11fc8972a5775a57ccde1e0ef8d7fbfe64.tar.xz yuzu-df81fa11fc8972a5775a57ccde1e0ef8d7fbfe64.zip | |
CMakeLists: Use imported version of Threads::Threads
This requires bumping up to a minimum of CMake 3.1. The benefit
of using the imported target is that you can switch to the -pthread
compiler flag on request, which may be necessary for some systems if
available.
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/citra/CMakeLists.txt | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ddde19760..019321ad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | # CMake 2.8.11 required for Qt5 settings to be applied automatically on | 1 | # CMake 3.1 required for Qt5 settings to be applied automatically on |
| 2 | # dependent libraries. | 2 | # dependent libraries and IMPORTED targets. |
| 3 | cmake_minimum_required(VERSION 2.8.11) | 3 | cmake_minimum_required(VERSION 3.1) |
| 4 | 4 | ||
| 5 | function(download_bundled_external remote_path lib_name prefix_var) | 5 | function(download_bundled_external remote_path lib_name prefix_var) |
| 6 | set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") | 6 | set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") |
| @@ -135,6 +135,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") | |||
| 135 | find_package(OpenGL REQUIRED) | 135 | find_package(OpenGL REQUIRED) |
| 136 | include_directories(${OPENGL_INCLUDE_DIR}) | 136 | include_directories(${OPENGL_INCLUDE_DIR}) |
| 137 | 137 | ||
| 138 | # Prefer the -pthread flag on Linux. | ||
| 139 | set (THREADS_PREFER_PTHREAD_FLAG ON) | ||
| 138 | find_package(Threads REQUIRED) | 140 | find_package(Threads REQUIRED) |
| 139 | 141 | ||
| 140 | if (ENABLE_SDL2) | 142 | if (ENABLE_SDL2) |
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 351752c1c..43fa06b4e 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt | |||
| @@ -21,7 +21,7 @@ target_link_libraries(citra ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) | |||
| 21 | if (MSVC) | 21 | if (MSVC) |
| 22 | target_link_libraries(citra getopt) | 22 | target_link_libraries(citra getopt) |
| 23 | endif() | 23 | endif() |
| 24 | target_link_libraries(citra ${PLATFORM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) | 24 | target_link_libraries(citra ${PLATFORM_LIBRARIES} Threads::Threads) |
| 25 | 25 | ||
| 26 | if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") | 26 | if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") |
| 27 | install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") | 27 | install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") |