From 3f0cc544cf7184adacec22aedd81f6d796bbea31 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 18 Jun 2023 19:57:14 -0400 Subject: common,yuzu-qt: Avoid explicit instantiation on old clang Clang versions < 15 have compile issues with explicit instantiation. Disable it for these versions. --- src/yuzu/CMakeLists.txt | 6 ++++++ src/yuzu/uisettings.cpp | 2 ++ src/yuzu/uisettings.h | 2 ++ 3 files changed, 10 insertions(+) (limited to 'src/yuzu') diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 899b75871..5183aabdf 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -235,6 +235,12 @@ if (WIN32 AND YUZU_CRASH_DUMPS) target_compile_definitions(yuzu PRIVATE -DYUZU_DBGHELP) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_definitions(yuzu PRIVATE + $<$,15>:_CANNOT_EXPLICITLY_INSTANTIATE> + ) +endif() + file(GLOB COMPAT_LIST ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json) diff --git a/src/yuzu/uisettings.cpp b/src/yuzu/uisettings.cpp index 2a02a27bc..41e2493b3 100644 --- a/src/yuzu/uisettings.cpp +++ b/src/yuzu/uisettings.cpp @@ -3,6 +3,7 @@ #include "yuzu/uisettings.h" +#ifndef _CANNOT_EXPLICITLY_INSTANTIATE namespace Settings { template class Setting; template class Setting; @@ -12,6 +13,7 @@ template class Setting; template class Setting; template class Setting; } // namespace Settings +#endif namespace UISettings { diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 2152b0b3b..08049f9c4 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -17,6 +17,7 @@ using Settings::Category; using Settings::Setting; +#ifndef _CANNOT_EXPLICITLY_INSTANTIATE namespace Settings { extern template class Setting; extern template class Setting; @@ -26,6 +27,7 @@ extern template class Setting; extern template class Setting; extern template class Setting; } // namespace Settings +#endif namespace UISettings { -- cgit v1.2.3