diff options
| -rw-r--r-- | src/common/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | src/common/settings.cpp | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/yuzu/uisettings.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 2 |
6 files changed, 22 insertions, 3 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 09e7e673e..cf05ae364 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -197,10 +197,15 @@ if (MSVC) | |||
| 197 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data | 197 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data |
| 198 | /we4800 # Implicit conversion from 'type' to bool. Possible information loss | 198 | /we4800 # Implicit conversion from 'type' to bool. Possible information loss |
| 199 | ) | 199 | ) |
| 200 | else() | 200 | endif() |
| 201 | |||
| 202 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
| 201 | target_compile_options(common PRIVATE | 203 | target_compile_options(common PRIVATE |
| 202 | $<$<CXX_COMPILER_ID:Clang>:-fsized-deallocation> | 204 | -fsized-deallocation |
| 203 | $<$<CXX_COMPILER_ID:Clang>:-Werror=unreachable-code-aggressive> | 205 | -Werror=unreachable-code-aggressive |
| 206 | ) | ||
| 207 | target_compile_definitions(common PRIVATE | ||
| 208 | $<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,15>:_CANNOT_EXPLICITLY_INSTANTIATE> | ||
| 204 | ) | 209 | ) |
| 205 | endif() | 210 | endif() |
| 206 | 211 | ||
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index a1cc76a38..f4eb2d2fb 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | namespace Settings { | 26 | namespace Settings { |
| 27 | 27 | ||
| 28 | #ifndef _CANNOT_EXPLICITLY_INSTANTIATE | ||
| 28 | #define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED> | 29 | #define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED> |
| 29 | #define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED> | 30 | #define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED> |
| 30 | 31 | ||
| @@ -61,6 +62,7 @@ SWITCHABLE(u8, true); | |||
| 61 | 62 | ||
| 62 | #undef SETTING | 63 | #undef SETTING |
| 63 | #undef SWITCHABLE | 64 | #undef SWITCHABLE |
| 65 | #endif | ||
| 64 | 66 | ||
| 65 | Values values; | 67 | Values values; |
| 66 | 68 | ||
diff --git a/src/common/settings.h b/src/common/settings.h index e510036b4..35fa4cf3d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -45,6 +45,7 @@ struct ResolutionScalingInfo { | |||
| 45 | } | 45 | } |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | #ifndef _CANNOT_EXPLICITLY_INSTANTIATE | ||
| 48 | // Instantiate the classes elsewhere (settings.cpp) to reduce compiler/linker work | 49 | // Instantiate the classes elsewhere (settings.cpp) to reduce compiler/linker work |
| 49 | #define SETTING(TYPE, RANGED) extern template class Setting<TYPE, RANGED> | 50 | #define SETTING(TYPE, RANGED) extern template class Setting<TYPE, RANGED> |
| 50 | #define SWITCHABLE(TYPE, RANGED) extern template class SwitchableSetting<TYPE, RANGED> | 51 | #define SWITCHABLE(TYPE, RANGED) extern template class SwitchableSetting<TYPE, RANGED> |
| @@ -84,6 +85,7 @@ SWITCHABLE(u8, true); | |||
| 84 | 85 | ||
| 85 | #undef SETTING | 86 | #undef SETTING |
| 86 | #undef SWITCHABLE | 87 | #undef SWITCHABLE |
| 88 | #endif | ||
| 87 | 89 | ||
| 88 | /** | 90 | /** |
| 89 | * The InputSetting class allows for getting a reference to either the global or custom members. | 91 | * The InputSetting class allows for getting a reference to either the global or custom members. |
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) | |||
| 235 | target_compile_definitions(yuzu PRIVATE -DYUZU_DBGHELP) | 235 | target_compile_definitions(yuzu PRIVATE -DYUZU_DBGHELP) |
| 236 | endif() | 236 | endif() |
| 237 | 237 | ||
| 238 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
| 239 | target_compile_definitions(yuzu PRIVATE | ||
| 240 | $<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,15>:_CANNOT_EXPLICITLY_INSTANTIATE> | ||
| 241 | ) | ||
| 242 | endif() | ||
| 243 | |||
| 238 | file(GLOB COMPAT_LIST | 244 | file(GLOB COMPAT_LIST |
| 239 | ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc | 245 | ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc |
| 240 | ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json) | 246 | ${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 @@ | |||
| 3 | 3 | ||
| 4 | #include "yuzu/uisettings.h" | 4 | #include "yuzu/uisettings.h" |
| 5 | 5 | ||
| 6 | #ifndef _CANNOT_EXPLICITLY_INSTANTIATE | ||
| 6 | namespace Settings { | 7 | namespace Settings { |
| 7 | template class Setting<bool>; | 8 | template class Setting<bool>; |
| 8 | template class Setting<std::string>; | 9 | template class Setting<std::string>; |
| @@ -12,6 +13,7 @@ template class Setting<u8, true>; | |||
| 12 | template class Setting<u8>; | 13 | template class Setting<u8>; |
| 13 | template class Setting<unsigned long long>; | 14 | template class Setting<unsigned long long>; |
| 14 | } // namespace Settings | 15 | } // namespace Settings |
| 16 | #endif | ||
| 15 | 17 | ||
| 16 | namespace UISettings { | 18 | namespace UISettings { |
| 17 | 19 | ||
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 @@ | |||
| 17 | using Settings::Category; | 17 | using Settings::Category; |
| 18 | using Settings::Setting; | 18 | using Settings::Setting; |
| 19 | 19 | ||
| 20 | #ifndef _CANNOT_EXPLICITLY_INSTANTIATE | ||
| 20 | namespace Settings { | 21 | namespace Settings { |
| 21 | extern template class Setting<bool>; | 22 | extern template class Setting<bool>; |
| 22 | extern template class Setting<std::string>; | 23 | extern template class Setting<std::string>; |
| @@ -26,6 +27,7 @@ extern template class Setting<u8, true>; | |||
| 26 | extern template class Setting<u8>; | 27 | extern template class Setting<u8>; |
| 27 | extern template class Setting<unsigned long long>; | 28 | extern template class Setting<unsigned long long>; |
| 28 | } // namespace Settings | 29 | } // namespace Settings |
| 30 | #endif | ||
| 29 | 31 | ||
| 30 | namespace UISettings { | 32 | namespace UISettings { |
| 31 | 33 | ||