-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugins): Move FLAC codec to a dedicated plugin.
The Flac Plugin is a shared library backed by the libflac.
- Loading branch information
Showing
13 changed files
with
643 additions
and
12,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Build and release Amplitude Audio SDK | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build-sdk: | ||
uses: ./.github/workflows/cmake.yml | ||
with: | ||
project-path: . | ||
name: Amplitude Audio SDK | ||
|
||
build-plugins: | ||
needs: [ build-sdk ] | ||
uses: ./.github/workflows/cmake.yml | ||
with: | ||
project-path: ./plugins/${{ matrix.project.path }} | ||
name: ${{ matrix.project.name }} | ||
strategy: | ||
matrix: | ||
project: | ||
- name: FLAC Codec | ||
path: codec-flac | ||
|
||
release: | ||
needs: [ build-plugins ] | ||
runs-on: ${{ matrix.config.os }} | ||
name: "[${{ matrix.build_type }}] ${{ matrix.config.name }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build_type: [ "release", "debug" ] | ||
config: | ||
- name: "Windows Latest MSVC" | ||
os: windows-latest | ||
artifact: "amplitude_audio_sdk_windows_msvc_x64.7z" | ||
archiver: "7z a" | ||
|
||
- name: "Windows Latest MinGW" | ||
os: windows-latest | ||
artifact: "amplitude_audio_sdk_windows_mingw_x64.7z" | ||
archiver: "7z a" | ||
|
||
- name: "Ubuntu_Latest_GCC" | ||
os: ubuntu-latest | ||
artifact: "amplitude_audio_sdk_linux_gcc_x64.7z" | ||
archiver: "7z a" | ||
|
||
- name: "Ubuntu_GCC_9" | ||
os: ubuntu-latest | ||
artifact: "amplitude_audio_sdk_linux_gcc9_x64.7z" | ||
archiver: "7z a" | ||
|
||
- name: "macOS Latest Clang" | ||
os: macos-latest | ||
artifact: "amplitude_audio_sdk_macos_clang_x64.7z" | ||
archiver: "7za a" | ||
|
||
steps: | ||
- name: Setup SDK Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: sdk | ||
key: ${{ matrix.build_type }}-${{ matrix.config.artifact }}-${{ env.GITHUB_SHA }} | ||
restore-keys: | | ||
${{ matrix.build_type }}-${{ matrix.config.artifact }}- | ||
- name: Pack | ||
shell: bash | ||
run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_${{ matrix.config.artifact }} LICENSE README.md sdk | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }} | ||
name: ${{ matrix.build_type }}_${{ matrix.config.artifact }} | ||
|
||
- name: Upload release asset | ||
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created') | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }} | ||
asset_name: ${{ matrix.build_type }}_${{ matrix.config.artifact }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Copyright (c) 2021-present Sparky Studios. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cmake_minimum_required(VERSION 3.20) | ||
|
||
cmake_policy(SET CMP0048 NEW) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/cmake") | ||
|
||
project(AmplitudeFlacCodecPlugin) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_DEBUG_POSTFIX "_d") | ||
|
||
set(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(OBJ_DIR ${CMAKE_CURRENT_BINARY_DIR}/obj) | ||
|
||
if(MSVC OR WIN32) | ||
set(RUNTIME_OUTPUT_DIRECTORY "win") | ||
elseif(APPLE) | ||
set(RUNTIME_OUTPUT_DIRECTORY "osx") | ||
set(CMAKE_MACOSX_RPATH 1) | ||
list(APPEND CMAKE_INSTALL_RPATH "@executable_path" "@loader_path/../shared/") | ||
else() | ||
set(RUNTIME_OUTPUT_DIRECTORY "linux") | ||
list(APPEND CMAKE_INSTALL_RPATH "${ORIGIN}" "${ORIGIN}/../shared/") | ||
endif() | ||
|
||
find_package(FLAC CONFIG REQUIRED) | ||
|
||
# Setup Amplitude | ||
# ------------------------------------------------------------------------------ | ||
find_package(AmplitudeAudioSDK REQUIRED) | ||
|
||
# Setup project source files. | ||
set(PLUGIN_SOURCE | ||
Plugin.h | ||
Plugin.cpp | ||
Codec.h | ||
Codec.cpp | ||
) | ||
|
||
# Includes for this project | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${AM_SDK_PATH}/include | ||
) | ||
|
||
add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCE}) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE AM_BUILDSYSTEM_BUILDING_PLUGIN) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE SparkyStudios::Audio::Amplitude::SDK::Shared FLAC::FLAC++ | ||
) | ||
|
||
# ##################################################### | ||
# INSTALL | ||
|
||
set(AM_LIB_DESTINATION "lib/${RUNTIME_OUTPUT_DIRECTORY}") | ||
set(AM_INC_DESTINATION "include") | ||
|
||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}") | ||
|
||
set(CMAKE_INSTALL_PREFIX "${AM_SDK_PATH}") | ||
|
||
install( | ||
TARGETS ${PROJECT_NAME} | ||
ARCHIVE DESTINATION ${AM_LIB_DESTINATION}/plugins | ||
LIBRARY DESTINATION ${AM_LIB_DESTINATION}/plugins | ||
RUNTIME DESTINATION ${AM_LIB_DESTINATION}/plugins | ||
) | ||
|
||
install( | ||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ | ||
DESTINATION ${AM_INC_DESTINATION} | ||
FILES_MATCHING PATTERN "*.h*" | ||
) | ||
|
||
export(PACKAGE ${PROJECT_NAME}) |
Oops, something went wrong.