diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f62dbf06..6cb052ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,29 +43,16 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - build-sdk: + build: needs: [ cleanup ] uses: ./.github/workflows/cmake.yml with: project-path: . + project-slug: amplitude_audio_sdk 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 - - name: Vorbis Codec - path: codec-vorbis - release: - needs: [ build-plugins ] + needs: [ build ] runs-on: ${{ matrix.config.os }} name: "[${{ matrix.build_type }}] ${{ matrix.config.name }}" strategy: diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5248ec7d..0518de38 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -6,6 +6,10 @@ on: project-path: required: true type: string + project-slug: + required: true + type: string + jobs: build: @@ -19,8 +23,7 @@ jobs: - name: "Windows Latest MSVC" key: msvc os: windows-latest - sdk_dir: win - artifact: "amplitude_audio_sdk_windows_msvc_x64.7z" + artifact: "${{ inputs.project-slug }}_windows_msvc_x64.7z" cc: "cl" cxx: "cl" generator: "Visual Studio 17 2022" @@ -29,8 +32,7 @@ jobs: - name: "Windows Latest MinGW" key: mingw os: windows-latest - sdk_dir: win - artifact: "amplitude_audio_sdk_windows_mingw_x64.7z" + artifact: "${{ inputs.project-slug }}_windows_mingw_x64.7z" cc: "gcc" cxx: "g++" generator: "Ninja" @@ -39,8 +41,7 @@ jobs: - name: "Ubuntu Latest GCC" key: gcc os: ubuntu-24.04 - sdk_dir: linux - artifact: "amplitude_audio_sdk_linux_gcc_x64.7z" + artifact: "${{ inputs.project-slug }}_linux_gcc_x64.7z" cc: "gcc" cxx: "g++" generator: "Ninja" @@ -49,8 +50,7 @@ jobs: - name: "macOS x64 Latest Clang" key: clang os: macos-13 - sdk_dir: osx - artifact: "amplitude_audio_sdk_macos_clang_x64.7z" + artifact: "${{ inputs.project-slug }}_macos_clang_x64.7z" cc: "clang" cxx: "clang++" generator: "Ninja" @@ -59,8 +59,7 @@ jobs: - name: "macOS arm64 Latest Clang" key: clang os: macos-14 - sdk_dir: osx - artifact: "amplitude_audio_sdk_macos_clang_arm64.7z" + artifact: "${{ inputs.project-slug }}_macos_clang_arm64.7z" cc: "clang" cxx: "clang++" generator: "Ninja" @@ -181,12 +180,12 @@ jobs: - name: Copy flatc to SDK folder (Windows) if: startsWith(matrix.config.os, 'windows') run: | - Copy-Item .\bin\flatc.exe -Destination .\sdk\bin\${{ matrix.config.sdk_dir }} + Copy-Item .\bin\flatc.exe -Destination .\sdk\bin\${{ matrix.config.target_triplet }} - name: Copy flatc to SDK folder (Unix) if: startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos') run: | - cp ./bin/flatc ./sdk/bin/${{ matrix.config.sdk_dir }} + cp ./bin/flatc ./sdk/bin/${{ matrix.config.target_triplet }} - name: Save SDK Cache uses: actions/cache/save@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index b75edb41..97a74b7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,19 +36,11 @@ 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") -else () - set(RUNTIME_OUTPUT_DIRECTORY "linux") -endif () - -set(AM_LIB_DESTINATION "lib/${RUNTIME_OUTPUT_DIRECTORY}") +set(AM_LIB_DESTINATION "lib/${VCPKG_TARGET_TRIPLET}") set(AM_INC_DESTINATION "include") set(AM_SHM_DESTINATION "schemas") set(AM_PYS_DESTINATION "scripts") -set(AM_BIN_DESTINATION "bin/${RUNTIME_OUTPUT_DIRECTORY}") +set(AM_BIN_DESTINATION "bin/${VCPKG_TARGET_TRIPLET}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_BIN_DESTINATION}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}") @@ -492,8 +484,8 @@ foreach (build_type ${AM_BUILDSYSTEM_TYPE}) set_target_properties(${build_type} PROPERTIES - OUTPUT_NAME ${PROJECT_NAME} - ARCHIVE_OUTPUT_DIRECTORY ${build_type_l} + OUTPUT_NAME ${PROJECT_NAME} + ARCHIVE_OUTPUT_DIRECTORY ${build_type_l} ) target_compile_definitions(${build_type} PRIVATE AM_BUILDSYSTEM_BUILDING_AMPLITUDE)