Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate warnings from includes via the third_party libraries. #974

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ClangTidy:
- docker
script:
- cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Bbuild/clang
- python3 /usr/local/bin/run-clang-tidy.py -j $(($(nproc)/2+1)) -p build/clang -clang-tidy-binary=clang-tidy-10 -header-filter=framework,samples,vulkan_samples -checks=-*,google-*,-google-runtime-references -quiet framework/* samples/* vulkan_samples/* tests/*
- python3 /usr/local/bin/run-clang-tidy.py -j $(($(nproc)/2+1)) -p build/clang -clang-tidy-binary=clang-tidy-10 -isystem third_party -header-filter=framework,samples,vulkan_samples -checks=-*,google-*,-google-runtime-references -quiet framework/* samples/* vulkan_samples/* tests/*

Linux:
stage: Build
Expand Down
6 changes: 2 additions & 4 deletions app/plugins/file_logger/file_logger.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2021-2023, Arm Limited and Contributors
* Copyright (c) 2021-2023, Sascha Willems
/* Copyright (c) 2021-2024, Arm Limited and Contributors
* Copyright (c) 2021-2024, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,11 +20,9 @@

#include "apps.h"

VKBP_DISABLE_WARNINGS()
#include <fmt/format.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()

namespace plugins
{
Expand Down
4 changes: 1 addition & 3 deletions components/core/include/core/util/error.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2023, Thomas Atkinson
/* Copyright (c) 2024, Thomas Atkinson
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -50,10 +50,8 @@
__pragma(warning(pop))
#endif

VKBP_DISABLE_WARNINGS()
// TODO: replace with a direct fmt submodule
#include <fmt/format.h>
VKBP_ENABLE_WARNINGS()

#include <stdexcept>

Expand Down
4 changes: 1 addition & 3 deletions components/core/tests/strings.test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2023, Thomas Atkinson
/* Copyright (c) 2024, Thomas Atkinson
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -17,9 +17,7 @@

#include <core/util/error.hpp>

VKBP_DISABLE_WARNINGS()
#include <catch2/catch_test_macros.hpp>
VKBP_ENABLE_WARNINGS()

#include <core/util/strings.hpp>

Expand Down
4 changes: 1 addition & 3 deletions framework/camera.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019, Sascha Willems
/* Copyright (c) 2019-2024, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,11 +19,9 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down
8 changes: 3 additions & 5 deletions framework/common/helpers.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018-2022, Arm Limited and Contributors
/* Copyright (c) 2018-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -36,10 +36,8 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
#include <glm/gtx/hash.hpp>
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down Expand Up @@ -102,7 +100,7 @@ inline void read(std::istringstream &is, std::array<T, N> &value)
}

template <typename T, typename... Args>
inline void read(std::istringstream &is, T &first_arg, Args &... args)
inline void read(std::istringstream &is, T &first_arg, Args &...args)
{
read(is, first_arg);

Expand Down Expand Up @@ -157,7 +155,7 @@ inline void write(std::ostringstream &os, const std::array<T, N> &value)
}

template <typename T, typename... Args>
inline void write(std::ostringstream &os, const T &first_arg, const Args &... args)
inline void write(std::ostringstream &os, const T &first_arg, const Args &...args)
{
write(os, first_arg);

Expand Down
2 changes: 0 additions & 2 deletions framework/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
#include "glm/gtx/quaternion.hpp"
VKBP_ENABLE_WARNINGS()

#include "filesystem/legacy.h"
#include "rendering/pipeline_state.h"
Expand Down
2 changes: 0 additions & 2 deletions framework/core/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include "rendering/render_frame.h"
#include "rendering/subpass.h"

VKBP_DISABLE_WARNINGS()
#include <glm/gtc/type_ptr.hpp>
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down
2 changes: 0 additions & 2 deletions framework/core/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

#include "device.h"

VKBP_DISABLE_WARNINGS()
#define VMA_IMPLEMENTATION
#include <vk_mem_alloc.h>
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down
4 changes: 1 addition & 3 deletions framework/debug_info.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2023, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -23,9 +23,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

#include "common/helpers.h"

Expand Down
6 changes: 2 additions & 4 deletions framework/geometry/frustum.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2022, Sascha Willems
/* Copyright (c) 2019-2024, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -21,9 +21,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand All @@ -38,7 +36,7 @@ enum Side
};

/**
* @brief Represents a matrix by extracting its planes. Responsible for doing
* @brief Represents a matrix by extracting its planes. Responsible for doing
* intersection tests
*/
class Frustum
Expand Down
4 changes: 1 addition & 3 deletions framework/glsl_compiler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2023, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -17,14 +17,12 @@

#include "glsl_compiler.h"

