Browse Source

MSVC 17.8+ Fixes (#854)

* MSVC 17.8+ fixes

* copyright and clangformat

* d2d fixes

* update modules

* quality fixes

* fix broken copyright
pull/864/head
Tom Atkinson 2 years ago committed by GitHub
parent
commit
c09b646938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .gitmodules
  2. 5
      app/plugins/file_logger/file_logger.cpp
  3. 3
      components/core/CMakeLists.txt
  4. 2
      components/core/include/core/util/error.hpp
  5. 4
      framework/common/logging.h
  6. 2
      framework/common/strings.cpp
  7. 2
      framework/common/vk_common.cpp
  8. 2
      framework/platform/android/android_platform.cpp
  9. 3
      framework/platform/glfw_window.cpp
  10. 2
      framework/platform/platform.cpp
  11. 8
      framework/platform/plugins/plugin_base.h
  12. 3
      framework/platform/unix/direct_window.cpp
  13. 7
      framework/platform/unix/unix_d2d_platform.cpp
  14. 7
      framework/platform/unix/unix_platform.cpp
  15. 7
      framework/platform/windows/windows_platform.cpp
  16. 4
      samples/extensions/calibrated_timestamps/calibrated_timestamps.cpp
  17. 3
      scripts/clang_format.py
  18. 7
      third_party/CMakeLists.txt
  19. 1
      third_party/fmt
  20. 2
      third_party/spdlog

3
.gitmodules vendored

@ -56,3 +56,6 @@ @@ -56,3 +56,6 @@
[submodule "third_party/catch2"]
path = third_party/catch2
url = https://github.com/catchorg/Catch2.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://github.com/fmtlib/fmt

5
app/plugins/file_logger/file_logger.cpp

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/* Copyright (c) 2021, Arm Limited and Contributors
* Copyright (c) 2021, Sascha Willems
/* Copyright (c) 2021-2023, Arm Limited and Contributors
* Copyright (c) 2021-2023, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include "apps.h"
VKBP_DISABLE_WARNINGS()
#include <fmt/format.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()

3
components/core/CMakeLists.txt

@ -23,7 +23,8 @@ vkb__register_component( @@ -23,7 +23,8 @@ vkb__register_component(
SRC
src/strings.cpp
LINK_LIBS
spdlog::spdlog
spdlog
fmt
)
vkb__register_tests(

2
components/core/include/core/util/error.hpp

@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
VKBP_DISABLE_WARNINGS()
// TODO: replace with a direct fmt submodule
#include <spdlog/fmt/fmt.h>
#include <fmt/format.h>
VKBP_ENABLE_WARNINGS()
#include <stdexcept>

4
framework/common/logging.h

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/* Copyright (c) 2018-2021, Arm Limited and Contributors
/* Copyright (c) 2018-2023, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
#pragma once
#include <spdlog/fmt/fmt.h>
#include <fmt/format.h>
#include <spdlog/spdlog.h>
#define LOGGER_FORMAT "[%^%l%$] %v"

2
framework/common/strings.cpp

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
#include "strings.h"
#include <spdlog/fmt/fmt.h>
#include <fmt/format.h>
#include "core/shader_module.h"
#include "scene_graph/components/material.h"

2
framework/common/vk_common.cpp

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
#include "vk_common.h"
#include <spdlog/fmt/fmt.h>
#include <fmt/format.h>
#include "glsl_compiler.h"
#include "platform/filesystem.h"

2
framework/platform/android/android_platform.cpp

@ -26,11 +26,11 @@ @@ -26,11 +26,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>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()
#include "apps.h"

3
framework/platform/glfw_window.cpp

@ -25,10 +25,11 @@ VKBP_DISABLE_WARNINGS() @@ -25,10 +25,11 @@ 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>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()
#include "common/logging.h"
#include "platform/platform.h"
namespace vkb

2
framework/platform/platform.cpp

@ -22,11 +22,11 @@ @@ -22,11 +22,11 @@
#include <mutex>
#include <vector>
#include <fmt/format.h>
#include <spdlog/async_logger.h>
#include <spdlog/details/thread_pool.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include "common/logging.h"
#include "force_close/force_close.h"

8
framework/platform/plugins/plugin_base.h

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/* Copyright (c) 2020-2021, Arm Limited and Contributors
/* Copyright (c) 2020-2023, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
#pragma once
#include <spdlog/fmt/fmt.h>
#include <fmt/format.h>
#include "common/tags.h"
#include "platform/parser.h"
@ -27,7 +27,7 @@ namespace vkb @@ -27,7 +27,7 @@ namespace vkb
{
/**
* @brief PluginBase is the base class that plugins inherit from. The class enforces the use of tags when creating new plugins.
* For method information see Plugin
* For method information see Plugin
*/
template <typename... TAGS>
class PluginBase : public Plugin, public Tag<TAGS...>
@ -38,7 +38,7 @@ class PluginBase : public Plugin, public Tag<TAGS...> @@ -38,7 +38,7 @@ class PluginBase : public Plugin, public Tag<TAGS...>
virtual ~PluginBase() = default;
virtual const std::vector<Command *> &get_cli_commands() const override;
virtual const std::vector<Hook> & get_hooks() const override;
virtual const std::vector<Hook> &get_hooks() const override;
virtual bool has_tag(TagID id) const override;
// hooks that can be implemented by plugins

3
framework/platform/unix/direct_window.cpp

@ -17,6 +17,9 @@ @@ -17,6 +17,9 @@
#include "direct_window.h"
#include <fcntl.h>
#include <sys/stat.h>
#include "core/instance.h"
#include "platform/headless_window.h"

7
framework/platform/unix/unix_d2d_platform.cpp

@ -17,13 +17,6 @@ @@ -17,13 +17,6 @@
#include "unix_d2d_platform.h"
#include "common/error.h"
VKBP_DISABLE_WARNINGS()
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()
#include "platform/headless_window.h"
#include "platform/unix/direct_window.h"

7
framework/platform/unix/unix_platform.cpp

@ -17,16 +17,9 @@ @@ -17,16 +17,9 @@
#include "unix_platform.h"
#include "common/error.h"
#include "platform/glfw_window.h"
#include "platform/headless_window.h"
VKBP_DISABLE_WARNINGS()
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()
#ifndef VK_MVK_MACOS_SURFACE_EXTENSION_NAME
# define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
#endif

7
framework/platform/windows/windows_platform.cpp

@ -22,16 +22,9 @@ @@ -22,16 +22,9 @@
#include <shellapi.h>
#include <stdexcept>
#include "common/error.h"
#include "platform/glfw_window.h"
#include "platform/headless_window.h"
VKBP_DISABLE_WARNINGS()
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
VKBP_ENABLE_WARNINGS()
namespace vkb
{
namespace

4
samples/extensions/calibrated_timestamps/calibrated_timestamps.cpp

@ -863,7 +863,7 @@ void CalibratedTimestamps::timestamps_end(const std::string &input_tag) @@ -863,7 +863,7 @@ void CalibratedTimestamps::timestamps_end(const std::string &input_tag)
{
if (delta_timestamps.empty())
{
LOGE("Timestamps begin-to-end Fatal Error: Timestamps end is not tagged the same as its begin!\n")
LOGE("Timestamps begin-to-end Fatal Error: Timestamps end is not tagged the same as its begin!")
return; // exits the function here, further calculation is meaningless
}
@ -880,7 +880,7 @@ void CalibratedTimestamps::timestamps_end(const std::string &input_tag) @@ -880,7 +880,7 @@ void CalibratedTimestamps::timestamps_end(const std::string &input_tag)
LOGE("timestamps_end called without a found corresponding begin timestamp for {}.", input_tag.c_str())
return;
}
LOGE("get_timestamps failed with %d", result)
LOGE("get_timestamps failed with {}", vkb::to_string(result))
}
void CalibratedTimestamps::on_update_ui_overlay(vkb::Drawer &drawer)

3
scripts/clang_format.py

@ -77,7 +77,8 @@ if __name__ == "__main__": @@ -77,7 +77,8 @@ if __name__ == "__main__":
print()
for f in files:
check_output(["clang-format", "-i", f])
if os.path.isfile(f):
check_output(["clang-format", "-i", f])
else:
print(terminal_colors.INFO + "No files to format" + terminal_colors.END)

7
third_party/CMakeLists.txt vendored

@ -335,9 +335,14 @@ if(NOT ANDROID) @@ -335,9 +335,14 @@ if(NOT ANDROID)
endif()
endif()
# fmt
add_subdirectory(fmt)
set_property(TARGET fmt PROPERTY FOLDER "ThirdParty")
# spdlog
set(SPDLOG_FMT_EXTERNAL ON)
add_subdirectory(spdlog)
set_property(TARGET spdlog_headers_for_ide PROPERTY FOLDER "ThirdParty")
set_property(TARGET spdlog PROPERTY FOLDER "ThirdParty")
# ctpl
add_library(ctpl INTERFACE)

1
third_party/fmt vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit dd6f657a79104101a2e4ea6ba90f69e0dc114822

2
third_party/spdlog vendored

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 7bf8f148795d2571b4ae4aa9c6d2a8111fbb7077
Subproject commit 7e635fca68d014934b4af8a1cf874f63989352b7
Loading…
Cancel
Save