Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
4190f2f
.
jakoch Jul 17, 2024
1112071
tidy NULL to nullptr
jakoch Jul 18, 2024
3b7ddaa
rename CMake/Modules to CMake/finders
jakoch Jul 18, 2024
0d688c7
add config files for vscode (add include folder to includePath)
jakoch Jul 18, 2024
7c8319f
small refactoring
jakoch Jul 18, 2024
82c4901
set CXX_STANDARD 17
jakoch Jul 18, 2024
a61d12c
removing FCN_EXCEPTION
jakoch Jul 18, 2024
d7e6688
removing FCN_EXCEPTION
jakoch Jul 18, 2024
15d124a
solve array to pointer decay
jakoch Jul 18, 2024
b24ba96
merge pr-57 and formatting
felixdollack Aug 21, 2020
5352a23
update build-tools to run from top-level folder
jakoch Jul 18, 2024
4844505
tidy headers
jakoch Jul 18, 2024
ecb330e
fix color.hpp
jakoch Jul 18, 2024
1b28e98
modernize license and copyright headers
jakoch Jul 19, 2024
958eeaa
removed all extern "c" helper functions for extension detection by au…
jakoch Jul 19, 2024
49941d2
fix WIN32_LEAN_AND_MEAN redeclaration errors
jakoch Jul 19, 2024
a063464
remove all contributions folders, integrate into main folders
jakoch Jul 19, 2024
01d9cf3
simplify building of shared or static libraries, drop fine-grained bu…
jakoch Jul 19, 2024
a301bea
set CXX_STANDARD_REQUIRED ON
jakoch Jul 19, 2024
190dabc
removed source_group() support for Visual Studio IDE
jakoch Jul 19, 2024
69e257d
remove add_custom_target. i have no clue what this is for
jakoch Jul 19, 2024
cf9dfd1
remove PERMISSIONS from install targets
jakoch Jul 19, 2024
f2a003a
remove OGLFT dependency
jakoch Jul 19, 2024
ccd9b80
switch dependency management to VCPKG
jakoch Jul 19, 2024
917907c
add GHA CI workflow [skip appveyor]
jakoch Jul 20, 2024
53aecae
.
jakoch Jul 20, 2024
3b07447
remove oglft finder
jakoch Jul 20, 2024
1b27190
Merge branch 'one' of https://github.com/fifengine/fifechan into one
jakoch Jul 20, 2024
1b4716e
fix workflow file
jakoch Jul 20, 2024
e57564f
crafting workflow [skip appveyor]
jakoch Jul 20, 2024
cd5f41e
set vcpkg triplet based on shared_libs, fix slashes for windows
jakoch Jul 20, 2024
477b87c
fix yml
jakoch Jul 20, 2024
5de7863
fix space in vcpkg_toolchain concat
jakoch Jul 20, 2024
c9509a4
add source dir for cmake
jakoch Jul 20, 2024
3b5015e
more workflow building
jakoch Jul 20, 2024
cfd4612
building workflow
jakoch Jul 20, 2024
cecf5d7
workflow things
jakoch Jul 20, 2024
1509e5e
workflow
jakoch Jul 20, 2024
a25af9f
workflow things
jakoch Jul 20, 2024
a657866
add caches for vcpkg and build
jakoch Jul 20, 2024
100a3fd
fix ccache cache key
jakoch Jul 20, 2024
2b755ba
fetch latest version of sccache
jakoch Jul 20, 2024
02bc33f
download latest sscache
jakoch Jul 20, 2024
3225e61
ignore the .sha256 hash file
jakoch Jul 20, 2024
6949694
forgot the download step, rofl
jakoch Jul 20, 2024
aadb80d
wtf, change action
jakoch Jul 20, 2024
427a5a4
add install step
jakoch Jul 20, 2024
3be0bf7
add build_type to install step
jakoch Jul 20, 2024
b51e898
fix setting build_type
jakoch Jul 20, 2024
2c05e74
cmake is allgemein müll
jakoch Jul 20, 2024
a5a9b0f
build artifact name and upload
jakoch Jul 20, 2024
8438077
add asciiart into main header file
jakoch Jul 20, 2024
16ae1f5
add doxygen comment for symbol visibility to platform.hpp
jakoch Jul 21, 2024
19672fb
move includes/util/fcn_math.hpp to /includes/math.hpp
jakoch Jul 22, 2024
c11f54a
header fix for math.hpp move
jakoch Jul 22, 2024
3ac2d08
small refactoring
jakoch Jul 22, 2024
6ff293f
turn building FIFECHAN_EXAMPLES off
jakoch Jul 22, 2024
63b11a5
Why do C/C++ programmers make terrible secret agents? Because they ca…
jakoch Jul 23, 2024
8f6a881
add c++ quality workflow
jakoch Jul 23, 2024
6657e35
fix path to format.sh
jakoch Jul 23, 2024
31161ec
fixes for cpplint
jakoch Jul 23, 2024
a47a259
ignore cpplint rule runtime/indentation_namespace
jakoch Jul 23, 2024
f33870b
fix cpplint issues for tests folder
jakoch Jul 23, 2024
e62b0d1
cpplint include folder
jakoch Jul 23, 2024
4915f21
cpplint is peak google engineering
jakoch Jul 23, 2024
7d81f17
more exclude bullshit
jakoch Jul 23, 2024
067b87c
change color blending formula to the one found in SDL_gfx
jakoch Jul 23, 2024
2e67bdf
use LIB_INSTALL_DIR on all INSTALL paths to respect relative packaging
jakoch Jul 23, 2024
080b2bf
add build-tools/cpplint.sh, more fixes
jakoch Jul 23, 2024
77d1640
update changelog, update todo
jakoch Jul 23, 2024
555ddfa
fix c-style cast and type, remove exclude from cpplint cli invocation…
jakoch Jul 23, 2024
6e9d0af
move git-diff exit-code bubbling up into the format.sh file
jakoch Jul 23, 2024
4919394
lets see whats going on after clang-format on CI
jakoch Jul 23, 2024
7907b60
cleanup llvm.sh
jakoch Jul 23, 2024
c6782da
cleanup llvm.sh
jakoch Jul 23, 2024
f5f87c6
set chmod 755 on build-tools
jakoch Jul 23, 2024
a56caa0
lets do whatever git core.fileMode wants
jakoch Jul 23, 2024
2370bf7
remove Appveyor and remove standalone dependencies project and cmake …
jakoch Jul 23, 2024
c91a303
activate win-vc16-x64 builds on gha
jakoch Jul 23, 2024
02aa234
identify places where 'reinterpret_cast' is used
jakoch Jul 24, 2024
0e99b85
apply spellchecking, remove trivial comments, e.g. on constructor/des…
jakoch Jul 24, 2024
44b8438
switch from LIB_INSTALL_DIR+LIB_SUFFIX to CMAKE_INSTALL_LIBDIR
jakoch Jul 24, 2024
7a655ae
moved all third-party backends into a "backends" folder, adjust CMake…
jakoch Jul 24, 2024
7df0bee
fixes headers for "backends" folder change
jakoch Jul 24, 2024
addf162
remove usage of a global gui object, let error bubble up
jakoch Jul 24, 2024
ac56da2
removed backends: allegro, cairo, irrlicht, glut, hge, openlayer
jakoch Jul 24, 2024
3d2a17c
removed backends: allegro, cairo, irrlicht, glut, hge, openlayer
jakoch Jul 24, 2024
0684954
ident preprocessor directives
jakoch Jul 24, 2024
771b6c9
disable win-vc16-x64-static-release, because freetype doesn't build
jakoch Jul 24, 2024
eac0206
add CopyResources CMake script to help with asset copying
jakoch Jul 24, 2024
e2f6933
use modern filename scheme for package config files
jakoch Jul 24, 2024
c66cac2
use modern filename for package config files -2
jakoch Jul 24, 2024
d228bcd
add/handle conditional dependencies in package config
jakoch Jul 24, 2024
3988749
fix export target names to be found again
jakoch Jul 24, 2024
7d5ccc9
rename parameter recursiv to recursion
jakoch Jul 24, 2024
d8c800d
generate version.hpp from template, insert version data automatically
jakoch Jul 24, 2024
29161c4
avoid LF issues when switching between windows and linux
jakoch Jul 24, 2024
f85c21e
use CXX17 on tests binaries
jakoch Jul 24, 2024
c661ccb
configure cmake.buildDirectory
jakoch Jul 25, 2024
6f4b784
replace ligature which can not be rendered by windows terminal of course
jakoch Jul 25, 2024
f96cf91
fix file permissions
jakoch Jul 25, 2024
4124778
updated doxygen.conf to Doxygen v1.11.0
jakoch Jul 25, 2024
f38248e
fix doxygen warnings and tags
jakoch Jul 25, 2024
7d44bdb
fixed more doxygen issues
jakoch Jul 26, 2024
9e4d3ed
fix SDL2 includes
jakoch Jul 26, 2024
589714d
fix uninitialized cmake vars
jakoch Jul 26, 2024
996a349
add CMakePresets.json and composable presets
jakoch Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
124 changes: 124 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# A complete list of style options can be found at:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Google C++ Style Guide
# https://google.github.io/styleguide/cppguide.html

