Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into thread-safety-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Nov 26, 2024
2 parents 241d25d + e82b6ae commit 352cd65
Show file tree
Hide file tree
Showing 442 changed files with 3,343 additions and 1,526 deletions.
105 changes: 105 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
Checks:
- "-*"
- "misc-include-cleaner"
- "bugprone-argument-comment"
- "bugprone-assert-side-effect"
- "bugprone-assignment-in-if-condition"
- "bugprone-bad-signal-to-kill-thread"
- "bugprone-bool-pointer-implicit-conversion"
- "bugprone-branch-clone"
- "bugprone-casting-through-void"
- "bugprone-chained-comparison"
- "bugprone-compare-pointer-to-member-virtual-function"
- "bugprone-copy-constructor-init"
- "bugprone-crtp-constructor-accessibility"
- "bugprone-dangling-handle"
- "bugprone-dynamic-static-initializers"
- "-bugprone-easily-swappable-parameters"
- "bugprone-empty-catch"
- "bugprone-exception-escape"
- "bugprone-fold-init-type"
- "bugprone-forward-declaration-namespace"
- "bugprone-forwarding-reference-overload"
- "bugprone-implicit-widening-of-multiplication-result"
- "bugprone-inaccurate-erase"
- "bugprone-inc-dec-in-conditions"
- "bugprone-incorrect-enable-if"
- "bugprone-incorrect-roundings"
- "bugprone-infinite-loop"
- "bugprone-unhandled-self-assignment"
- "bugprone-unchecked-optional-access"

- "bugprone-integer-division"
- "bugprone-lambda-function-name"
- "bugprone-macro-parentheses"
- "bugprone-macro-repeated-side-effects"
- "bugprone-misplaced-operator-in-strlen-in-alloc"
- "bugprone-misplaced-pointer-arithmetic-in-alloc"
- "bugprone-misplaced-widening-cast"
- "bugprone-move-forwarding-reference"
- "bugprone-multi-level-implicit-pointer-conversion"
- "bugprone-multiple-new-in-one-expression"
- "bugprone-multiple-statement-macro"
- "bugprone-no-escape"
- "bugprone-non-zero-enum-to-bool-conversion"
- "bugprone-not-null-terminated-result"
- "bugprone-optional-value-conversion"
- "bugprone-parent-virtual-call"
- "bugprone-pointer-arithmetic-on-polymorphic-object"
- "bugprone-posix-return"
- "bugprone-redundant-branch-condition"
- "bugprone-reserved-identifier"
- "bugprone-return-const-ref-from-parameter"
- "bugprone-shared-ptr-array-mismatch"
- "bugprone-signal-handler"
- "bugprone-signed-char-misuse"
- "bugprone-sizeof-container"
- "bugprone-sizeof-expression"
- "bugprone-spuriously-wake-up-functions"
- "bugprone-standalone-empty"
- "bugprone-string-constructor"
- "bugprone-string-integer-assignment"
- "bugprone-string-literal-with-embedded-nul"
- "bugprone-stringview-nullptr"
- "bugprone-suspicious-enum-usage"
- "bugprone-suspicious-include"
- "bugprone-suspicious-memory-comparison"
- "bugprone-suspicious-memset-usage"
- "bugprone-suspicious-missing-comma"
- "bugprone-suspicious-realloc-usage"
- "bugprone-suspicious-semicolon"
- "bugprone-suspicious-string-compare"
- "bugprone-suspicious-stringview-data-usage"
- "bugprone-swapped-arguments"
- "bugprone-switch-missing-default-case"
- "bugprone-terminating-continue"
- "bugprone-throw-keyword-missing"
- "bugprone-too-small-loop-variable"
- "bugprone-undefined-memory-manipulation"
- "bugprone-undelegated-constructor"
- "bugprone-unhandled-exception-at-new"
- "bugprone-unique-ptr-array-mismatch"
- "bugprone-unsafe-functions"
- "bugprone-unused-local-non-trivial-variable"
- "bugprone-unused-raii"
- "bugprone-unused-return-value"
- "bugprone-use-after-move"
- "bugprone-virtual-near-miss"
- "-readability-redundant-member-init"

