Skip to content

Commit

Permalink
Updated toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
mihe committed Mar 20, 2024
1 parent 6e05191 commit c215898
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 22 deletions.
17 changes: 14 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
# Requires LLVM 15.0
# Requires LLVM 16.0

# General
Language: Cpp
Standard: c++17
TabWidth: 4
UseTab: Always
UseCRLF: false
LineEnding: LF
InsertNewlineAtEOF: true

# Braces
BreakBeforeBraces: Custom
Expand Down Expand Up @@ -48,6 +49,7 @@ IndentWrappedFunctionNames: false
LambdaBodyIndentation: Signature
NamespaceIndentation: None
PPIndentWidth: -1
RequiresExpressionIndentation: OuterScope

# Spaces
BitFieldColonSpacing: Both
Expand Down Expand Up @@ -94,8 +96,10 @@ AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakAfterAttributes: Always
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
Expand Down Expand Up @@ -153,7 +157,8 @@ AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments: false
AlignTrailingComments:
Kind: Never

# Macros
AttributeMacros: []
Expand All @@ -168,12 +173,18 @@ WhitespaceSensitiveMacros: []
# Miscellaneous
FixNamespaceComments: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
Decimal: 0
Hex: 0
QualifierAlignment: Left
RawStringFormats: []
RemoveSemicolon: false
SortUsingDeclarations: false

# BasedOnStyle
# BreakAfterJavaFieldAnnotations
# BreakArrays
# DisableFormat
# IncludeIsMainRegex
# IncludeIsMainSourceRegex
Expand Down
8 changes: 7 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Requires LLVM 15.0
# Requires LLVM 16.0

# The checks are split it into 4 groups:
#
Expand Down Expand Up @@ -70,6 +70,7 @@ Checks: >
bugprone-suspicious-memory-comparison,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-realloc-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
Expand All @@ -85,8 +86,11 @@ Checks: >
-clang-diagnostic-pragma-once-outside-header,
concurrency-mt-unsafe,
-concurrency-thread-canceltype-asynchronous,
cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-do-while,
cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-avoid-reference-coroutine-parameters
cppcoreguidelines-init-variables,
cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-macro-usage,
Expand Down Expand Up @@ -127,6 +131,7 @@ Checks: >
misc-unused-alias-decls,
misc-unused-parameters,
misc-unused-using-decls,
misc-use-anonymous-namespace,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-loop-convert,
Expand Down Expand Up @@ -196,6 +201,7 @@ Checks: >
bugprone-inaccurate-erase,
-bugprone-shared-ptr-array-mismatch,
bugprone-sizeof-container,
-bugprone-standalone-empty,
bugprone-string-constructor,
bugprone-string-integer-assignment,
-bugprone-stringview-nullptr,
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ inputs:
toolchain:
required: true
version-gcc:
default: 11
default: 13
version-llvm:
default: 15
default: 16

runs:
using: composite
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Setup macOS

inputs:
version:
default: 14.3
default: 15.2

runs:
using: composite
Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Prerequisites:
- CMake 3.22 or newer
- Python 3.8 or newer
- GCC 11 or newer
- (Optional) Clang 15.0.0 or newer
- (Optional) Clang 16.0.0 or newer
- If you wish to compile with LLVM/Clang instead of GCC

⚠️ These commands will build binaries for 64-bit systems. If you instead wish to build binaries for
Expand Down
4 changes: 2 additions & 2 deletions docs/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Prerequisites:
you to use clang-format from within the editor of your choosing, such as [the C++ extension][cpp]
for Visual Studio Code, which can save you from the hassle of running the commands shown below.

⚠️ The clang-format configuration that Godot Jolt uses is written for **LLVM 15.0** and won't work
⚠️ The clang-format configuration that Godot Jolt uses is written for **LLVM 16.0** and won't work
with earlier versions, possibly not newer ones either.

There is a PowerShell script, `scripts/run_clang_format.ps1`, that runs clang-format on all source
Expand Down Expand Up @@ -227,7 +227,7 @@ Prerequisites:
to use clang-tidy from within the editor of your choosing, such as [the C++ extension][cpp] for
Visual Studio Code, which can save you from the hassle of running the commands shown below.

⚠️ The clang-tidy configuration that Godot Jolt uses is written for **LLVM 15.0** and won't work
⚠️ The clang-tidy configuration that Godot Jolt uses is written for **LLVM 16.0** and won't work
with earlier versions, possibly not newer ones either.

⚠️ Because clang-tidy effectively compiles the code in order to analyze it, it's highly recommended
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci_setup_linux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Write-Output "Adding the ubuntu-toolchain-r repository..."

add-apt-repository --yes --update ppa:ubuntu-toolchain-r/ppa

Write-Output "Updating package lists..."

apt update

Write-Output "Installing GCC $VersionGcc..."

