Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
5tan committed Aug 5, 2024
1 parent fd7db8c commit 5ab1645
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
extra_check:
- ''
include:

- os: windows-latest
compiler: msvc
generator_flag: '-G "Visual Studio 17 2022"'
Expand Down Expand Up @@ -63,27 +62,15 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install googletest qt6 ninja

- name: Install Qt6 (windows, msvc)
if: matrix.os == 'windows-latest' && matrix.compiler == 'msvc'
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.7.1'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
#dir: '${{ github.workspace }}/build/qt6/'

- name: Install Qt6 (windows, MinGW)
if: matrix.os == 'windows-latest' && matrix.compiler == 'g++'
- name: Install Qt6 (windows)
if: matrix.os == 'windows-latest'
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.7.1'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
#dir: '${{ github.workspace }}/build/qt6/'
arch: ${{ matrix.compiler == 'msvc' && 'win64_msvc2019_64' || matrix.compiler == 'g++' && 'win64_mingw' }}

- name: Install clang (linux)
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang++'
Expand All @@ -106,19 +93,19 @@ jobs:
run: sudo apt-get install -y iwyu

- name: Configure CMake
run: cmake -Bbuild . -DCMAKE_CXX_COMPILER="${{matrix.compiler}}" ${{matrix.extra_check_flag}}
run: cmake -Bbuild ${{matrix.generator_flag}}. -DCMAKE_CXX_COMPILER="${{matrix.compiler}}" ${{matrix.extra_check_flag}}

- name: Build
run: cmake --build build

- name: Test
if: matrix.extra_check == '' # && matrix.os != 'windows-latest'
if: matrix.extra_check == '' && matrix.os != 'windows-latest'
run: ctest --test-dir build

# for some reason ctest doesn't work on windows. Execute tests directly:
# - name: Test (windows, msvc)
# if: matrix.os == 'windows-latest' && matrix.compiler == 'msvc'
# run: ${{ github.workspace }}\build\tests\Debug\tests.exe
# - name: Test (windows, MinGW)
# if: matrix.os == 'windows-latest' && matrix.compiler == 'g++'
# run: ${{ github.workspace }}\build\tests\tests.exe
- name: Test (windows, msvc)
if: matrix.os == 'windows-latest' && matrix.compiler == 'msvc'
run: ${{ github.workspace }}\build\tests\Debug\tests.exe
- name: Test (windows, MinGW)
if: matrix.os == 'windows-latest' && matrix.compiler == 'g++'
run: D:\a\cxxmidi\cxxmidi\build\tests\tests.exe
6 changes: 4 additions & 2 deletions include/cxxmidi/guts/player_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ PlayerBase::PlayerBase(output::Abstract* output)
void PlayerBase::SetupWindowsTimers() {
#ifdef WIN32
static bool once = true;
#ifdef __GNUC__
using namespace std; // for min/max
#endif
if (once) {
TIMECAPS tc;
UINT wTimerRes;

if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) == TIMERR_NOERROR) {
wTimerRes =
min(max(tc.wPeriodMin, 1u /* [ms] */), tc.wPeriodMax);
wTimerRes = min(max(tc.wPeriodMin, 1u /* [ms] */), tc.wPeriodMax);
timeBeginPeriod(wTimerRes);
}

Expand Down
3 changes: 1 addition & 2 deletions include/cxxmidi/output/windows/winmm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef INCLUDE_CXXMIDI_OUTPUT_WINDOWS_WINMM_HPP_
#define INCLUDE_CXXMIDI_OUTPUT_WINDOWS_WINMM_HPP_

#include <windows.h>
//
#include <mmsystem.h>
#include <windows.h>

#include <cstdint>
#include <cxxmidi/output/abstract.hpp>
Expand Down

0 comments on commit 5ab1645

Please sign in to comment.