[cmake, common] allow build with -fno-rtti and /GR-, to disable gen of rtti and save some bytes in vtables
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
bbcd8aded6
commit
26c2b084b4
4 changed files with 20 additions and 11 deletions
|
@ -95,6 +95,10 @@ if (MSVC)
|
|||
/wd4324 # 'struct_name': structure was padded due to __declspec(align())
|
||||
/wd4201 # nonstandard extension used : nameless struct/union
|
||||
/wd4702 # unreachable code (when used with LTO)
|
||||
|
||||
$<$<CONFIG:Release>:/GS-> # No stack buffer overflow checks
|
||||
/Gy # Enable function level linking
|
||||
/GR- # Disable run time type information
|
||||
)
|
||||
|
||||
if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
|
||||
|
@ -112,14 +116,13 @@ if (MSVC)
|
|||
add_compile_options(/QIntel-jcc-erratum)
|
||||
endif()
|
||||
|
||||
# /GS- - No stack buffer overflow checks
|
||||
add_compile_options("$<$<CONFIG:Release>:/GS->")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
|
||||
else()
|
||||
add_compile_options(
|
||||
-fwrapv
|
||||
-fno-rtti # Disable RTTI
|
||||
-pipe
|
||||
|
||||
-Werror=all
|
||||
-Werror=extra
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
/**
|
||||
* @returns A unique identifier for the Setting's internal data type.
|
||||
*/
|
||||
[[nodiscard]] virtual std::type_index TypeId() const = 0;
|
||||
[[nodiscard]] virtual std::string_view TypeId() const = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the Setting's internal data type is an enum.
|
||||
|
|
|
@ -215,8 +215,14 @@ public:
|
|||
*
|
||||
* @returns the type_index of the setting's type
|
||||
*/
|
||||
[[nodiscard]] std::type_index TypeId() const override final {
|
||||
return std::type_index(typeid(Type));
|
||||
[[nodiscard]] std::string_view TypeId() const override final {
|
||||
if constexpr (std::is_same_v<Type, std::string>) {
|
||||
return "string";
|
||||
} else if constexpr (std::is_same_v<Type, bool>) {
|
||||
return "bool";
|
||||
} else {
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr u32 EnumIndex() const override final {
|
||||
|
|
|
@ -511,9 +511,9 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
|
|||
}
|
||||
|
||||
const bool require_checkbox =
|
||||
other_setting != nullptr && other_setting->TypeId() == typeid(bool);
|
||||
other_setting != nullptr && other_setting->ToString() == "bool";
|
||||
|
||||
if (other_setting != nullptr && other_setting->TypeId() != typeid(bool)) {
|
||||
if (other_setting != nullptr && other_setting->TypeId() != "bool") {
|
||||
LOG_WARNING(
|
||||
Frontend,
|
||||
"Extra setting \"{}\" specified but is not bool, refusing to create checkbox for it.",
|
||||
|
@ -571,12 +571,12 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
|
|||
QWidget* lhs =
|
||||
CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
|
||||
layout->addWidget(lhs);
|
||||
} else if (setting.TypeId() != typeid(bool)) {
|
||||
} else if (setting.TypeId() != "bool") {
|
||||
QLabel* qt_label = CreateLabel(label);
|
||||
layout->addWidget(qt_label);
|
||||
}
|
||||
|
||||
if (setting.TypeId() == typeid(bool)) {
|
||||
if (setting.TypeId() == "bool") {
|
||||
data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch);
|
||||
} else if (setting.IsEnum()) {
|
||||
if (request == RequestType::RadioGroup) {
|
||||
|
@ -625,7 +625,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
|
|||
default:
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
} else if (type == typeid(std::string)) {
|
||||
} else if (type == "string") {
|
||||
switch (request) {
|
||||
case RequestType::Default:
|
||||
case RequestType::LineEdit:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue