Skip to content

Commit

Permalink
LV2 Client: Link juce_lv2_helper with pthread to ensure that threadin…
Browse files Browse the repository at this point in the history
…g is enabled in loaded plug-ins
  • Loading branch information
reuk committed Jan 12, 2023
1 parent 9127ff3 commit 32164d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Expand Up @@ -164,7 +164,10 @@ install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"

if("${CMAKE_SOURCE_DIR}" STREQUAL "${JUCE_SOURCE_DIR}")
_juce_add_lv2_manifest_helper_target()
install(TARGETS juce_lv2_helper EXPORT LV2_HELPER DESTINATION "bin/JUCE-${JUCE_VERSION}")
install(EXPORT LV2_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")

if(TARGET juce_lv2_helper)
install(TARGETS juce_lv2_helper EXPORT LV2_HELPER DESTINATION "bin/JUCE-${JUCE_VERSION}")
install(EXPORT LV2_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
endif()
endif()

5 changes: 4 additions & 1 deletion extras/Build/CMake/JUCEUtils.cmake
Expand Up @@ -835,7 +835,7 @@ endfunction()
# ==================================================================================================

function(_juce_add_lv2_manifest_helper_target)
if(TARGET juce_lv2_helper)
if(TARGET juce_lv2_helper OR (CMAKE_SYSTEM_NAME STREQUAL "iOS") OR (CMAKE_SYSTEM_NAME STREQUAL "Android"))
return()
endif()

Expand All @@ -846,6 +846,9 @@ function(_juce_add_lv2_manifest_helper_target)
target_compile_features(juce_lv2_helper PRIVATE cxx_std_17)
set_target_properties(juce_lv2_helper PROPERTIES BUILD_WITH_INSTALL_RPATH ON)
target_link_libraries(juce_lv2_helper PRIVATE ${CMAKE_DL_LIBS})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(juce_lv2_helper PRIVATE Threads::Threads)
endfunction()

# ==================================================================================================
Expand Down

0 comments on commit 32164d5

Please sign in to comment.