Skip to content

Commit

Permalink
[wip] osc support in vst3 on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Mar 15, 2024
1 parent 4a4f9c4 commit 6adbeb9
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 9 deletions.
17 changes: 17 additions & 0 deletions cmake/avendish.dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,20 @@ if(NOT TARGET pantor::inja)
)
FetchContent_MakeAvailable(pantor_inja)
endif()

if(APPLE)
if(NOT TARGET jthread)
FetchContent_Declare(
jthread
GIT_REPOSITORY "https://github.com/StirlingLabs/jthread"
GIT_TAG main
GIT_PROGRESS true
)
FetchContent_MakeAvailable(jthread)
endif()
endif()


if(NOT TARGET jthread)
add_library(jthread INTERFACE)
endif()
15 changes: 14 additions & 1 deletion cmake/avendish.ossia.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,22 @@ function(avnd_make_ossia)
PUBLIC
Avendish::Avendish
ossia::ossia
SDL2
)

if(TARGET SDL2::SDL2)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
SDL2::SDL2
)
elseif(TARGET SDL2::SDL2-static)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
SDL2::SDL2-static
)
endif()

avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}")

target_sources(Avendish PRIVATE
Expand Down
16 changes: 15 additions & 1 deletion cmake/avendish.standalone.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,20 @@ function(avnd_make_standalone)
${AVND_FX_TARGET}
PUBLIC
ossia::ossia
SDL2
)
endif()

if(TARGET SDL2::SDL2)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
SDL2::SDL2
)
elseif(TARGET SDL2::SDL2-static)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
SDL2::SDL2-static
)
endif()

Expand Down Expand Up @@ -147,6 +160,7 @@ function(avnd_make_standalone)
${AVND_FX_TARGET}
PUBLIC
Avendish::Avendish
jthread
)

if(TARGET ossia::ossia)
Expand Down
4 changes: 2 additions & 2 deletions cmake/avendish.vst3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function(avnd_make_vst3)
${AVND_FX_TARGET}
PUBLIC
Avendish::Avendish_vst3
$<LINK_GROUP:RESCAN,base,sdk_common,pluginterfaces>
$<IF:$<BOOL:${APPLE}>,base sdk_common pluginterfaces,$<LINK_GROUP:RESCAN,base,sdk_common,pluginterfaces>>
DisableExceptions
)

Expand All @@ -84,7 +84,7 @@ function(avnd_make_vst3)
endif()

if(APPLE)
target_link_libraries(${AVND_FX_TARGET} PRIVATE "-Wl, -exported_symbols_list ,${CMAKE_BINARY_DIR}/vst3_symbols")
target_link_libraries(${AVND_FX_TARGET} PRIVATE jthread "-Wl,-exported_symbols_list,${CMAKE_BINARY_DIR}/vst3_symbols")
elseif(WIN32)
if(NOT MSVC)
target_link_libraries(${AVND_FX_TARGET} PRIVATE "-Wl,--version-script=${CMAKE_BINARY_DIR}/vst3_symbols")
Expand Down
4 changes: 4 additions & 0 deletions include/avnd/binding/standalone/oscquery_minimal_mapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#include <ossia/protocols/oscquery/oscquery_server_asio.hpp>

#include <iostream>
#include <thread>
#include <chrono>
#if __has_include(<jthread>)
#include <jthread>
#endif
namespace standalone
{
template <typename T>
Expand Down
10 changes: 5 additions & 5 deletions include/halp/controls_fmt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct formatter<halp::combo_pair<T>>
}

template <typename FormatContext>
auto format(const halp::combo_pair<T>& number, FormatContext& ctx)
auto format(const halp::combo_pair<T>& number, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "combo: {}->{}", number.first, number.second);
}
Expand All @@ -35,7 +35,7 @@ struct formatter<halp::xy_type<T>>
}

template <typename FormatContext>
auto format(const halp::xy_type<T>& number, FormatContext& ctx)
auto format(const halp::xy_type<T>& number, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "xy: {}, {}", number.x, number.y);
}
Expand All @@ -51,7 +51,7 @@ struct formatter<halp::color_type>
}

template <typename FormatContext>
auto format(const halp::color_type& number, FormatContext& ctx)
auto format(const halp::color_type& number, FormatContext& ctx) const
{
return fmt::format_to(
ctx.out(), "rgba: {}, {}, {}, {}", number.r, number.g, number.b, number.a);
Expand All @@ -68,7 +68,7 @@ struct formatter<halp::impulse_type>
}

template <typename FormatContext>
auto format(const halp::impulse_type& number, FormatContext& ctx)
auto format(const halp::impulse_type& number, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "impulse");
}
Expand All @@ -84,7 +84,7 @@ struct formatter<halp::range_slider_value<T>>
}

template <typename FormatContext>
auto format(const halp::range_slider_value<T>& number, FormatContext& ctx)
auto format(const halp::range_slider_value<T>& number, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "range: {} -> {}", number.start, number.end);
}
Expand Down

0 comments on commit 6adbeb9

Please sign in to comment.