diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 579ce3dc4..891f13c8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,11 @@ name: Build on: [pull_request] jobs: build-mac: - name: Build Mac UI - runs-on: macos-latest + name: Mac UI on ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 @@ -11,15 +14,38 @@ jobs: working-directory: OSBindings/Mac run: xcodebuild CODE_SIGN_IDENTITY=- build-sdl: - name: Build SDL UI - runs-on: ubuntu-latest + name: SDL UI on ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - name: Install dependencies + shell: bash run: | - sudo apt-get --allow-releaseinfo-change update - sudo apt-get --fix-missing install gcc-10 libsdl2-dev scons + case $RUNNER_OS in + Linux) + sudo apt-get --allow-releaseinfo-change update + sudo apt-get --fix-missing install gcc-10 libsdl2-dev scons + ;; + macOS) + brew install scons sdl2 + ;; + esac - name: Make working-directory: OSBindings/SDL - run: scons -j$(nproc --all) + shell: bash + run: | + case $RUNNER_OS in + Linux) + jobs=$(nproc --all) + ;; + macOS) + jobs=$(sysctl -n hw.activecpu) + ;; + *) + jobs=1 + esac + scons -j"$jobs" diff --git a/Machines/Apple/AppleII/Video.hpp b/Machines/Apple/AppleII/Video.hpp index f29ba1a3a..ae3478928 100644 --- a/Machines/Apple/AppleII/Video.hpp +++ b/Machines/Apple/AppleII/Video.hpp @@ -472,9 +472,9 @@ template class Video: public VideoBase { // Supply the real phase value if this is an Apple build. // TODO: eliminate UGLY HACK. #if defined(__APPLE__) && !defined(IGNORE_APPLE) - constexpr int phase = 224; + constexpr uint8_t phase = 224; #else - constexpr int phase = 0; + constexpr uint8_t phase = 192; #endif crt_.output_colour_burst((colour_burst_end - colour_burst_start) * 14, phase); diff --git a/OSBindings/SDL/SConstruct b/OSBindings/SDL/SConstruct index f8c614a18..02f9893b1 100644 --- a/OSBindings/SDL/SConstruct +++ b/OSBindings/SDL/SConstruct @@ -1,4 +1,5 @@ import glob +import os import sys # Establish UTF-8 encoding for Python 2. @@ -7,7 +8,7 @@ if sys.version_info < (3, 0): sys.setdefaultencoding('utf-8') # Create build environment. -env = Environment() +env = Environment(ENV = {'PATH' : os.environ['PATH']}) # Determine compiler and linker flags for SDL. env.ParseConfig('sdl2-config --cflags') @@ -139,7 +140,14 @@ SOURCES += glob.glob('../../Storage/Tape/Parsers/*.cpp') env.Append(CCFLAGS = ['--std=c++17', '--std=c++1z', '-Wall', '-O2', '-DNDEBUG']) # Add additional libraries to link against. -env.Append(LIBS = ['libz', 'pthread', 'GL']) +env.Append(LIBS = ['libz', 'pthread']) + +# Add additional platform-specific compiler flags, libraries, and frameworks. +if env['PLATFORM'] == 'darwin': + env.Append(CCFLAGS = ['-DGL_SILENCE_DEPRECATION', '-DIGNORE_APPLE']) + env.Append(FRAMEWORKS = ['Accelerate', 'OpenGL']) +else: + env.Append(LIBS = ['GL']) # Build target. env.Program(target = 'clksignal', source = SOURCES) diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 226cb7c41..d0c253d30 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "../../Analyser/Static/StaticAnalyser.hpp" #include "../../Machines/Utility/MachineForTarget.hpp"