summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt6
-rw-r--r--src/common/common_precompiled_headers.h14
-rw-r--r--src/common/precompiled_headers.h6
-rw-r--r--src/common/string_util.cpp4
4 files changed, 28 insertions, 2 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index b7c15c191..a12edc584 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -37,6 +37,7 @@ add_library(common STATIC
cache_management.cpp
cache_management.h
common_funcs.h
+ common_precompiled_headers.h
common_types.h
concepts.h
div_ceil.h
@@ -95,6 +96,7 @@ add_library(common STATIC
param_package.h
parent_of_member.h
point.h
+ precompiled_headers.h
quaternion.h
reader_writer_queue.h
ring_buffer.h
@@ -183,3 +185,7 @@ else()
target_link_libraries(common PRIVATE
$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
endif()
+
+if (YUZU_USE_PRECOMPILED_HEADERS)
+ target_precompile_headers(common PRIVATE precompiled_headers.h)
+endif()
diff --git a/src/common/common_precompiled_headers.h b/src/common/common_precompiled_headers.h
new file mode 100644
index 000000000..be7e5b5f9
--- /dev/null
+++ b/src/common/common_precompiled_headers.h
@@ -0,0 +1,14 @@
+// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <algorithm>
+#include <array>
+#include <chrono>
+#include <memory>
+
+#include <fmt/format.h>
+
+#include "common/assert.h"
+#include "common/common_types.h"
diff --git a/src/common/precompiled_headers.h b/src/common/precompiled_headers.h
new file mode 100644
index 000000000..aabae730b
--- /dev/null
+++ b/src/common/precompiled_headers.h
@@ -0,0 +1,6 @@
+// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "common/common_precompiled_headers.h"
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 7a495bc79..b26db4796 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -141,7 +141,7 @@ static std::wstring CPToUTF16(u32 code_page, const std::string& input) {
MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
if (size == 0) {
- return L"";
+ return {};
}
std::wstring output(size, L'\0');
@@ -158,7 +158,7 @@ std::string UTF16ToUTF8(const std::wstring& input) {
const auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()),
nullptr, 0, nullptr, nullptr);
if (size == 0) {
- return "";
+ return {};
}
std::string output(size, '\0');