# You can disable formatting of a piece of code like so:
#
# int formatted_code;
# // clang-format off
# void unformatted_code ;
# // clang-format on
# void formatted_code_again;
#

Language: Cpp

# Basic indentation and spacing rules:
IndentWidth: 4
ContinuationIndentWidth: 4
UseCRLF: false
Standard: c++20
UseTab: Never
MaxEmptyLinesToKeep: 1

AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortLambdasOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes

# Configure each individual brace in BraceWrapping
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBraces: Custom

BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 120
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: true
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentFunctionDeclarationAfterType: false
NamespaceIndentation: All
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyBreakComment: 60
PenaltyBreakFirstLessLess: 20
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
SpaceAfterControlStatementKeyword: true
SpaceBeforeParens: ControlStatements
SpaceBeforeAssignmentOperators: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# int* value instead of int *value
DerivePointerAlignment: false
PointerAlignment: Left
PointerBindsToType: true
SpaceAroundPointerQualifiers: After

# Prefer "east const", placing `const` after the type: int const instead of const int
QualifierAlignment: Right

SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
# Headers in <> from specific external libraries.
- Regex: '^<(fmt|gtest|gmock|SDL|spdlog|allegro)(\/)?([A-Za-z0-9.\/-_])+>'
Priority: 3
- Regex: '^<fifechan/widgets/.*\.hpp>$'
Priority: 4
- Regex: '^<fifechan/.*\.hpp>$'
Priority: 5
- Regex: '^<[a-z0-9_]*\.hpp>$'
Priority: 6
# C++ standard library. These includes are all lowercase.
- Regex: '^<[a-z0-9_]*>$'
Priority: 7
39 changes: 39 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
clang-diagnostic-*,
-clang-analyzer-*,
cert-err34-c,
cppcoreguidelines-*,
cppcoreguidelines-rvalue-reference-param-not-moved,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-type-union-access,
google-explicit-constructor,
misc*,
-misc-no-recursion,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes
modernize*,
modernize-use-nullptr,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
portability-*,
readability-*,
-readability-identifier-length,
-readability-magic-numbers,
-readability-function-cognitive-complexity,

