Skip to content

Commit

Permalink
Merge pull request #1 from xris1658/main
Browse files Browse the repository at this point in the history
Add Linux support and `build-linux` action
  • Loading branch information
ShirasawaSama authored Dec 10, 2023
2 parents 0057509 + 324f8e3 commit 6813f23
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ()
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ task downloadLibs(type: Copy) {
downloadLib('-x86.dylib')
downloadLib('.dylib')
downloadLib('.dll')
downloadLib('.so')
}

tasks.withType(JavaCompile) {
Expand Down

0 comments on commit 6813f23

Please sign in to comment.