diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e67f6..bc4ec3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,13 +25,13 @@ jobs: - name: Cleanup run: | gh extension install actions/gh-actions-cache - + REPO=${{ github.repository }} BRANCH=${{ github.ref }} - + echo "Fetching list of cache key" cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) - + ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." @@ -44,46 +44,49 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} build: - needs: [ cleanup ] + needs: [cleanup] uses: AmplitudeAudio/sdk/.github/workflows/cmake.yml@develop with: project-path: . project-slug: plugin_flac + pull-sdk: true + sdk-version: nightly + need-flatc: false name: Flac Codec release: - needs: [ build ] + needs: [build] runs-on: ${{ matrix.config.os }} name: "[${{ matrix.build_type }}] ${{ matrix.config.name }}" strategy: fail-fast: false matrix: - build_type: [ "release", "debug" ] + build_type: ["release", "debug"] config: - name: "Windows Latest MSVC" os: windows-latest - artifact: "plugin_flac_windows_msvc_x64.7z" archiver: "7z a" + target_triplet: x64-windows - name: "Windows Latest MinGW" os: windows-latest - artifact: "plugin_flac_windows_mingw_x64.7z" archiver: "7z a" + target_triplet: x64-mingw-static - name: "Ubuntu Latest GCC" os: ubuntu-latest - artifact: "plugin_flac_linux_gcc_x64.7z" archiver: "7z a" + target_triplet: x64-linux - name: "macOS x64 Latest Clang" os: macos-13 - artifact: "plugin_flac_macos_clang_x64.7z" archiver: "7za a" + target_triplet: x64-osx - name: "macOS arm64 Latest Clang" os: macos-14 - artifact: "plugin_flac_macos_clang_arm64.7z" archiver: "7za a" + target_triplet: arm64-osx steps: - name: Check out code @@ -94,19 +97,22 @@ jobs: with: enableCrossOsArchive: true path: sdk - key: ${{ matrix.build_type }}-${{ matrix.config.artifact }}-${{ hashFiles('**/sdk') }} + key: ${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}-${{ hashFiles('**/sdk') }} restore-keys: | - ${{ matrix.build_type }}-${{ matrix.config.artifact }}- + ${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}- - name: Pack shell: bash - run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_${{ matrix.config.artifact }} LICENSE NOTICE README.md sdk + run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z LICENSE README.md sdk - name: Upload uses: actions/upload-artifact@v4 with: - path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }} - name: ${{ matrix.build_type }}_${{ matrix.config.artifact }} + path: | + LICENSE + README.md + sdk/ + name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }} - name: Upload release asset if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created') @@ -115,6 +121,6 @@ jobs: 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 + asset_path: ./${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z + asset_name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z + asset_content_type: application/x-7z-compressed diff --git a/CMakeLists.txt b/CMakeLists.txt index 727f7f8..6a41615 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,15 @@ cmake_minimum_required(VERSION 3.20) cmake_policy(SET CMP0048 NEW) -list(APPEND CMAKE_MODULE_PATH "$ENV{AM_SDK_PATH}/cmake" "${AM_SDK_PATH}/cmake") -list(APPEND CMAKE_PREFIX_PATH "$ENV{AM_SDK_PATH}/cmake" "${AM_SDK_PATH}/cmake") +if(EXISTS $ENV{AM_SDK_PATH}) + string(REPLACE "\\" "/" ENV_AM_SDK_PATH $ENV{AM_SDK_PATH}) + list(APPEND CMAKE_MODULE_PATH "${ENV_AM_SDK_PATH}/cmake") + list(APPEND CMAKE_PREFIX_PATH "${ENV_AM_SDK_PATH}/cmake") +endif() +list(APPEND CMAKE_MODULE_PATH "${AM_SDK_PATH}/cmake") +list(APPEND CMAKE_PREFIX_PATH "${AM_SDK_PATH}/cmake") + project(AmplitudeFlacCodecPlugin) set(CMAKE_CXX_STANDARD 20) @@ -81,7 +87,11 @@ set(AM_INC_DESTINATION "include") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}") -set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH}) +if(NOT AM_BUILDSYSTEM_BUILDING_AMPLITUDE) + set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/sdk") +else() + set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH}) +endif() install( TARGETS ${PROJECT_NAME}