#WarningsAsErrors: "*"
WarningsAsErrors: ""
FormatStyle: none
CheckOptions:
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: "true"
- key: cppcoreguidelines-rvalue-reference-param-not-moved.AllowPartialMove
value: "true"
- key: modernize-use-auto.RemoveStars
value: "true"
- key: misc-include-cleaner.IgnoreHeaders
value: ".*cesium-async\\+\\+\\.h"
HeaderFilterRegex: ".*"
HeaderFileExtensions: ["h"]
ImplementationFileExtensions: ["cpp"]
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,44 @@ jobs:
run: |
npm install
npm run format -- --dry-run -Werror
Linting:
name: "Linting"
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-ubuntu-24.04-clang-clang-tidy
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: ~/.ezvcpkg
key: vcpkg-ubuntu-24.04-clang-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
vcpkg-ubuntu-24.04-clang-${{ hashFiles('CMakeLists.txt') }}
vcpkg-ubuntu-24.04-clang
- name: Set CC and CXX
run: |
echo "CC=clang-18" >> "$GITHUB_ENV"
echo "CXX=clang++-18" >> "$GITHUB_ENV"
- name: Make more swap space available
run: |
sudo swapoff -a
sudo fallocate -l 10G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
sudo swapon --show
- name: Run clang-tidy
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
cmake --build build --target clang-tidy
Documentation:
runs-on: ubuntu-22.04
steps:
Expand All @@ -21,6 +59,18 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-ubuntu-22.04-doxygen
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: ~/.ezvcpkg
key: vcpkg-ubuntu-22.04-doxygen-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
vcpkg-ubuntu-22.04-doxygen-${{ hashFiles('CMakeLists.txt') }}
vcpkg-ubuntu-22.04-doxygen
- name: Generate Documentation
run: |
npm install
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

- Cesium Native now requires C++20.
- Switched from `gsl::span` to `std::span` throughout the library and API. The GSL library has been removed.
- The `BingMapsRasterOverlay` constructor no longer takes an `ellipsoid` parameter. Instead, it uses the ellipsoid specified in `RasterOverlayOptions`.
- The `ellipsoid` field in `RasterOverlayOptions` is no longer a `std::optional`. Instead, it defaults to WGS84 directly.
- Removed the `ellipsoid` field from `TileMapServiceRasterOverlayOptions`, `WebMapServiceRasterOverlayOptions`, and `WebMapTileServiceRasterOverlayOptions`. These overlays now use the ellipsoid in `RasterOverlayOptions` instead.

##### Additions :tada:

Expand All @@ -22,6 +25,7 @@
- Fixed a bug where an empty `extensions` object would get written if an `ExtensibleObject` only had unregistered extensions.
- Tightened the tolerance of `IntersectionTests::rayTriangleParametric`, allowing it to find intersections with smaller triangles.
- Fixed a bug that could cause `GltfUtilities::intersectRayGltfModel` to crash when the model contains a primitive whose position accessor does not have min/max values.
- `IonRasterOverlay` now passes its `RasterOverlayOptions` to the `BingMapsRasterOverlay` or `TileMapServiceRasterOverlay` that it creates internally.

### v0.41.0 - 2024-11-01

Expand Down
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ project(cesium-native
)

include(GNUInstallDirs)
include(CMakeDependentOption)

set(PACKAGE_BASE_DIR "${EZVCPKG_PACKAGES_DIR}")
set(PACKAGE_BUILD_DIR "${EZVCPKG_DIR}")
Expand All @@ -105,6 +106,15 @@ message(STATUS "PACKAGE_BUILD_DIR ${PACKAGE_BUILD_DIR}")

option(CESIUM_INSTALL_STATIC_LIBS "Whether to install the static libraries of cesium-native and its dependencies." ON)
option(CESIUM_INSTALL_HEADERS "Whether to install the header files of cesium-native and its public dependencies." ON)
option(CESIUM_ENABLE_CLANG_TIDY "Enable clang-tidy targets for static code analysis." ON)

cmake_dependent_option(
CESIUM_ENABLE_CLANG_TIDY_ON_BUILD
"Run clang-tidy while building. Will slow down the build process. Available only if CESIUM_ENABLE_CLANG_TIDY is ON."
OFF
CESIUM_ENABLE_CLANG_TIDY
OFF
)