WarningsAsErrors: >
clang-analyzer-security.*
#HeaderFilterRegex: '.*include/fifechan.*\.hpp'
SystemHeaders: false
# Use our .clang-format file when applying fixes.
FormatStyle: file
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Fife DevBox",
"image": "ghcr.io/jakoch/cpp-devbox:bookworm-latest",
"customizations": {
"vscode": {
"extensions": [
// EditorConfig
"EditorConfig.EditorConfig",
// Git + Github
"GitHub.vscode-pull-request-github",
// C++
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools-themes",
// CMake
"ms-vscode.cmake-tools",
"twxs.cmake",
// Testing
"matepek.vscode-catch2-test-adapter",
"ms-vscode.test-adapter-converter",
"hbenl.vscode-test-explorer"
]
}
}
}
120 changes: 120 additions & 0 deletions .devcontainer/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#
# .github/workflows/build-windows.yml
#
# Copyright 2024 Jens A. Koch.
# SPDX-License-Identifier: MIT
# This file is part of fifeengine/fifechan.
#

name: "Build on Windows"

on:
- push
- pull_request
# You can manually run this workflow.
- workflow_dispatch


# improve CI concurrency by automatically cancelling outdated jobs
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:

# ---------------------------------------------------------------------------------------

build:

# ---------------------------------------------------------------------------------------

name: ${{ matrix.config.job_name }}

runs-on: windows-latest

