Skip to content

Commit

Permalink
Merge branch 'master' into string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Feb 23, 2024
2 parents 9ca6101 + a6e1727 commit 6db2d4b
Show file tree
Hide file tree
Showing 188 changed files with 13,417 additions and 22,920 deletions.
8 changes: 7 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Checks: '
,*,
,-altera-id-dependent-backward-branch,
,-altera-struct-pack-align',
,-altera-struct-pack-align,
,-altera-unroll-loops,
,-android-cloexec-fopen,
,-bugprone-easily-swappable-parameters,
Expand All @@ -28,6 +28,7 @@ Checks: '
,-fuchsia-multiple-inheritance,
,-fuchsia-overloaded-operator,
,-fuchsia-statically-constructed-objects,
,-fuchsia-trailing-return,
,-google-global-names-in-headers,
,-google-readability-todo,
,-google-runtime-int,
Expand All @@ -43,15 +44,20 @@ Checks: '
,-llvm-qualified-auto,
,-llvmlibc-callee-namespace,
,-llvmlibc-implementation-in-namespace,
,-llvmlibc-inline-function-decl,
,-llvmlibc-restrict-system-libc-headers,
,-misc-no-recursion,
,-misc-non-private-member-variables-in-classes,
,-modernize-avoid-c-arrays,
,-modernize-use-nodiscard,
,-modernize-use-trailing-return-type,
,-readability-function-cognitive-complexity,
,-readability-identifier-length,
,-readability-magic-numbers,
,-readability-named-parameter,
,-readability-qualified-auto,
,-readability-uppercase-literal-suffix,
,-readability-use-anyofallof,
'
WarningsAsErrors: 'hicpp-use-override,modernize-avoid-bind,llvm-namespace-comment,modernize-use-nullptr,modernize-pass-by-value,hicpp-noexcept-move,boost-use-to-string,google-readability-namespace-comments,modernize-use-default-member-init,modernize-loop-convert,hicpp-use-nullptr,google-readability-braces-around-statements,cert-dcl03-c,readability-else-after-return,bugprone-macro-parentheses,readability-redundant-declaration,google-explicit-constructor,readability-avoid-const-params-in-decls'
CheckOptions:
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include/msvc/epoxy/* linguist-vendored
glad/** linguist-vendored
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
build:
runs-on: [ubuntu-latest]
container:
image: registry.gitlab.com/jhasse/android-ndk-docker:r25
image: registry.gitlab.com/jhasse/android-ndk-docker:r26b
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: make -C android
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- name: Install dependencies
run: microdnf install -y git graphviz doxygen cmake make tar xz rsync
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout submodules
shell: bash
run: |
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install libgl1-mesa-dev libfreetype6-dev libfontconfig1-dev libxxf86vm-dev libjpeg-dev libpng-dev libvorbis-dev libopenal-dev libepoxy-dev g++ libwebp-dev git libsdl2-dev ninja-build
- name: Build with CMake and GCC
sudo apt install libgl1-mesa-dev libfreetype6-dev libfontconfig1-dev libxxf86vm-dev libpng-dev libvorbis-dev g++ libwebp-dev git libsdl2-dev ninja-build
- name: Configure with CMake and GCC
run: cmake -Bbuild -G"Ninja Multi-Config"
- name: Build Debug
run: cd build && ninja
- name: Build Release
run: cd build && ninja -f build-Release.ninja
- name: Install unittest dependencies
run: sudo apt install xserver-xorg-core xserver-xorg-video-dummy
- name: Unittest
run: |
cmake -Bbuild -H. -GNinja
ninja -Cbuild
cd build
Xorg -config ../data/xorg.conf &>/dev/null &
sleep 1 # wait for Xorg to boot up
DISPLAY=:0 ./Debug/jngl-unittest
DISPLAY=:0 ./Release/jngl-unittest
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install sdl2 freetype libvorbis libepoxy jpeg webp pkg-config ninja
brew install sdl2 freetype libvorbis webp pkg-config ninja
- name: Build with CMake
run: |
cmake -H. -Bbuild-cmake -GNinja
Expand Down
50 changes: 47 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,60 @@
name: Windows
on: [push]
jobs:
clang-cl:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: cmake -Bbuild -G"Ninja Multi-Config" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
- name: Build (Debug)
run: cmake --build build --config Debug
- name: Unittest (Debug)
run: |
build/Debug/jngl-unittest Drawable
build/Debug/jngl-unittest ImageData
build/Debug/jngl-unittest FinallyTest
build/Debug/jngl-unittest halfLoadTest
build/Debug/jngl-unittest getBinaryPath
build/Debug/jngl-unittest readAsset
- name: Build (Release)
run: cmake --build build --config Release
- name: Unittest (Release)
run: |
build/Release/jngl-unittest Drawable
build/Release/jngl-unittest ImageData
build/Release/jngl-unittest FinallyTest
build/Release/jngl-unittest halfLoadTest
build/Release/jngl-unittest getBinaryPath
build/Release/jngl-unittest readAsset
msvc:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Configure
run: cmake -Bbuild
- name: Build (Debug)
run: cmake --build build --config Debug
- name: Unittest (Debug)
run: |
build/Debug/jngl-unittest Drawable
build/Debug/jngl-unittest ImageData
build/Debug/jngl-unittest FinallyTest
build/Debug/jngl-unittest halfLoadTest
build/Debug/jngl-unittest getBinaryPath
build/Debug/jngl-unittest readAsset
- name: Build (Release)
run: cmake --build build --config Release
- name: Unittest (Release)
run: |
build/Release/jngl-unittest Drawable
build/Release/jngl-unittest ImageData
build/Release/jngl-unittest FinallyTest
build/Release/jngl-unittest halfLoadTest
build/Release/jngl-unittest getBinaryPath
build/Release/jngl-unittest readAsset
- name: Configure (UWP)
run: cmake -Bbuild-uwp -DCMAKE_SYSTEM_NAME=WindowsStore '-DCMAKE_SYSTEM_VERSION=10.0'
- name: Build (UWP, Debug)
Expand All @@ -24,8 +68,8 @@ jobs:
image: registry.fedoraproject.org/fedora-minimal:37
steps:
- name: Install dependencies
run: microdnf install -y cmake ninja-build mingw64-pkg-config mingw64-libvorbis mingw64-SDL2 mingw64-fontconfig mingw64-libwebp mingw64-dlfcn mingw64-libepoxy mingw64-openal-soft mingw32-nsis tar gzip
- uses: actions/checkout@v3
run: microdnf install -y cmake ninja-build mingw64-pkg-config mingw64-libvorbis mingw64-SDL2 mingw64-fontconfig mingw64-libwebp mingw64-dlfcn mingw32-nsis mingw64-gcc-c++ tar gzip
- uses: actions/checkout@v4
- name: Build with CMake and GCC
run: |
mingw64-cmake -Bbuild-windows -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=0 -DJNGL_SDL2=1
Expand Down
14 changes: 9 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
variables:
CLICOLOR_FORCE: "1"
TERM: xterm
CPM_SOURCE_CACHE: ${CI_PROJECT_DIR}/.cache/cpm
cache:
key: cpm
paths: [.cache/cpm]

image: registry.fedoraproject.org/fedora-minimal:36
image: registry.fedoraproject.org/fedora-minimal:38

linux:
stage: build
script:
- microdnf install -y cmake ninja-build gcc-c++ fontconfig-devel freetype-devel libvorbis-devel libepoxy-devel libwebp-devel SDL2-devel openal-soft-devel libtheora-devel clang util-linux >/dev/null
- microdnf install -y cmake ninja-build gcc-c++ fontconfig-devel freetype-devel libvorbis-devel libwebp-devel SDL2-devel libtheora-devel clang util-linux >/dev/null
- CXXFLAGS=-fdiagnostics-color cmake -Bbuild -GNinja
- cd build
- ninja
Expand All @@ -25,14 +29,14 @@ linux:
mingw:
stage: build
script:
- microdnf install -y gcc-c++ cmake ninja-build mingw64-pkg-config mingw64-libvorbis mingw64-SDL2 mingw64-fontconfig mingw64-libjpeg-turbo mingw64-libwebp mingw64-dlfcn mingw64-libepoxy mingw64-openal-soft > /dev/null
- microdnf install -y cmake ninja-build mingw64-pkg-config mingw64-libvorbis mingw64-SDL2 mingw64-fontconfig mingw64-libwebp mingw64-dlfcn mingw64-gcc-c++ > /dev/null
- mingw64-cmake -GNinja -Bbuild-debug -DCMAKE_BUILD_TYPE=Debug
- ninja -C build-debug
- mingw64-cmake -GNinja -Bbuild-release -DCMAKE_BUILD_TYPE=Release
- ninja -C build-release

android:
image: registry.gitlab.com/jhasse/android-ndk-docker:r25
image: registry.gitlab.com/jhasse/android-ndk-docker:r26b
stage: build
script:
- make -C android
Expand All @@ -47,7 +51,7 @@ steamos:
- cd -
- cmake -Bbuild-steamos -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=0
- cmake --build build-steamos
- cmake -Bbuild-steamos-release -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=0 -DJNGL_VIDEO=0 -DJNGL_JPEG=0 -DJNGL_BUILD_WEBP_FROM_SOURCE=1 -DBUILD_SHARED_LIBS=0
- cmake -Bbuild-steamos-release -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=0 -DJNGL_VIDEO=0 -DJNGL_BUILD_WEBP_FROM_SOURCE=1 -DBUILD_SHARED_LIBS=0
- cmake --build build-steamos-release

pages:
Expand Down
18 changes: 17 additions & 1 deletion .vscode/build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
@echo off

:: see https://blog.pcitron.fr/2022/01/04/dont-use-vcvarsall-vsdevcmd/
set VSCMD_ARG_HOST_ARCH=x64
set VSCMD_ARG_TGT_ARCH=x64
set VSCMD_ARG_APP_PLAT=Desktop
set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\
call "%VSINSTALLDIR%\Common7\Tools\vsdevcmd\core\winsdk.bat"
call "%VSINSTALLDIR%\Common7\Tools\vsdevcmd\ext\cmake.bat"
call "%VSINSTALLDIR%\Common7\Tools\vsdevcmd\ext\vcvars.bat"
if not defined INCLUDE set INCLUDE=%__VSCMD_VCVARS_INCLUDE%%__VSCMD_WINSDK_INCLUDE%%__VSCMD_NETFX_INCLUDE%%INCLUDE%

if exist build\build.ninja (
rem file exists
) else (
cmake -Bbuild -G"Ninja Multi-Config" -DJNGL_VIDEO=0
)
cmake --build build
32 changes: 6 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "launch",
"name": "jngl-test (GDB)",
"target": "./build/jngl-test",
"cwd": "${workspaceRoot}",
"valuesFormatting": "prettyPrinters",
"preLaunchTask": "build"
},
{
"type": "gdb",
"request": "launch",
"name": "videoplayer (GDB)",
"target": "./build/videoplayer",
"arguments": "data/verysmall.ogv",
"cwd": "${workspaceRoot}",
"valuesFormatting": "prettyPrinters",
"preLaunchTask": "build"
},
{
"type": "lldb",
"request": "launch",
"name": "jngl-test (LLDB)",
"program": "${workspaceRoot}/build/jngl-test",
"program": "${workspaceRoot}/build/Debug/jngl-test",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "build"
Expand All @@ -33,7 +14,7 @@
"type": "lldb",
"request": "launch",
"name": "videoplayer",
"program": "${workspaceRoot}/build/videoplayer",
"program": "${workspaceRoot}/build/Debug/videoplayer",
"args": ["data/verysmall.ogv"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "build"
Expand All @@ -42,7 +23,7 @@
"type": "lldb",
"request": "launch",
"name": "jngl-unittest (LLDB)",
"program": "${workspaceRoot}/build/jngl-unittest",
"program": "${workspaceRoot}/build/Debug/jngl-unittest",
"args": [],
"cwd": "${workspaceRoot}/build",
"preLaunchTask": "build"
Expand All @@ -51,12 +32,11 @@
"name": "jngl-test (C/C++)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/jngl-test",
"program": "${workspaceRoot}/build/Debug/jngl-test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
Expand All @@ -74,10 +54,10 @@
"preLaunchTask": "build"
},
{
"name": "unittest (C/C++)",
"name": "jngl-unittest (C/C++)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/unittest",
"program": "${workspaceRoot}/build/Debug/jngl-unittest",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}/build",
Expand Down
Loading

0 comments on commit 6db2d4b

Please sign in to comment.