VKBP_DISABLE_WARNINGS()
#include <SPIRV/GLSL.std.450.h>
#include <SPIRV/GlslangToSpv.h>
#include <StandAlone/DirStackFileIncluder.h>
#include <glslang/Include/ShHandle.h>
#include <glslang/OSDependent/osinclude.h>
#include <glslang/Public/ResourceLimits.h>
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down
10 changes: 4 additions & 6 deletions framework/glsl_compiler.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2020, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -22,9 +22,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include <glslang/Public/ShaderLang.h>
VKBP_ENABLE_WARNINGS()

#include "common/vk_common.h"
#include "core/shader_module.h"
Expand Down Expand Up @@ -64,9 +62,9 @@ class GLSLCompiler
*/
bool compile_to_spirv(VkShaderStageFlagBits stage,
const std::vector<uint8_t> &glsl_source,
const std::string & entry_point,
const ShaderVariant & shader_variant,
const std::string &entry_point,
const ShaderVariant &shader_variant,
std::vector<std::uint32_t> &spirv,
std::string & info_log);
std::string &info_log);
};
} // namespace vkb
2 changes: 0 additions & 2 deletions framework/gltf_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
#include <glm/gtc/type_ptr.hpp>
VKBP_ENABLE_WARNINGS()

#include "api_vulkan_sample.h"
#include "common/utils.h"
Expand Down
2 changes: 0 additions & 2 deletions framework/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
#include <glm/gtc/matrix_transform.hpp>
VKBP_ENABLE_WARNINGS()

#include "buffer_pool.h"
#include "common/utils.h"
Expand Down
2 changes: 0 additions & 2 deletions framework/heightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

#include "filesystem/legacy.h"

Expand Down
2 changes: 0 additions & 2 deletions framework/platform/android/android_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include <fmt/format.h>
#include <imgui.h>
#include <jni.h>
#include <spdlog/sinks/android_sink.h>
#include <spdlog/sinks/basic_file_sink.h>
VKBP_ENABLE_WARNINGS()

#include "apps.h"
#include "common/strings.h"
Expand Down
2 changes: 0 additions & 2 deletions framework/platform/glfw_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h>
#include <fmt/format.h>
#include <spdlog/sinks/stdout_color_sinks.h>
VKBP_ENABLE_WARNINGS()

#include "core/util/logging.hpp"
#include "platform/platform.h"
Expand Down
10 changes: 4 additions & 6 deletions framework/rendering/subpass.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2021, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -26,9 +26,7 @@
#include "scene_graph/components/light.h"
#include "scene_graph/node.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

namespace vkb
{
Expand Down Expand Up @@ -141,8 +139,8 @@ class Subpass
void set_debug_name(const std::string &name);

/**
* @brief Prepares the lighting state to have its lights
*
* @brief Prepares the lighting state to have its lights
*
* @tparam A light structure that has 'directional_lights', 'point_lights' and 'spot_light' array fields defined.
* @param scene_lights All of the light components from the scene graph
* @param light_count The maximum amount of lights allowed for any given type of light.
Expand All @@ -160,7 +158,7 @@ class Subpass
for (auto &scene_light : scene_lights)
{
const auto &properties = scene_light->get_properties();
auto & transform = scene_light->get_node()->get_transform();
auto &transform = scene_light->get_node()->get_transform();

Light light{{transform.get_translation(), static_cast<float>(scene_light->get_light_type())},
{properties.color, properties.intensity},
Expand Down
4 changes: 1 addition & 3 deletions framework/rendering/subpasses/geometry_subpass.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2022, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,9 +19,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

#include "rendering/subpass.h"

Expand Down
4 changes: 1 addition & 3 deletions framework/rendering/subpasses/lighting_subpass.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2020, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,9 +20,7 @@
#include "buffer_pool.h"
#include "rendering/subpass.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

// This value is per type of light that we feed into the shader
#define MAX_DEFERRED_LIGHT_COUNT 32
Expand Down
4 changes: 1 addition & 3 deletions framework/scene_graph/components/aabb.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018-2019, Arm Limited and Contributors
/* Copyright (c) 2018-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -24,9 +24,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

#include "scene_graph/component.h"
#include "scene_graph/components/sub_mesh.h"
Expand Down
4 changes: 1 addition & 3 deletions framework/scene_graph/components/camera.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2020, Arm Limited and Contributors
/* Copyright (c) 2019-2024, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -24,9 +24,7 @@

#include "common/error.h"

VKBP_DISABLE_WARNINGS()
#include "common/glm_common.h"
VKBP_ENABLE_WARNINGS()

#include "common/helpers.h"
#include "scene_graph/component.h"
Expand Down
Loading
Loading