if(CESIUM_INSTALL_STATIC_LIBS OR CESIUM_INSTALL_HEADERS)
foreach(PACKAGE ${PACKAGES_PUBLIC})
Expand Down Expand Up @@ -183,6 +193,17 @@ endif()
# Set defaults that need to be set AFTER compiler / IDE detection
include("cmake/compiler.cmake")

if(CESIUM_ENABLE_CLANG_TIDY)
setup_clang_tidy(
PROJECT_BUILD_DIRECTORY
"${PROJECT_BINARY_DIR}"
PROJECT_SOURCE_DIRECTORIES
"${PROJECT_SOURCE_DIR}"
ENABLE_CLANG_TIDY_ON_BUILD
${CESIUM_ENABLE_CLANG_TIDY_ON_BUILD}
)
endif()

# Add Modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/extern/cmake-modules/")
if (CESIUM_COVERAGE_ENABLED AND NOT MSVC)
Expand Down
7 changes: 4 additions & 3 deletions Cesium3DTiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ target_sources(
${CESIUM_3DTILES_PUBLIC_HEADERS}
)

target_include_directories(
Cesium3DTiles
SYSTEM PUBLIC
cesium_target_include_directories(
TARGET
Cesium3DTiles
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/generated/include
PRIVATE
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <optional>
Expand All @@ -14,7 +13,7 @@ namespace Cesium3DTiles {
* @brief Metadata about the entire tileset.
*/
struct CESIUM3DTILES_API Asset final : public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "Asset";
static constexpr const char* TypeName = "Asset";

/**
* @brief The 3D Tiles version. The version defines the JSON schema for the
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <cstdint>
Expand All @@ -15,7 +14,7 @@ namespace Cesium3DTiles {
*/
struct CESIUM3DTILES_API Availability final
: public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "Availability";
static constexpr const char* TypeName = "Availability";

/**
* @brief Known values for Integer indicating whether all of the elements are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <vector>
Expand All @@ -16,7 +15,7 @@ namespace Cesium3DTiles {
*/
struct CESIUM3DTILES_API BoundingVolume final
: public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "BoundingVolume";
static constexpr const char* TypeName = "BoundingVolume";

/**
* @brief An array of 12 numbers that define an oriented bounding box. The
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/BufferSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <cstdint>
Expand All @@ -16,7 +15,7 @@ namespace Cesium3DTiles {
* subtree file, or an external buffer referenced by a URI.
*/
struct CESIUM3DTILES_API BufferSpec : public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "Buffer";
static constexpr const char* TypeName = "Buffer";

/**
* @brief The URI (or IRI) of the file that contains the binary buffer data.
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/BufferView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <cstdint>
Expand All @@ -16,7 +15,7 @@ namespace Cesium3DTiles {
*/
struct CESIUM3DTILES_API BufferView final
: public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "BufferView";
static constexpr const char* TypeName = "BufferView";

/**
* @brief The index of the buffer.
Expand Down
7 changes: 3 additions & 4 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/ClassProperty.h"
#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/ClassProperty.h>
#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <optional>
Expand All @@ -16,7 +15,7 @@ namespace Cesium3DTiles {
* @brief A class containing a set of properties.
*/
struct CESIUM3DTILES_API Class final : public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "Class";
static constexpr const char* TypeName = "Class";

/**
* @brief The name of the class, e.g. for display purposes.
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/ClassProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// DO NOT EDIT THIS FILE!
#pragma once

#include "Cesium3DTiles/Library.h"

#include <Cesium3DTiles/Library.h>
#include <CesiumUtility/ExtensibleObject.h>
#include <CesiumUtility/JsonValue.h>

Expand All @@ -17,7 +16,7 @@ namespace Cesium3DTiles {
*/
struct CESIUM3DTILES_API ClassProperty final
: public CesiumUtility::ExtensibleObject {
static inline constexpr const char* TypeName = "ClassProperty";
static constexpr const char* TypeName = "ClassProperty";

/**
* @brief Known values for The element type.
Expand Down
Loading

0 comments on commit 352cd65

Please sign in to comment.