From 921104a4fb2dcee5088c30d868d1a8d351bbe53f Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 29 Jan 2019 17:26:25 -0800 Subject: [PATCH] qb: Don't force threads for win32. --- qb/config.libs.sh | 31 +++++++++++-------------------- qb/qb.libs.sh | 8 ++++++-- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 96ab81bc27..9a82ed0f7f 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -149,19 +149,13 @@ if [ "$OS" = 'DOS' ]; then HAVE_LANGEXTRA=no fi +check_lib '' THREADS "$PTHREADLIB" pthread_create +check_enabled THREADS THREAD_STORAGE 'Thread Local Storage' 'Threads are' +check_lib '' THREAD_STORAGE "$PTHREADLIB" pthread_key_create + if [ "$OS" = 'Win32' ]; then - HAVE_THREADS=yes - HAVE_THREAD_STORAGE=yes HAVE_DYLIB=yes else - check_lib '' THREADS "$PTHREADLIB" pthread_create - - if [ "$HAVE_THREADS" = 'yes' ]; then - check_lib '' THREAD_STORAGE "$PTHREADLIB" pthread_key_create - else - HAVE_THREAD_STORAGE=no - fi - check_lib '' DYLIB "$DYLIB" dlopen fi @@ -255,8 +249,8 @@ if [ "$HAVE_SDL2" = 'yes' ] && [ "$HAVE_SDL" = 'yes' ]; then HAVE_SDL=no fi -check_enabled CXX DISCORD discord 'the C++ compiler is' -check_enabled CXX QT 'Qt companion' 'the C++ compiler is' +check_enabled CXX DISCORD discord 'The C++ compiler is' +check_enabled CXX QT 'Qt companion' 'The C++ compiler is' if [ "$HAVE_QT" != 'no' ]; then check_pkgconf QT5CORE Qt5Core 5.2 @@ -319,7 +313,7 @@ if [ "$HAVE_SSL" != 'no' ]; then fi fi -check_enabled THREADS LIBUSB libusb 'threads are' +check_enabled THREADS LIBUSB libusb 'Threads are' check_val '' LIBUSB -lusb-1.0 libusb-1.0 libusb-1.0 1.0.13 '' false if [ "$OS" = 'Win32' ]; then @@ -380,14 +374,11 @@ fi check_val '' MPV -lmpv '' mpv '' '' false -if [ "$HAVE_THREADS" = 'no' ] && [ "$HAVE_FFMPEG" != 'no' ]; then - HAVE_FFMPEG='no' - die : 'Notice: Threads are not available, FFmpeg will also be disabled.' -fi - check_header DRMINGW exchndl.h check_lib '' DRMINGW -lexchndl +check_enabled THREADS FFMPEG FFmpeg 'Threads are' + if [ "$HAVE_FFMPEG" != 'no' ]; then check_val '' AVCODEC -lavcodec '' libavcodec 54 '' false check_val '' AVFORMAT -lavformat '' libavformat 54 '' false @@ -498,8 +489,8 @@ fi check_lib '' STRCASESTR "$CLIB" strcasestr check_lib '' MMAP "$CLIB" mmap -check_enabled CXX VULKAN vulkan 'the C++ compiler is' -check_enabled THREADS VULKAN vulkan 'threads are' +check_enabled CXX VULKAN vulkan 'The C++ compiler is' +check_enabled THREADS VULKAN vulkan 'Threads are' if [ "$HAVE_VULKAN" != "no" ] && [ "$OS" = 'Win32' ]; then HAVE_VULKAN=yes diff --git a/qb/qb.libs.sh b/qb/qb.libs.sh index 25b596a1ed..a3d1741883 100644 --- a/qb/qb.libs.sh +++ b/qb/qb.libs.sh @@ -49,11 +49,15 @@ check_enabled() tmpval="$(eval "printf %s \"\$USER_$2\"")" if [ "$tmpval" != 'yes' ]; then - eval "HAVE_$2=no" + setval="$(eval "printf %s \"\$HAVE_$2\"")" + if [ "$setval" != 'no' ]; then + eval "HAVE_$2=no" + die : "Notice: $4 disabled, $3 support will also be disabled." + fi return 0 fi - die 1 "Forced to build with $3 support and $4 disabled. Exiting ..." + die 1 "Error: $4 disabled and forced to build with $3 support." } # check_lib: