Skip to content

Commit

Permalink
Apply some tweaks to support MacOS 12.
Browse files Browse the repository at this point in the history
  - Add GitHub CI build for macos-12.
  - `.bazelrc`: Configure `macos_minimum_os` to prompt correct toolchain selection for users with a complicated xcode configuration.
  - Addresses [#4](#4) regarding minimum MacOS version.
  - Also, fix [#8](#8) for MacOS 12.

PiperOrigin-RevId: 641012154
  • Loading branch information
jwcullen committed Jun 6, 2024
1 parent 8387745 commit a397e41
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ build --cxxopt=-Wno-sign-compare
# build.
build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build --enable_bzlmod=false

# Platform specific configuration.
build:macos --macos_minimum_os=12.0
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ jobs:
uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/iamf-tools-builder
macos-amd64:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/iamf-tools-builder
3 changes: 1 addition & 2 deletions iamf/common/write_bit_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "iamf/common/write_bit_buffer.h"

#include <algorithm>
#include <bit>
#include <cstdint>
#include <fstream>
#include <iterator>
Expand Down Expand Up @@ -180,7 +179,7 @@ absl::Status WriteBitBuffer::WriteString(const std::string& data) {
for (int i = 0; i < kIamfMaxStringSize; i++) {
// Note that some systems have `char` as signed and others unsigned. Write
// the same raw byte value regardless.
const uint8_t byte = std::bit_cast<uint8_t>(data[i]);
const uint8_t byte = static_cast<uint8_t>(data[i]);
RETURN_IF_NOT_OK(WriteUnsignedLiteral(byte, 8));

// Exit successfully after last byte was written.
Expand Down

0 comments on commit a397e41

Please sign in to comment.