From 37bc5118ea8f5891741faba8963ce9ae5f88e946 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 22 Nov 2022 18:38:23 -0500 Subject: CMake: Use precompiled headers --- src/common/CMakeLists.txt | 6 ++++++ src/common/precompiled_headers.h | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/common/precompiled_headers.h (limited to 'src/common') diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b7c15c191..25fe5f56f 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -95,6 +95,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 +184,8 @@ else() target_link_libraries(common PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) endif() + +if (YUZU_USE_PRECOMPILED_HEADERS) + target_precompile_headers(common PRIVATE precompiled_headers.h) + set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) +endif() diff --git a/src/common/precompiled_headers.h b/src/common/precompiled_headers.h new file mode 100644 index 000000000..5f81bef98 --- /dev/null +++ b/src/common/precompiled_headers.h @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include + +#include + +#include "common/assert.h" -- cgit v1.2.3 From 3c39c0ac3e710df45af1f812a9015378b2d7ada4 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 29 Nov 2022 23:03:30 -0500 Subject: string_util: Fix Mingw compile error Co-Authored-By: liamwhite <9658600+liamwhite@users.noreply.github.com> --- src/common/string_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') 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(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(input.size()), nullptr, 0, nullptr, nullptr); if (size == 0) { - return ""; + return {}; } std::string output(size, '\0'); -- cgit v1.2.3 From 5b5612c1cc1ef7a4888e7c45e41b15433127a2e5 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 29 Nov 2022 23:22:03 -0500 Subject: CMake: Consolidate common PCH headers --- src/common/CMakeLists.txt | 2 +- src/common/common_precompiled_headers.h | 14 ++++++++++++++ src/common/precompiled_headers.h | 8 +------- 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 src/common/common_precompiled_headers.h (limited to 'src/common') diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 25fe5f56f..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 @@ -187,5 +188,4 @@ endif() if (YUZU_USE_PRECOMPILED_HEADERS) target_precompile_headers(common PRIVATE precompiled_headers.h) - set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) 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 +#include +#include +#include + +#include + +#include "common/assert.h" +#include "common/common_types.h" diff --git a/src/common/precompiled_headers.h b/src/common/precompiled_headers.h index 5f81bef98..aabae730b 100644 --- a/src/common/precompiled_headers.h +++ b/src/common/precompiled_headers.h @@ -3,10 +3,4 @@ #pragma once -#include -#include -#include - -#include - -#include "common/assert.h" +#include "common/common_precompiled_headers.h" -- cgit v1.2.3