1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-19 07:31:15 +00:00

Merge pull request #1270 from ryandesign/MacSDL

SDL build improvements
This commit is contained in:
Thomas Harte 2023-12-18 21:58:30 -05:00 committed by GitHub
commit abea3d10cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 12 deletions

View File

@ -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"

View File

@ -472,9 +472,9 @@ template <class BusHandler, bool is_iie> 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);

View File

@ -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)

View File

@ -19,7 +19,7 @@
#include <memory>
#include <sys/stat.h>
#include <SDL2/SDL.h>
#include <SDL.h>
#include "../../Analyser/Static/StaticAnalyser.hpp"
#include "../../Machines/Utility/MachineForTarget.hpp"