Skip to content

Commit

Permalink
Fix MacOS build (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickisos authored Feb 25, 2024
1 parent 79a6520 commit 2eac8bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ jobs:
runs-on: macos-13
steps:
- name: Install dependencies
run: brew install automake fluid-synth gtk+ cairo lv2
run: brew install automake fluid-synth gtk+ cairo lv2 gtk-mac-integration expat
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
run: |
export LDFLAGS="-L$(brew --prefix)/lib"
export CPPFLAGS="-I$(brew --prefix expat)/include"
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_SHARED_LINKER_FLAGS="-L$(brew --prefix)/lib -Wl,-rpath,$(brew --prefix)/lib" -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/include"
- name: Build
run: cmake --build build
# install does not work yet, but seems less critical for now
Expand Down
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# General compile options
#

include(CheckLinkerFlag)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-ffast-math)
Expand Down Expand Up @@ -58,8 +60,11 @@ if(USE_LV2 AND USE_GUI)
set(LV2DIR "${CMAKE_INSTALL_PREFIX}/lib/lv2/calf.lv2")
add_library(calflv2gui SHARED gui.cpp gui_config.cpp gui_controls.cpp ctl_curve.cpp ctl_keyboard.cpp ctl_knob.cpp ctl_led.cpp ctl_tube.cpp ctl_vumeter.cpp ctl_frame.cpp ctl_fader.cpp ctl_buttons.cpp ctl_notebook.cpp ctl_meterscale.cpp ctl_combobox.cpp ctl_tuner.cpp ctl_phasegraph.cpp ctl_pattern.cpp metadata.cpp giface.cpp plugin_gui_window.cpp preset.cpp preset_gui.cpp lv2gui.cpp osctl.cpp utils.cpp ctl_linegraph.cpp drawingutils.cpp)
target_include_directories(calflv2gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_options(calflv2gui PRIVATE -Wl,-z,nodelete)
target_link_libraries(calflv2gui PRIVATE ${GTK_LIBRARIES} fluidsynth)
check_linker_flag(CXX -Wl,-z,nodelete LINKER_SUPPORTS_NODELETE)
if (LINKER_SUPPORTS_NODELETE)
target_link_options(calflv2gui PRIVATE -Wl,-z,nodelete)
endif()
target_link_libraries(calflv2gui PRIVATE ${GTK_LIBRARIES} ${EXPAT_LIBRARIES} fluidsynth)
set_target_properties(calf PROPERTIES
INSTALL_RPATH "${LV2DIR}"
BUILD_WITH_INSTALL_RPATH TRUE
Expand Down

0 comments on commit 2eac8bc

Please sign in to comment.