Skip to content

Commit

Permalink
Add SCXT_USE_CLAP_WRAPPER_STANDALONE Cmake Option (#1172)
Browse files Browse the repository at this point in the history
add SCXT_USE_CLAP_WRAPPER_STANDALONE cmake option which means
the build will proceed with the clap wrapper standalone rather
than my bodged together juce standalone. It is off by default
but very close to having it be on on mac and win.
  • Loading branch information
baconpaul authored Aug 23, 2024
1 parent 073eaf5 commit 49bf4f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ option(SCXT_USE_FLAC "Include FLAC support" ON)
option(SCXT_USE_MP3 "Include MP3 support" ON)

option(SCXT_SANITIZE "Build with clang/gcc address and undef sanitizer" OFF)
option(SCXT_USE_CLAP_WRAPPER_STANDALONE "Build with the clap wrapper standalone rather than our temp one" OFF)


# Calculate bitness
Expand Down
38 changes: 21 additions & 17 deletions clients/clap-first/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,28 @@ if (APPLE)
endif()

set(SA_TARGET ${PROJECT_NAME}_Standalone)
add_executable(${SA_TARGET} MACOSX_BUNDLE WIN32)
set_target_properties(${SA_TARGET} PROPERTIES
OUTPUT_NAME ${name})
target_sources(${SA_TARGET} PRIVATE scxt-juce-standalone/scxt-juce-standalone.cpp)
target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET} juce::juce_audio_devices juce::juce_audio_utils)
target_compile_definitions(${SA_TARGET} PRIVATE
JUCE_ALSA=$<IF:$<BOOL:${SCXT_USE_ALSA}>,1,0>
JUCE_JACK=$<IF:$<BOOL:${SCXT_USE_JACK}>,1,0>
JUCE_USE_FLAC=0)
set_target_properties(${SA_TARGET} PROPERTIES UNITY_BUILD FALSE)


#add_executable(${SA_TARGET} scxt-clap-entry.cpp)
#target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET})
#target_add_standalone_wrapper(TARGET ${SA_TARGET}
# OUTPUT_NAME ${name}
# STATICALLY_LINKED_CLAP_ENTRY True
# PLUGIN_ID "org.surge-synth-team.scxt.clap-first.scxt-plugin")
if (${SCXT_USE_CLAP_WRAPPER_STANDALONE})
message(STATUS "Standalone is CLap Wrapper")
add_executable(${SA_TARGET} scxt-clap-entry.cpp)
target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET})
target_add_standalone_wrapper(TARGET ${SA_TARGET}
OUTPUT_NAME ${name}
STATICALLY_LINKED_CLAP_ENTRY True
PLUGIN_ID "org.surge-synth-team.shortcircuit-xt")
else()
message(STATUS "Standalone is BaconPaul's Bodged Juce Thing")
add_executable(${SA_TARGET} MACOSX_BUNDLE WIN32)
set_target_properties(${SA_TARGET} PROPERTIES
OUTPUT_NAME ${name})
target_sources(${SA_TARGET} PRIVATE scxt-juce-standalone/scxt-juce-standalone.cpp)
target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET} juce::juce_audio_devices juce::juce_audio_utils)
target_compile_definitions(${SA_TARGET} PRIVATE
JUCE_ALSA=$<IF:$<BOOL:${SCXT_USE_ALSA}>,1,0>
JUCE_JACK=$<IF:$<BOOL:${SCXT_USE_JACK}>,1,0>
JUCE_USE_FLAC=0)
set_target_properties(${SA_TARGET} PROPERTIES UNITY_BUILD FALSE)
endif()

set(ALL_TARGET ${PROJECT_NAME}_all)
add_custom_target(${ALL_TARGET})
Expand Down
2 changes: 1 addition & 1 deletion libs/clap/clap-wrapper

0 comments on commit 49bf4f3

Please sign in to comment.