From b8995f0989ff7ff401e8677c0fb9acf68ee4dd2e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 14 Sep 2021 01:01:29 +0200 Subject: [PATCH] CMake: Disable VST (GTK) when gdk-x11-3.0 isn't found [wayland] The VST plugin done via GTK for non-apple & non-windows pulls , which is specific to X11 and thus isn't available in a pure-wayland system. This disables it automatically. Closes: https://github.com/tenacityteam/tenacity/issues/614 Signed-off-by: Haelwenn (lanodan) Monnier --- CMakeLists.txt | 7 +++++++ src/CMakeLists.txt | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e9902a8e..6cad847d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -798,6 +798,13 @@ endif() if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" ) find_package( GLIB REQUIRED ) find_package( GTK 3.0 REQUIRED ) + pkg_check_modules(GDK3_X11 gdk-x11-3.0) +endif() + +if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" ) + cmake_dependent_option( USE_VST "Use VST2 plug-in support [ON, OFF]" ON "GDK3_X11_FOUND" OFF) +else() + cmd_option( USE_VST "Use VST2 plug-in support [ON, OFF]" ON) endif() if( NOT WIN32 ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7963d60f5..ae4a60979 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,10 +57,6 @@ endif() cmd_option( use_ladspa "Use LADSPA plug-in support [ON, OFF]" ON ) set( USE_LADSPA ${use_ladspa} CACHE INTERNAL "" ) -# Handle VST option -cmd_option( use_vst "Use VST2 plug-in support [ON, OFF]" ON ) -set( USE_VST ${use_vst} CACHE INTERNAL "" ) - # ~~~ # General source files # ~~~