fix build for cross compilation clang

This commit is contained in:
mat 2023-02-17 15:41:10 -03:00 committed by GitHub
parent b78ce23d1e
commit 54e082e8d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 15 deletions
CMakeLists.txt
loader
include/Geode/loader
src/loader

View file

@ -54,6 +54,12 @@ include(cmake/GeodeFile.cmake)
include(cmake/Platform.cmake)
include(cmake/CPM.cmake)
# this is needed for cross compilation on linux,
# since fmtlib will fail to compile otherwise
if (GEODE_DISABLE_FMT_CONSTEVAL)
target_compile_definitions(${PROJECT_NAME} INTERFACE -DFMT_CONSTEVAL=)
endif()
CPMAddPackage("gh:geode-sdk/json#2b76460")
CPMAddPackage("gh:fmtlib/fmt#9.1.0")
CPMAddPackage("gh:gulrak/filesystem#3e5b930")

View file

@ -219,9 +219,9 @@ namespace geode {
using ColorAlphaSettingValue = GeodeSettingValue<ColorAlphaSetting>;
template<class T>
struct SettingValueSetter {
static GEODE_DLL T get(SettingValue* setting);
static GEODE_DLL void set(SettingValue* setting, T const& value);
struct GEODE_DLL SettingValueSetter {
static T get(SettingValue* setting);
static void set(SettingValue* setting, T const& value);
};
}

View file

@ -275,18 +275,6 @@ std::string SettingValue::getKey() const {
typename type_##Setting::ValueType const& value \
) const
// instantiate value setters
namespace geode {
template struct SettingValueSetter<typename BoolSetting::ValueType>;
template struct SettingValueSetter<typename IntSetting::ValueType>;
template struct SettingValueSetter<typename FloatSetting::ValueType>;
template struct SettingValueSetter<typename StringSetting::ValueType>;
template struct SettingValueSetter<typename FileSetting::ValueType>;
template struct SettingValueSetter<typename ColorSetting::ValueType>;
template struct SettingValueSetter<typename ColorAlphaSetting::ValueType>;
}
// instantiate values
namespace geode {
@ -370,6 +358,18 @@ IMPL_NODE_AND_SETTERS(File);
IMPL_NODE_AND_SETTERS(Color);
IMPL_NODE_AND_SETTERS(ColorAlpha);
// instantiate value setters
namespace geode {
template struct SettingValueSetter<typename BoolSetting::ValueType>;
template struct SettingValueSetter<typename IntSetting::ValueType>;
template struct SettingValueSetter<typename FloatSetting::ValueType>;
template struct SettingValueSetter<typename StringSetting::ValueType>;
template struct SettingValueSetter<typename FileSetting::ValueType>;
template struct SettingValueSetter<typename ColorSetting::ValueType>;
template struct SettingValueSetter<typename ColorAlphaSetting::ValueType>;
}
// SettingChangedEvent
SettingChangedEvent::SettingChangedEvent(Mod* mod, SettingValue* value)