Skip to content

Commit

Permalink
Explicitly link against pthreads
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Sep 14, 2024
1 parent 1dcb29a commit 7b608e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ option(WANT_JACK "Include JACK (Jack Audio Connection Kit) support" ON)
option(WANT_LASH "Include LASH (LASH Audio Session Handler) support" ON)
option(WANT_DEBUG "Create debug build" OFF)
option(WANT_LV2 "Build Lv2 wrapper" ON)
option(WANT_LV2_GUI "GUI executable will be used for LV2" ON)
option(WANT_LV2_GUI "GUI executable will be used for LV2" ON)
option(WANT_SORDI "Use the sordi tool to check Lv2 files" ON)
option(WANT_EXPERIMENTAL "Enable experimental effects" OFF)

Expand All @@ -35,6 +35,7 @@ option(WANT_EXPERIMENTAL "Enable experimental effects" OFF)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
find_package(EXPAT REQUIRED)

if(WANT_GUI)
Expand Down
18 changes: 9 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ endif()
target_include_directories(calf PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

target_include_directories(calf PRIVATE ${EXPAT_INCLUDE_DIRS} ${FluidSynth_INCLUDE_DIRS})
target_link_libraries(calf PUBLIC ${EXPAT_LIBRARIES} fluidsynth)
target_link_libraries(calf PUBLIC Threads::Threads ${EXPAT_LIBRARIES} fluidsynth)

if(USE_GUI)
target_include_directories(calf PRIVATE ${GTK_INCLUDE_DIRS})
target_link_libraries(calf PRIVATE ${GTK_LIBRARIES})
target_link_libraries(calf PRIVATE Threads::Threads ${GTK_LIBRARIES})
endif()

if(USE_JACK)
target_include_directories(calf PRIVATE ${JACK_INCLUDE_DIRS})
target_link_libraries(calf PRIVATE ${JACK_LIBRARIES})
target_link_libraries(calf PRIVATE Threads::Threads ${JACK_LIBRARIES})
endif()

if(USE_LASH)
target_include_directories(calf PRIVATE ${LASH_INCLUDE_DIRS})
target_link_libraries(calf PRIVATE ${LASH_LIBRARIES})
target_link_libraries(calf PRIVATE Threads::Threads ${LASH_LIBRARIES})
endif()

if(USE_LV2)
target_include_directories(calf PRIVATE ${LV2_INCLUDE_DIRS})
target_link_libraries(calf PRIVATE ${LV2_LIBRARIES})
target_link_libraries(calf PRIVATE Threads::Threads ${LV2_LIBRARIES})
endif()

#
Expand All @@ -52,7 +52,7 @@ endif()
if(USE_GUI)
add_library(calfgui 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 gui.cpp gui_config.cpp gui_controls.cpp osctl.cpp plugin_gui_window.cpp preset_gui.cpp utils.cpp ctl_linegraph.cpp drawingutils.cpp)
target_include_directories(calfgui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(calfgui PRIVATE ${GTK_LIBRARIES} fluidsynth)
target_link_libraries(calfgui PRIVATE Threads::Threads ${GTK_LIBRARIES} fluidsynth)
endif()


Expand All @@ -64,7 +64,7 @@ if(USE_LV2 AND USE_GUI)
if (LINKER_SUPPORTS_NODELETE)
target_link_options(calflv2gui PRIVATE -Wl,-z,nodelete)
endif()
target_link_libraries(calflv2gui PRIVATE ${GTK_LIBRARIES} ${EXPAT_LIBRARIES} fluidsynth)
target_link_libraries(calflv2gui PRIVATE Threads::Threads ${GTK_LIBRARIES} ${EXPAT_LIBRARIES} fluidsynth)
set_target_properties(calf PROPERTIES
INSTALL_RPATH "${LV2DIR}"
BUILD_WITH_INSTALL_RPATH TRUE
Expand All @@ -78,7 +78,7 @@ if(USE_GUI AND USE_JACK)
add_executable(calfjackhost gtk_session_env.cpp host_session.cpp jack_client.cpp jackhost.cpp gtk_main_win.cpp connector.cpp session_mgr.cpp)

target_include_directories(calfjackhost PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(calfjackhost PRIVATE calfgui calf ${JACK_LIBRARIES} ${GTK_LIBRARIES} fluidsynth)
target_link_libraries(calfjackhost PRIVATE Threads::Threads calfgui calf ${JACK_LIBRARIES} ${GTK_LIBRARIES} fluidsynth)

set_target_properties(calfjackhost PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
Expand All @@ -96,7 +96,7 @@ else()
add_executable(calfmakerdf makerdf.cpp)
endif()
target_include_directories(calfmakerdf PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${EXPAT_INCLUDE_DIRS})
target_link_libraries(calfmakerdf PRIVATE calf ${EXPAT_LIBRARIES} fluidsynth)
target_link_libraries(calfmakerdf PRIVATE calf Threads::Threads ${EXPAT_LIBRARIES} fluidsynth)

#
# install
Expand Down

0 comments on commit 7b608e4

Please sign in to comment.