diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94c30b1..353674a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,3 +77,30 @@ jobs: asset_name: libEIMTimeStretchers.dylib # Consider adding a Linux build here, I don't have a Linux machine to test on though + build-linux: + name: Build (Linux) + runs-on: ubuntu-latest + + steps: + - name: Check out git repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build + run: | + mkdir build + cd build + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release + cmake --build . --config Release + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ github.workspace }}/build/libEIMTimeStretchers.so + tag: ${{ github.ref }} + asset_name: libEIMTimeStretchers.so diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e5d65d..c9d76b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,17 @@ if (WIN32) set(CMAKE_PROJECT_VERSION 2.3.2) elseif (APPLE) add_definitions(-DHAVE_LIBSAMPLERATE -DHAVE_VDSP -DNO_THREAD_CHECKS -DUSE_PTHREADS -DMALLOC_IS_ALIGNED) +elseif (LINUX) + set(sleef_SOURCE_DIR ${CMAKE_SOURCE_DIR}/sleef) + set(sleef_BINARY_DIR ${CMAKE_BINARY_DIR}/sleef) + set(BUILD_DFT ON CACHE BOOL "" FORCE) + set(BUILD_TESTS OFF CACHE BOOL "" FORCE) + add_subdirectory("sleef") + include_directories(${sleef_BINARY_DIR}/include) + include_directories(${sleef_SOURCE_DIR}/include) + link_directories(${sleef_BINARY_DIR}/lib) + set(CMAKE_PROJECT_VERSION 2.3.2) + add_definitions(-DUSE_PTHREADS -DHAVE_LIBSAMPLERATE -DHAVE_SLEEF) endif () # check is Release build or MinSizeRel build @@ -53,4 +64,7 @@ if (WIN32) target_link_libraries(EIMTimeStretchers PRIVATE SoundTouch sleef sleefdft samplerate) elseif (APPLE) target_link_libraries(EIMTimeStretchers PRIVATE "-framework Accelerate" SoundTouch pthread samplerate) +elseif (LINUX) + add_dependencies(EIMTimeStretchers sleef) + target_link_libraries(EIMTimeStretchers PRIVATE SoundTouch sleef sleefdft samplerate) endif () diff --git a/build.gradle b/build.gradle index 9b45d7e..5750f3b 100644 --- a/build.gradle +++ b/build.gradle @@ -67,6 +67,7 @@ task downloadLibs(type: Copy) { downloadLib('-x86.dylib') downloadLib('.dylib') downloadLib('.dll') + downloadLib('.so') } tasks.withType(JavaCompile) {