Fix setting audacity_use_midi=off
authorBenjamin Drung <benjamin.drung@canonical.com>
Thu, 29 Sep 2022 09:05:41 +0000 (11:05 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 25 Jun 2024 16:28:26 +0000 (16:28 +0000)
When disabling MIDI support, cmake will fail:

```
$ cmake -B build -Daudacity_use_midi=off
[...]
CMake Error at cmake-proxies/CMakeLists.txt:314 (message):
  EXPERIMENTAL_MIDI_OUT requires USE_MIDI
```

Disable `EXPERIMENTAL_MIDI_OUT` in case MIDI support was explicitly
disabled.

Forwarded: https://github.com/audacity/audacity/pull/3717
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Gbp-Pq: Name Fix-setting-audacity_use_midi-off.patch

src/Experimental.cmake

index f92d9c0c43e08f94d0853dc5da01df08cad99287..17d9f4fe7ee67e810bb542a4ed35136f3263b68c 100644 (file)
@@ -101,23 +101,6 @@ set( EXPERIMENTAL_OPTIONS_LIST
    # Paul Licameli (PRL) 29 Nov 2014
    #IMPROVED_SEEKING
 
-   #MIDI_IN
-
-   # RBD, 1 Sep 2008
-   # Enables MIDI Output of NoteTrack (MIDI) data during playback
-   # USE_MIDI must be defined in order for MIDI_OUT to work
-   MIDI_OUT
-
-   # JKC, 17 Aug 2017
-   # Enables the MIDI note stretching feature, which currently
-   # a) Is broken on Linux (Bug 1646)
-   # b) Crashes with Sync-Lock (Bug 1719)
-   # c) Needs UI design review.
-   #MIDI_STRETCHING
-
-   # USE_MIDI must be defined in order for SCOREALIGN to work
-   #SCOREALIGN
-
    #Automatically tries to find an acceptable input volume
    #AUTOMATED_INPUT_LEVEL_ADJUSTMENT
 
@@ -174,6 +157,27 @@ set( EXPERIMENTAL_OPTIONS_LIST
 
 # Some more flags that depend on other configuration options
 
+if( NOT audacity_use_midi STREQUAL "off" )
+   list( APPEND EXPERIMENTAL_OPTIONS_LIST
+      #MIDI_IN
+
+      # RBD, 1 Sep 2008
+      # Enables MIDI Output of NoteTrack (MIDI) data during playback
+      # USE_MIDI must be defined in order for MIDI_OUT to work
+      MIDI_OUT
+
+      # JKC, 17 Aug 2017
+      # Enables the MIDI note stretching feature, which currently
+      # a) Is broken on Linux (Bug 1646)
+      # b) Crashes with Sync-Lock (Bug 1719)
+      # c) Needs UI design review.
+      #MIDI_STRETCHING
+
+      # USE_MIDI must be defined in order for SCOREALIGN to work
+      #SCOREALIGN
+   )
+endif()
+
 if( "SCRUBBING_SUPPORT" IN_LIST EXPERIMENTAL_OPTIONS_LIST )
    list( APPEND EXPERIMENTAL_OPTIONS_LIST SCRUBBING_SCROLL_WHEEL )
 endif()