Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Release

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
BUILD_TYPE: Release
Expand All @@ -13,15 +13,15 @@ jobs:
build:
strategy:
matrix:
os: [ macos-14, ubuntu-latest, windows-latest ]
os: [macos-14, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSDL_UNIX_CONSOLE_BUILD=ON -DWARNINGS_AS_ERRORS=FALSE

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Application build output
build/
distribution/
.cache/

# Created by CPack when executing tests.
Testing/
Expand All @@ -14,3 +15,4 @@ profile.json

# User defined CMake preset file.
CMakeUserPresets.json
*.sublime-workspace
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22)

include(cmake/UniversalAppleBuild.cmake)
include(cmake/AppleBuild.cmake)

project(
BasicGuiProjectSetup
Expand Down
26 changes: 11 additions & 15 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"generator": "Ninja",
"binaryDir": "build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"WARNINGS_AS_ERRORS": "FALSE"
}
},
{
Expand All @@ -25,7 +26,8 @@
"generator": "Xcode",
"binaryDir": "build/xcode-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64"
},
"condition": {
"type": "equals",
Expand All @@ -39,7 +41,9 @@
"generator": "Xcode",
"binaryDir": "build/xcode-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"WARNINGS_AS_ERRORS": "FALSE"
},
"condition": {
"type": "equals",
Expand All @@ -60,9 +64,7 @@
"displayName": "Build Release",
"configurePreset": "release",
"configuration": "Release",
"targets": [
"App"
]
"targets": ["App"]
},
{
"name": "xcode-debug",
Expand All @@ -80,9 +82,7 @@
"displayName": "Build Release (Xcode)",
"configurePreset": "xcode-release",
"configuration": "Release",
"targets": [
"App"
],
"targets": ["App"],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand All @@ -95,17 +95,13 @@
"name": "release",
"displayName": "Distribute Release",
"configurePreset": "release",
"configurations": [
"Release"
]
"configurations": ["Release"]
},
{
"name": "xcode-release",
"displayName": "Distribute Release (Xcode)",
"configurePreset": "xcode-release",
"configurations": [
"Release"
],
"configurations": ["Release"],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand Down
45 changes: 25 additions & 20 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -20,16 +20,21 @@ community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Expand All @@ -47,15 +52,15 @@ decisions when appropriate.

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[EMAIL](mailto:EMAIL).
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand All @@ -77,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -104,25 +109,25 @@ Violating these terms may lead to a permanent ban.
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org

[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

[Mozilla CoC]: https://github.com/mozilla/diversity

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 <copyright holders>
Copyright (c) 2025 <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 9 additions & 0 deletions cmake/AppleBuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file needs to be included before calling `project`.
if (APPLE AND "${CMAKE_GENERATOR}" STREQUAL "Xcode")
# Define apple architecture for Release builds, use default. For an explicit
# universal executable use `x86_64;arm64`.
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE INTERNAL "OS X architecture")

# Support older macOS versions.
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum OS X deployment version")
endif ()
2 changes: 1 addition & 1 deletion cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

function(set_project_warnings project_name)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)
message(STATUS "Treat compiler warnings as errors")

set(MSVC_WARNINGS
/W4 # Baseline reasonable warnings
Expand Down Expand Up @@ -59,6 +58,7 @@ function(set_project_warnings project_name)
)

if (WARNINGS_AS_ERRORS)
message(STATUS "Treat compiler warnings as errors")
set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
endif ()
Expand Down
5 changes: 0 additions & 5 deletions cmake/UniversalAppleBuild.cmake

This file was deleted.

3 changes: 2 additions & 1 deletion docs/BuildAndExecution.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Run on a built target, in this example **debug**:
```

Though, even better is to use **Xcode as generator** to create app builds on macOS. Only difference in usage is running
CMake with `-GXcode`. If `CMAKE_OSX_ARCHITECTURES` is not set, it will create universal binaries on M1/2 macs.
CMake with `-GXcode` and setting the `CMAKE_OSX_ARCHITECTURES` variable, for example to `x86_64;arm64` for a universal
binaries.

To run a **debug** build created with Xcode:

Expand Down
3 changes: 3 additions & 0 deletions docs/CMakePresets.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ cpack --preset release

## Workflows

> [!IMPORTANT]
> Workflow presets are only available in CMake version 3.25 and up.

To list all available workflows, some dependent on the current system:

```shell
Expand Down
8 changes: 4 additions & 4 deletions docs/Packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Packaging settings for the application executable are in `src/app/cmake/packagin
The final application build for Apple devices should be built via the `Xcode` generator with CMake.

```shell
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -B build/xcode
cmake --build build/xcode
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build/xcode
cmake --build build/xcode --config Release
```

### Windows
Expand Down Expand Up @@ -61,8 +61,8 @@ system**.
Xcode should be used to create the release build for the application distributable.

```shell
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -B build/xcode
cmake --build build/xcode
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build/xcode
cmake --build build/xcode --config Release
cpack --config build/xcode/CPackConfig.cmake
```

Expand Down
5 changes: 2 additions & 3 deletions docs/Profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ int Application::run() {

## Show results

The resulting JSON file uses
the [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview). Any
The resulting JSON file (`profile.json`) uses the [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview). Any
tool that can read this format can visualize the profiler data. For example the web
tool [Perfetto](https://ui.perfetto.dev/) or Chromes built in [chrome://tracing](chrome://tracing). Just drag&drop the
generated profiler JSON file onto the tool to load it.
Expand All @@ -78,6 +77,6 @@ This is roughly how this looks like on Chrome.

![chrome-trace.png](assets/chrome-trace.png)

***
---

Next up: [Logging](Logging.md)
29 changes: 25 additions & 4 deletions docs/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Having all [requirements](README.md#requirements) set, here you can find how to

## Table of contents

- [TL;DR](#tldr)
- [Build](#build)
- [Execute](#execute)
- [macOS](#macos)
Expand All @@ -12,6 +13,24 @@ Having all [requirements](README.md#requirements) set, here you can find how to
- [Distribution](#distribution)
- [Tests](#tests)

## TL;DR

> [!IMPORTANT]
> Workflow presets are only available in CMake version 3.25 and up.

The quickest way possible to get an actual distributable from zero is using the available CMake workflows. For Linux and
Windows:

```shell
cmake --workflow --preset dist
```

And for macOS with Xcode:

```shell
cmake --workflow --preset xcode-dist
```

## Build

Usually available build modes are `Debug`, `Release`, and `RelWithDebInfo`.
Expand All @@ -30,12 +49,14 @@ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -B build/release
cmake --build build/release
```

On macOS Xcode should be used as generator via `-GXcode`. For example creating a release build with XCode.
On macOS Xcode should be used as generator via `-GXcode`. For example creating a release build with XCode. It is also
necessary to specify the Apple architecture via `CMAKE_OSX_ARCHITECTURES`, for example for a universal executable using
the value `x86_64;arm64"`.

```shell
# Using Xcode
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -B build/xcode
cmake --build build/xcode
# Using Xcode, create universal executable
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build/xcode
cmake --build build/xcode --config Release
```

## Execute
Expand Down
1 change: 1 addition & 0 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP ${CMAKE_CURRENT_LIST_DIR}/nsis\\\\

# Linux DEB settings
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl3-3.0-0")
# Section list: https://packages.debian.org/unstable/
set(CPACK_DEBIAN_PACKAGE_SECTION Miscellaneous)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Maintainer Name")
Expand Down
Loading
Loading