Skip to content

Commit

Permalink
Github Action: upgrade runner to macos-12 (awawa-dev#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev authored and chbartsch committed Nov 29, 2022
1 parent ad90bd3 commit f36e430
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .ci/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
mkdir build || exit 1
cd build
ccache -p
cmake ${cachecommand} -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) package || exit 3

cmake ${cachecommand} -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) || exit 3
sudo cpack || exit 3
exit 0;
exit 1 || { echo "---> HyperHDR compilation failed! Abort"; exit 5; }
else
echo "Not using ccache"
mkdir build || exit 1
cd build
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) package || exit 3
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) || exit 3
sudo cpack || exit 3
exit 0;
exit 1 || { echo "---> HyperHDR compilation failed! Abort"; exit 5; }
fi
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ jobs:

macOS:
name: macOS
runs-on: macOS-10.15
runs-on: macos-12
env:
QT_VERSION: "5"
steps:
# Checkout
- uses: actions/checkout@v1
Expand Down Expand Up @@ -122,8 +124,16 @@ jobs:
# Install deps
- name: Install deps
shell: bash
run: brew update && brew install qt@6 xz ccache

run: brew update && brew install qt@${{ env.QT_VERSION }} xz ccache

# Set env
- name: Set QT5 env
if: ( env.QT_VERSION == '5' )
shell: bash
run: |
export Qt5_DIR=`brew --prefix qt5`;
echo "Qt5_DIR=$Qt5_DIR" >> $GITHUB_ENV
# Build process
- name: Build packages
env:
Expand Down
19 changes: 8 additions & 11 deletions sources/flatbufserver/FlatBufferConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,16 @@ void FlatBufferConnection::setRegister(const QString& origin, int priority)
uint8_t((size) & 0xFF) };

// write message
int count = 0;

if (_socket != nullptr)
{
count += _socket->write(reinterpret_cast<const char*>(header), 4);
count += _socket->write(reinterpret_cast<const char*>(_builder.GetBufferPointer()), size);
_socket->write(reinterpret_cast<const char*>(header), 4);
_socket->write(reinterpret_cast<const char*>(_builder.GetBufferPointer()), size);
_socket->flush();
}
else if (_domain != nullptr)
{
count += _domain->write(reinterpret_cast<const char*>(header), 4);
count += _domain->write(reinterpret_cast<const char*>(_builder.GetBufferPointer()), size);
_domain->write(reinterpret_cast<const char*>(header), 4);
_domain->write(reinterpret_cast<const char*>(_builder.GetBufferPointer()), size);
_domain->flush();
}
_builder.Clear();
Expand Down Expand Up @@ -294,17 +292,16 @@ void FlatBufferConnection::sendMessage(const uint8_t* buffer, uint32_t size)
uint8_t((size) & 0xFF) };

// write message
int count = 0;
if (_socket != nullptr)
{
count += _socket->write(reinterpret_cast<const char*>(header), 4);
count += _socket->write(reinterpret_cast<const char*>(buffer), size);
_socket->write(reinterpret_cast<const char*>(header), 4);
_socket->write(reinterpret_cast<const char*>(buffer), size);
_socket->flush();
}
else if (_domain != nullptr)
{
count += _domain->write(reinterpret_cast<const char*>(header), 4);
count += _domain->write(reinterpret_cast<const char*>(buffer), size);
_domain->write(reinterpret_cast<const char*>(header), 4);
_domain->write(reinterpret_cast<const char*>(buffer), size);
_domain->flush();
}
}
Expand Down
2 changes: 2 additions & 0 deletions sources/hyperhdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if (WIN32)
set(hyperhdr_POWER_MNG "WinSuspend.cpp;WinSuspend.h")
elseif (APPLE)
set(hyperhdr_POWER_MNG "MacSuspend.mm;MacSuspend.h")
find_library(APPKIT_FRAMEWORK AppKit REQUIRED)
elseif (Qt${Qt_VERSION}DBus_FOUND)
set(hyperhdr_POWER_MNG "LinuxSuspend.cpp;LinuxSuspend.h")
set(hyperhdr_POWER_MNG_DBUS "Qt${Qt_VERSION}::DBus")
Expand Down Expand Up @@ -44,6 +45,7 @@ target_link_libraries(hyperhdr
resources
Qt${Qt_VERSION}::Widgets
${hyperhdr_POWER_MNG_DBUS}
${APPKIT_FRAMEWORK}
)

if (USE_STATIC_QT_PLUGINS)
Expand Down

0 comments on commit f36e430

Please sign in to comment.