From 5935e027eed54959e9dc66cad9e49183b1abb54f Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 12 May 2023 21:46:27 +0900 Subject: [PATCH] make it build on M2 macOS 13 (probably M1 and 10.13) --- CMakeLists.txt | 2 +- JUCE-targets.cmake | 3 +++ sources/ui/components/midi_keyboard_ex.cc | 5 ----- sources/ui/components/midi_keyboard_ex.h | 7 +------ 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c26f9a..8bbfcb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,7 @@ add_library(ADLplug_core STATIC EXCLUDE_FROM_ALL target_include_directories(ADLplug_core PUBLIC "sources" "${JUCE_PROJECT_DIR}/JuceLibraryCode") target_link_libraries(ADLplug_core PUBLIC juce_core juce_events juce_data_structures - juce_audio_basics juce_audio_processors + juce_audio_basics juce_audio_utils juce_audio_processors juce_graphics juce_gui_basics juce_gui_extra ADLMIDI_static) set_property(TARGET ADLplug_core diff --git a/JUCE-targets.cmake b/JUCE-targets.cmake index 88f804a..3517f84 100644 --- a/JUCE-targets.cmake +++ b/JUCE-targets.cmake @@ -77,6 +77,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") find_library(CORE_SERVICES_LIBRARY "CoreServices") find_library(APPLICATION_SERVICES_LIBRARY "ApplicationServices") find_library(CORE_AUDIO_LIBRARY "CoreAudio") + find_library(CORE_AUDIO_KIT_LIBRARY "CoreAudioKit") find_library(CORE_MIDI_LIBRARY "CoreMIDI") find_library(AUDIO_TOOLBOX_LIBRARY "AudioToolbox") find_library(ACCELERATE_LIBRARY "Accelerate") @@ -93,8 +94,10 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") target_link_libraries(juce_audio_devices PRIVATE "${CORE_AUDIO_LIBRARY}") target_link_libraries(juce_audio_devices PRIVATE "${CORE_MIDI_LIBRARY}") target_link_libraries(juce_audio_formats PRIVATE "${AUDIO_TOOLBOX_LIBRARY}") + target_link_libraries(juce_audio_utils PRIVATE "${CORE_AUDIO_KIT_LIBRARY}") target_link_libraries(juce_graphics PRIVATE "${CORE_IMAGE_LIBRARY}") target_link_libraries(juce_gui_basics PRIVATE "${IOKIT_LIBRARY}") + target_link_libraries(juce_gui_basics PRIVATE "${QUARTZ_CORE_LIBRARY}") if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") find_library(CARBON_LIBRARY "Carbon") diff --git a/sources/ui/components/midi_keyboard_ex.cc b/sources/ui/components/midi_keyboard_ex.cc index d5914b1..67e8e89 100644 --- a/sources/ui/components/midi_keyboard_ex.cc +++ b/sources/ui/components/midi_keyboard_ex.cc @@ -5,11 +5,6 @@ #include "midi_keyboard_ex.h" -// XXX(jpc) a hack so we don't need to link the whole `juce_audio_utils` -namespace ex { -#include -} - Midi_Keyboard_Ex::Midi_Keyboard_Ex(MidiKeyboardState &state, Orientation orientation) : MidiKeyboardComponent(state, orientation), designated_note_color_((uint8_t)245, 0, 41, 0.5f) diff --git a/sources/ui/components/midi_keyboard_ex.h b/sources/ui/components/midi_keyboard_ex.h index f742ef6..3887945 100644 --- a/sources/ui/components/midi_keyboard_ex.h +++ b/sources/ui/components/midi_keyboard_ex.h @@ -6,12 +6,7 @@ #pragma once #include "JuceHeader.h" -// XXX(jpc) a hack so we don't need to link the whole `juce_audio_utils` -namespace ex { -#include -} - -class Midi_Keyboard_Ex : public ex::juce::MidiKeyboardComponent { +class Midi_Keyboard_Ex : public juce::MidiKeyboardComponent { public: Midi_Keyboard_Ex(MidiKeyboardState &state, Orientation orientation); void highlight_note(unsigned note, unsigned velocity);