strategy:
fail-fast: false
matrix:
shared_libs:
- OFF
- ON
build_type:
-"Release
#- Debug
config:
#- { job_name: "Windows VC16 x86", platform: "Win32", generator: "Visual Studio 16 2019" }
#- { job_name: "Windows VC16 x64", platform: "x64", generator: "Visual Studio 16 2019" }
#- { job_name: "Windows VC17 x86", platform: "Win32", generator: "Visual Studio 17 2022" }
#- { job_name: "Windows VC17 x64", platform: "x64", generator: "Visual Studio 17 2022" }
#- { job_name: "Windows MinGW x86", platform: "Win32", generator: "MinGW Makefiles" }
#- { job_name: "Windows MinGW x64", platform: "x64", generator: "MinGW Makefiles" }
#- { job_name: "Windows Ninja x86", platform: "Win32", generator: "Ninja" }
- { job_name: "Windows Ninja x64", platform: "x64", generator: "Ninja", triplet: "x64-windows" }

env:
VCPKG_DISABLE_METRICS: 1
BUILD_DIR: ${{github.workspace}}/build
INSTALL_DIR: ${{github.workspace}}/install

defaults:
run:
shell: cmd

steps:
- name: 🤘 Checkout Code
uses: actions/checkout@v4 # https://github.com/actions/checkout

# https://community.chocolatey.org/packages/ninja
- name: 🔽 Install Ninja
run: choco install ninja --no-progress

# https://community.chocolatey.org/packages/cmake
- name: 🔽 Install CMake
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' --no-progress

# WARNING
# ENV VCPKG_ROOT is redefined by this action
# and set to "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg"
# instead of "c:\vcpkg", which is important for the pre-installed VCPKG on GHA.
- name: 🛠️ Setup Visual Studio Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1 # https://github.com/ilammy/msvc-dev-cmd

# Redefine location to "c:\vcpkg"
- name: 🔽 Define VCPKG_ROOT
run: |
set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT%
echo VCPKG_ROOT=%VCPKG_ROOT% >> %GITHUB_ENV%

- name: 🔽 Update VCPKG to latest TAG
run: |
cd /d "%VCPKG_ROOT%"
git fetch --tags
for /f "delims=" %%i in ('git describe --tags --abbrev=0') do set LATEST_VCPKG_TAG=%%i
git checkout %LATEST_VCPKG_TAG%

- name: 🔽 Bootstrap + Integrate VCPKG
run: |
bootstrap-vcpkg.bat
vcpkg integrate

- name: 📁 Create build directory
run: |
mkdir ${{ env.BUILD_DIR }}

- name: ✏ CMake ➔ Configure
working-directory: ${{env.BUILD_DIR}}
run: |
cmake ^
-B ${{ env.BUILD_DIR }} ^
-G "${{ matrix.config.generator }}" ^
-A "${{ matrix.config.platform }}" ^
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ^
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} ^
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} ^
-DVCPKG_TARGET_TRIPLET="${{ matrix.config.triplet }}" ^
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake

- name: 🛠️ Build
working-directory: ${{env.BUILD_DIR}}
run: |
cmake --build . --config ${{ matrix.config.build_type }}
40 changes: 40 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file configures editors using the EditorConfig scheme.
# https://editorconfig.org/

# Guideline support for "Visual Studio 2022" IDE using extension: "PaulHarrington.EditorGuidelinesPreview"
# https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview

# Editorconfig support for "VSCode" using extension: "editorconfig.editorconfig"
# https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true

# "visual studio" specific
spelling_languages = en-us
guidelines = 80 dashed, 130

[CMakeLists.txt, *.{cmake}]
indent_size = 2

[*.{c,cc,cpp,h,hpp,hxx,inl}]
indent_size = 4
trim_trailing_whitespace = true
# "visual studio" specific
vc_generate_documentation_comments = doxygen_slash_star

[*.{json,yaml,yml}]
indent_size = 2
insert_final_newline = false

[*.{md,markdown}]
indent_size = 4
trim_trailing_whitespace = false

[*.{clang-format}]
indent_size = 2
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* eol=lf
*.png binary
*.xcf binary
*.bmp binary
*.exe binary
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# dependabot.yml
#
# Dependabot updates dependencies automatically to their latest versions.
#
# Docs: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2

updates:
# Enable automatic version updates for Github Actions
- package-ecosystem: "github-actions"
# Look for `.github/workflows` in the `root` directory
directory: "/"
schedule:
interval: "weekly"
ignore:
# ignore all updates for "https://github.com/actions/github-script"
- dependency-name: "github-script"
Loading