Compare commits

...

4 Commits

Author SHA1 Message Date
3a3acae777 build: make Android NDK build happy
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:56:32 +01:00
3fb8edb23e build: reduce CMake version to 3.22.1 to build with Android NDK tools 2026-03-07 22:34:54 +01:00
d0026758c1 build: add libsndfile
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:31:18 +01:00
e47115b94f build: add CMake build
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:24:28 +01:00
7 changed files with 85 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "src/ext/libsndfile"]
path = src/ext/libsndfile
url = https://github.com/libsndfile/libsndfile.git

71
CMakeLists.txt Normal file
View File

@@ -0,0 +1,71 @@
cmake_minimum_required(VERSION 3.22.1)
project(rubberband)
set(CMAKE_CXX_STANDARD 20)
# -DNOMINMAX: for MSVCC to avoid defining max() as macro, breaking std::max()
# -DHAVE_UNISTD_H: for libsndfile access()
# -DUSE_PTHREADS: for Thread.h
set(CMAKE_CXX_FLAGS "-DNOMINMAX -DHAVE_UNISTD_H -DUSE_PTHREADS -DUSE_BQRESAMPLER -DHAVE_KISSFFT")
# disable libsndfile tests
set(BUILD_TESTING FALSE)
include_directories(
./rubberband
./src/common
./src/ext/float_cast
./src/ext/kissfft
./src/ext/pommier
./src/ext/speex
./src/faster
./src/finer
)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# only for WIN32 target system
include_directories(
./src/ext/getopt
)
endif()
set(RUBBERBAND_SRC
#./src/ext/getopt/getopt.c
#./src/ext/getopt/getopt_long.c
./src/ext/kissfft/kiss_fft.c
./src/ext/kissfft/kiss_fftr.c
./src/ext/speex/resample.c
./main/main.cpp
./src/common/Allocators.cpp
./src/common/BQResampler.cpp
./src/common/FFT.cpp
./src/common/Log.cpp
./src/common/mathmisc.cpp
./src/common/Profiler.cpp
./src/common/Resampler.cpp
./src/common/StretchCalculator.cpp
./src/common/sysutils.cpp
./src/common/Thread.cpp
./src/common/VectorOpsComplex.cpp
./src/faster/AudioCurveCalculator.cpp
./src/faster/CompoundAudioCurve.cpp
./src/faster/HighFrequencyAudioCurve.cpp
./src/faster/PercussiveAudioCurve.cpp
./src/faster/R2Stretcher.cpp
./src/faster/SilentAudioCurve.cpp
./src/faster/StretcherChannelData.cpp
./src/faster/StretcherProcess.cpp
./src/finer/R3LiveShifter.cpp
./src/finer/R3Stretcher.cpp
./src/rubberband-c.cpp
./src/RubberBandLiveShifter.cpp
./src/RubberBandStretcher.cpp
)
add_executable(rubberband-main ${RUBBERBAND_SRC})
add_library(rubberband SHARED ${RUBBERBAND_SRC})
add_subdirectory(src/ext/libsndfile)
target_link_libraries(rubberband-main sndfile)
target_link_libraries(rubberband sndfile)

View File

@@ -23,7 +23,7 @@
#include "VectorOpsComplex.h"
#include "system/sysutils.h"
//#include "system/sysutils.h"
#include <cassert>

View File

@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
#if OS_IS_WIN32
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -114,3 +116,5 @@ getopt(nargc, nargv, ostr)
}
return (optopt); /* dump back option letter */
}
#endif

View File

@@ -61,6 +61,8 @@
# if !defined(GETOPT_API)
# define GETOPT_API __declspec(dllimport)
# endif
#else
# define GETOPT_API
#endif
/*

View File

@@ -37,6 +37,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#if OS_IS_WIN32
#include <stdlib.h>
#include <string.h>
@@ -549,3 +550,5 @@ getopt_long(nargc, nargv, options, long_options, idx)
return retval;
}
#endif /* !GETOPT_LONG */
#endif

1
src/ext/libsndfile Submodule

Submodule src/ext/libsndfile added at 68f6c16fe1