summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ameer J2021-06-30 21:47:57 -0400
committerGravatar GitHub2021-06-30 21:47:57 -0400
commitbab400daafaed898840c979e04717934cb977135 (patch)
treec0e91c958cca196000744303532687e9a0cfc20f
parentMerge pull request #6471 from lat9nq/dump-as-mod (diff)
parentcmake: Check dependencies for Linux Qt package (diff)
downloadyuzu-bab400daafaed898840c979e04717934cb977135.tar.gz
yuzu-bab400daafaed898840c979e04717934cb977135.tar.xz
yuzu-bab400daafaed898840c979e04717934cb977135.zip
Merge pull request #6459 from lat9nq/ubuntu-fixes
cmake: Improve Linux dependency checking for externals
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt89
-rw-r--r--externals/libusb/CMakeLists.txt11
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt5
3 files changed, 99 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60ec58eda..8b1734f36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -253,11 +253,82 @@ if(ENABLE_QT)
253 253
254 # Check for system Qt on Linux, fallback to bundled Qt 254 # Check for system Qt on Linux, fallback to bundled Qt
255 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 255 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
256 if (NOT YUZU_USE_BUNDLED_QT) 256 find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets)
257 find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets QUIET) 257 if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT)
258 if (NOT Qt5_FOUND) 258 # Check for dependencies, then enable bundled Qt download
259 set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE) 259
260 # Check that the system GLIBCXX version is compatible
261 find_program(OBJDUMP objdump)
262 if ("${OBJDUMP}" STREQUAL "OBJDUMP-NOTFOUND")
263 message(FATAL_ERROR "Required program `objdump` not found.")
260 endif() 264 endif()
265 find_library(LIBSTDCXX libstdc++.so.6)
266 execute_process(
267 COMMAND
268 ${OBJDUMP} -T ${LIBSTDCXX}
269 COMMAND
270 grep GLIBCXX_3.4.28
271 COMMAND
272 sed "s/[0-9a-f]*.* //"
273 COMMAND
274 sed "s/ .*//"
275 COMMAND
276 sort -u
277 OUTPUT_VARIABLE
278 GLIBCXX_MET
279 )
280 if (NOT GLIBCXX_MET)
281 message(FATAL_ERROR "Qt too old or not found, and bundled Qt package is not \
282 compatible with this system. Either install Qt ${QT_VERSION}, or provide the path \
283 to Qt by setting the variable Qt5_ROOT.")
284 endif()
285
286 # Check for headers
287 Include(FindPkgConfig REQUIRED)
288 pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
289 if (NOT QT_DEP_GLU_FOUND)
290 message(FATAL_ERROR "Qt bundled pacakge dependency `glu` not found. \
291 Perhaps `libglu1-mesa-dev` needs to be installed?")
292 endif()
293 pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
294 if (NOT QT_DEP_MESA_FOUND)
295 message(FATAL_ERROR "Qt bundled pacakge dependency `dri` not found. \
296 Perhaps `mesa-common-dev` needs to be installed?")
297 endif()
298
299 # Check for X libraries
300 set(BUNDLED_QT_REQUIREMENTS
301 libxcb-icccm.so.4
302 libxcb-image.so.0
303 libxcb-keysyms.so.1
304 libxcb-randr.so.0
305 libxcb-render-util.so.0
306 libxcb-render.so.0
307 libxcb-shape.so.0
308 libxcb-shm.so.0
309 libxcb-sync.so.1
310 libxcb-xfixes.so.0
311 libxcb-xinerama.so.0
312 libxcb-xkb.so.1
313 libxcb.so.1
314 libxkbcommon-x11.so.0
315 libxkbcommon.so.0
316 )
317 set(UNRESOLVED_QT_DEPS "")
318 foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
319 find_library(BUNDLED_QT_${REQUIREMENT} ${REQUIREMENT})
320 if ("${BUNDLED_QT_${REQUIREMENT}}" STREQUAL "BUNDLED_QT_${REQUIREMENT}-NOTFOUND")
321 set(UNRESOLVED_QT_DEPS ${UNRESOLVED_QT_DEPS} ${REQUIREMENT})
322 endif()
323 unset(BUNDLED_QT_${REQUIREMENT})
324 endforeach()
325 unset(BUNDLED_QT_REQUIREMENTS)
326
327 if (NOT "${UNRESOLVED_QT_DEPS}" STREQUAL "")
328 message(FATAL_ERROR "Bundled Qt package missing required dependencies: ${UNRESOLVED_QT_DEPS}")
329 endif()
330
331 set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE)
261 endif() 332 endif()
262 if (YUZU_USE_BUNDLED_QT) 333 if (YUZU_USE_BUNDLED_QT)
263 # Binary package currently does not support Qt webengine, so make sure it's disabled 334 # Binary package currently does not support Qt webengine, so make sure it's disabled
@@ -473,7 +544,15 @@ if (YUZU_USE_BUNDLED_FFMPEG)
473 544
474 # FFmpeg has source that requires one of nasm or yasm to assemble it. 545 # FFmpeg has source that requires one of nasm or yasm to assemble it.
475 # REQUIRED throws an error if not found here during configuration rather than during compilation. 546 # REQUIRED throws an error if not found here during configuration rather than during compilation.
476 find_program(ASSEMBLER NAMES nasm yasm REQUIRED) 547 find_program(ASSEMBLER NAMES nasm yasm)
548 if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND")
549 message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.")
550 endif()
551
552 find_program(AUTOCONF autoconf)
553 if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND")
554 message(FATAL_ERROR "Required program `autoconf` not found.")
555 endif()
477 556
478 set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg) 557 set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg)
479 set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg) 558 set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg)
diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt
index 8b9e6433c..151ddc462 100644
--- a/externals/libusb/CMakeLists.txt
+++ b/externals/libusb/CMakeLists.txt
@@ -5,6 +5,17 @@ if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE)
5 # GNU toolchains for some reason doesn't work with the later half of this CMakeLists after 5 # GNU toolchains for some reason doesn't work with the later half of this CMakeLists after
6 # updating to 1.0.24, so we do it the old-fashioned way for now. 6 # updating to 1.0.24, so we do it the old-fashioned way for now.
7 7
8 # Require autoconf and libtoolize here, rather than crash during compilation
9 find_program(AUTOCONF autoconf)
10 if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND")
11 message(FATAL_ERROR "Required program `autoconf` not found.")
12 endif()
13
14 find_program(LIBTOOLIZE libtoolize)
15 if ("${LIBTOOLIZE}" STREQUAL "LIBTOOLIZE-NOTFOUND")
16 message(FATAL_ERROR "Required program `libtoolize` not found.")
17 endif()
18
8 set(LIBUSB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libusb") 19 set(LIBUSB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libusb")
9 set(LIBUSB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libusb") 20 set(LIBUSB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libusb")
10 21
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 2208e1922..c9cff7450 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -18,7 +18,10 @@ set(SHADER_FILES
18 vulkan_uint8.comp 18 vulkan_uint8.comp
19) 19)
20 20
21find_program(GLSLANGVALIDATOR "glslangValidator" REQUIRED) 21find_program(GLSLANGVALIDATOR "glslangValidator")
22if ("${GLSLANGVALIDATOR}" STREQUAL "GLSLANGVALIDATOR-NOTFOUND")
23 message(FATAL_ERROR "Required program `glslangValidator` not found.")
24endif()
22 25
23set(GLSL_FLAGS "") 26set(GLSL_FLAGS "")
24set(QUIET_FLAG "--quiet") 27set(QUIET_FLAG "--quiet")