apt install --quiet --yes `
Expand Down
3 changes: 2 additions & 1 deletion src/joints/jolt_cone_twist_joint_impl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ void JoltConeTwistJointImpl3D::rebuild() {

const JPH::BodyID body_ids[2] = {
body_a != nullptr ? body_a->get_jolt_id() : JPH::BodyID(),
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()};
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()
};

const JoltWritableBodies3D jolt_bodies = space->write_bodies(body_ids, count_of(body_ids));

Expand Down
3 changes: 2 additions & 1 deletion src/joints/jolt_generic_6dof_joint_impl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ void JoltGeneric6DOFJointImpl3D::rebuild() {

const JPH::BodyID body_ids[2] = {
body_a != nullptr ? body_a->get_jolt_id() : JPH::BodyID(),
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()};
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()
};

const JoltWritableBodies3D jolt_bodies = space->write_bodies(body_ids, count_of(body_ids));

Expand Down
3 changes: 2 additions & 1 deletion src/joints/jolt_hinge_joint_impl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ void JoltHingeJointImpl3D::rebuild() {

const JPH::BodyID body_ids[2] = {
body_a != nullptr ? body_a->get_jolt_id() : JPH::BodyID(),
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()};
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()
};

const JoltWritableBodies3D jolt_bodies = space->write_bodies(body_ids, count_of(body_ids));

Expand Down
3 changes: 2 additions & 1 deletion src/joints/jolt_pin_joint_impl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void JoltPinJointImpl3D::rebuild() {

const JPH::BodyID body_ids[2] = {
body_a != nullptr ? body_a->get_jolt_id() : JPH::BodyID(),
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()};
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()
};

const JoltWritableBodies3D jolt_bodies = space->write_bodies(body_ids, count_of(body_ids));

Expand Down
3 changes: 2 additions & 1 deletion src/joints/jolt_slider_joint_impl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ void JoltSliderJointImpl3D::rebuild() {

const JPH::BodyID body_ids[2] = {
body_a != nullptr ? body_a->get_jolt_id() : JPH::BodyID(),
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()};
body_b != nullptr ? body_b->get_jolt_id() : JPH::BodyID()
};

const JoltWritableBodies3D jolt_bodies = space->write_bodies(body_ids, count_of(body_ids));

Expand Down
12 changes: 8 additions & 4 deletions src/misc/type_conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ _FORCE_INLINE_ Transform3D to_godot(const JPH::Mat44& p_mat) {
Vector3(p_mat(0, 0), p_mat(1, 0), p_mat(2, 0)),
Vector3(p_mat(0, 1), p_mat(1, 1), p_mat(2, 1)),
Vector3(p_mat(0, 2), p_mat(1, 2), p_mat(2, 2)),
Vector3(p_mat(0, 3), p_mat(1, 3), p_mat(2, 3))};
Vector3(p_mat(0, 3), p_mat(1, 3), p_mat(2, 3))
};
}

_FORCE_INLINE_ Color to_godot(const JPH::Color& p_color) {
Expand All @@ -30,7 +31,8 @@ _FORCE_INLINE_ Color to_godot(const JPH::Color& p_color) {
r == 0.0f ? 0.0f : 255.0f / r,
g == 0.0f ? 0.0f : 255.0f / g,
b == 0.0f ? 0.0f : 255.0f / b,
a == 0.0f ? 0.0f : 255.0f / a};
a == 0.0f ? 0.0f : 255.0f / a
};
}

_FORCE_INLINE_ String to_godot(const JPH::String& p_str) {
Expand Down Expand Up @@ -58,7 +60,8 @@ _FORCE_INLINE_ JPH::Mat44 to_jolt(const Transform3D& p_transform) {
JPH::Vec4(b[0][0], b[1][0], b[2][0], 0.0f),
JPH::Vec4(b[0][1], b[1][1], b[2][1], 0.0f),
JPH::Vec4(b[0][2], b[1][2], b[2][2], 0.0f),
JPH::Vec3(o.x, o.y, o.z)};
JPH::Vec3(o.x, o.y, o.z)
};
}

_FORCE_INLINE_ JPH::Color to_jolt(const Color& p_color) {
Expand Down Expand Up @@ -86,5 +89,6 @@ _FORCE_INLINE_ JPH::RMat44 to_jolt_r(const Transform3D& p_transform) {
JPH::Vec4(b[0][0], b[1][0], b[2][0], 0.0f),
JPH::Vec4(b[0][1], b[1][1], b[2][1], 0.0f),
JPH::Vec4(b[0][2], b[1][2], b[2][2], 0.0f),
JPH::RVec3(o.x, o.y, o.z)};
JPH::RVec3(o.x, o.y, o.z)
};
}
3 changes: 2 additions & 1 deletion src/shapes/jolt_custom_ray_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ void JoltCustomRayShape::register_type() {
JPH::EShapeSubType::Cylinder,
JPH::EShapeSubType::ConvexHull,
JPH::EShapeSubType::Mesh,
JPH::EShapeSubType::HeightField};
JPH::EShapeSubType::HeightField
};

for (const JPH::EShapeSubType concrete_sub_type : concrete_sub_types) {
JPH::CollisionDispatch::sRegisterCollideShape(
Expand Down
6 changes: 4 additions & 2 deletions src/spaces/jolt_body_accessor_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ const JPH::BodyID* JoltBodyAccessor3D::get_ids() const {
},
[](const BodyIDSpan& p_span) {
return p_span.ptr;
}},
}
},
ids
);
}
Expand All @@ -97,7 +98,8 @@ int32_t JoltBodyAccessor3D::get_count() const {
},
[](const BodyIDSpan& p_span) {
return p_span.count;
}},
}
},
ids
);
}
Expand Down

0 comments on commit c215898

Please sign in to comment.