Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Aug 10, 2024
1 parent 411acc3 commit 4134ab9
Show file tree
Hide file tree
Showing 467 changed files with 105,253 additions and 123,947 deletions.
46 changes: 46 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Reference: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/bin
# https://clang-format-configurator.site/
# default values:
# https://github.com/llvm/llvm-project/blob/main/clang/lib/Format/Format.cpp
---
Language: Cpp
BasedOnStyle: Microsoft

# BreakBeforeBraces: Allman
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterUnion: true
BeforeWhile: true
# BreakBeforeBinaryOperators: All

ColumnLimit: 130
PointerAlignment: Left
UseTab: Always
BreakConstructorInitializers: BeforeComma

InsertNewlineAtEOF: true
IncludeBlocks: Regroup

IncludeCategories:
- Regex: '^"(box2d\/)'
Priority: 2
- Regex: '^<.*'
Priority: 3
- Regex: '^".*'
Priority: 1

IndentExternBlock: NoIndent
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentAccessModifiers: false
AccessModifierOffset: -4

# AlignArrayOfStructures: Left
# AlignAfterOpenBracket: BlockIndent

SpacesInParens: Custom
SpacesInParensOptions:
Other: true

10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto

*.c text
*.cpp text
*.h text
*.md text
*.txt text
*.sh text eol=lf

*.ttf binary
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Make sure these boxes are checked before submitting your issue - thank you!

- [ ] Ask for help on [discord](https://discord.gg/NKYgCBP) and/or [reddit](https://www.reddit.com/r/box2d)
- [ ] Ask for help on [discord](https://discord.gg/NKYgCBP)
- [ ] Consider providing a dump file using b2World::Dump
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Pull requests for core Box2D code are generally not accepted. Please consider filing an issue instead.

However, pull requests for build system improvements are often accepted.
69 changes: 40 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CMake
name: CI Build

on:
push:
Expand All @@ -7,72 +7,83 @@ on:
branches: [ main ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
BUILD_TYPE: Debug

jobs:
build-ubuntu:
name: ubuntu

# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
build-ubuntu-gcc:
name: ubuntu-gcc
runs-on: ubuntu-latest

timeout-minutes: 4
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF

- name: Install dependencies
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/test

build-ubuntu-clang:
name: ubuntu-clang
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ./bin/unit_test
run: ./bin/test

build-macos:
name: macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# some problem with simde
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBOX2D_SANITIZE=ON -DBUILD_SHARED_LIBS=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/unit_test
run: ./bin/test

build-windows:
name: windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4

- name: Setup MSVC dev command prompt
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# enkiTS is failing ASAN on windows
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBOX2D_SANITIZE=ON -DBUILD_SHARED_LIBS=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/${{env.BUILD_TYPE}}/unit_test
run: ./bin/${{env.BUILD_TYPE}}/test

6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ build/
imgui.ini
settings.ini
.vscode/
CMakeSettings.json
out/
.vs/
.cap
.DS_Store
CMakeUserPresets.json
.cache/
60 changes: 0 additions & 60 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 4134ab9

Please sign in to comment.