diff --git a/CMakeLists.txt b/CMakeLists.txt index 60e547d..6708581 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.19) project(pd_chuck) +# general options +option(DYNAMIC_LINKING "enable dynamic linking with dependencies") + # linux options option(LINUX_ALSA "enable linux alsa build") option(LINUX_PULSE "enable linux pulseaudio build") diff --git a/Makefile b/Makefile index 4930582..0222fb2 100644 --- a/Makefile +++ b/Makefile @@ -133,6 +133,7 @@ linux-adv-alsa: faust @mkdir -p build && \ cd build && \ cmake .. \ + -DDYNAMIC_LINKING=ON \ -DLINUX_ALSA=ON \ -DENABLE_EXTRA_FORMATS=ON \ -DENABLE_MP3=ON \ @@ -144,6 +145,7 @@ linux-adv-pulse: faust @mkdir -p build && \ cd build && \ cmake .. \ + -DDYNAMIC_LINKING=ON \ -DLINUX_PULSE=ON \ -DENABLE_EXTRA_FORMATS=ON \ -DENABLE_MP3=ON \ @@ -155,6 +157,7 @@ linux-adv-jack: faust @mkdir -p build && \ cd build && \ cmake .. \ + -DDYNAMIC_LINKING=ON \ -DLINUX_JACK=ON \ -DENABLE_EXTRA_FORMATS=ON \ -DENABLE_MP3=ON \ @@ -166,6 +169,7 @@ linux-adv-all: faust @mkdir -p build && \ cd build && \ cmake .. \ + -DDYNAMIC_LINKING=ON \ -DLINUX_ALL=ON \ -DENABLE_EXTRA_FORMATS=ON \ -DENABLE_MP3=ON \ diff --git a/README.md b/README.md index 4340468..e0fe577 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ brew install cmake bison flex autoconf autogen automake flac libogg libtool libv On Debian Linux the requirements can be installed via: ```bash -sudo apt install build-essential cmake bison flex libsndfile1-dev libasound2-dev libpulse-dev libjack-jackd2-dev libmp3lame-dev libresample1-dev librubberband-dev +sudo apt install build-essential cmake bison flex libsndfile1-dev libasound2-dev libpulse-dev libjack-jackd2-dev libmpg123-dev libmp3lame-dev libresample1-dev librubberband-dev ``` Each build option has a Makefile target as follows: diff --git a/thirdparty/chugins/Fauck/CMakeLists.txt b/thirdparty/chugins/Fauck/CMakeLists.txt index 6bb293a..8af71e4 100644 --- a/thirdparty/chugins/Fauck/CMakeLists.txt +++ b/thirdparty/chugins/Fauck/CMakeLists.txt @@ -97,7 +97,25 @@ target_link_directories(${CHUGIN_NAME} ${THIRDPARTY}/install/lib ) - +if (DYNAMIC_LINKING) +target_link_libraries(${CHUGIN_NAME} + PUBLIC + ${LIBFAUST_DIR}/lib/libfaustwithllvm.a + $<$:-lFLAC> + $<$:-logg> + $<$:-lvorbis> + $<$:-lvorbisenc> + $<$:-lvorbisfile> + $<$:-lopus> + $<$:-lmpg123> + $<$:-lmp3lame> + -lsndfile + "$<$:-framework CoreFoundation>" + "$<$:-framework CoreMIDI>" + "$<$:-framework CoreAudio>" + "$<$:-framework Accelerate>" +) +else() target_link_libraries(${CHUGIN_NAME} PUBLIC ${LIBFAUST_DIR}/lib/libfaustwithllvm.a @@ -108,14 +126,14 @@ target_link_libraries(${CHUGIN_NAME} $<$:${LOCAL_LIB}/libvorbisfile.a> $<$:${LOCAL_LIB}/libopus.a> $<$:${LOCAL_LIB}/libmpg123.a> - $<$:${LOCAL_LIB}/libmp3lame.a> + $<$:${LOCAL_LIB}/libmp3lame.a> ${LOCAL_LIB}/libsndfile.a "$<$:-framework CoreFoundation>" "$<$:-framework CoreMIDI>" "$<$:-framework CoreAudio>" "$<$:-framework Accelerate>" ) - +endif() install( TARGETS ${CHUGIN_NAME} diff --git a/thirdparty/chugins/WarpBuf/CMakeLists.txt b/thirdparty/chugins/WarpBuf/CMakeLists.txt index a81607a..0f360b9 100644 --- a/thirdparty/chugins/WarpBuf/CMakeLists.txt +++ b/thirdparty/chugins/WarpBuf/CMakeLists.txt @@ -79,6 +79,26 @@ target_link_directories(${CHUGIN_NAME} ) +if (DYNAMIC_LINKING) +target_link_libraries(${CHUGIN_NAME} + PUBLIC + $<$:-lFLAC> + $<$:-logg> + $<$:-lvorbis> + $<$:-lvorbisenc> + $<$:-lvorbisfile> + $<$:-lopus> + $<$:-lmpg123> + $<$:-lmp3lame> + -lsndfile + -lrubberband + -lsamplerate + "$<$:-framework CoreFoundation>" + "$<$:-framework CoreMIDI>" + "$<$:-framework CoreAudio>" + "$<$:-framework Accelerate>" +) +else() target_link_libraries(${CHUGIN_NAME} PUBLIC $<$:${LOCAL_LIB}/libFLAC.a> @@ -97,6 +117,8 @@ target_link_libraries(${CHUGIN_NAME} "$<$:-framework CoreAudio>" "$<$:-framework Accelerate>" ) +endif() + # set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/examples") install(