diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca26bc3b5bb..a659ebb5eb3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,23 +29,22 @@ if(OSSIA_QT) find_package(${QT_VERSION} QUIET ${OSSIA_QT_REQUIRED} COMPONENTS Quick) endif() - if(TARGET Qt${QT_VERSION_MAJOR}::Core) + if(TARGET "Qt${QT_VERSION_MAJOR}::Core") set(OSSIA_QT ON) else() set(OSSIA_QT OFF) endif() - if(TARGET Qt${QT_VERSION_MAJOR}::Qml) + if(TARGET "Qt${QT_VERSION_MAJOR}::Qml") set(OSSIA_QML ON) else() set(OSSIA_QML OFF) endif() - if(NOT TARGET Qt${QT_VERSION_MAJOR}::Core) + if(NOT TARGET "Qt${QT_VERSION_MAJOR}::Core") set(OSSIA_QML_DEVICE OFF) endif() if(NOT DEFINED OSSIA_QML_DEVICE) set(OSSIA_QML_DEVICE 1) endif() - endif() ### Library ### diff --git a/src/ossia/detail/algorithms.hpp b/src/ossia/detail/algorithms.hpp index a69b0735a6d..cce292ffa06 100644 --- a/src/ossia/detail/algorithms.hpp +++ b/src/ossia/detail/algorithms.hpp @@ -37,8 +37,16 @@ auto find_if(Vector&& v, Fun fun) template auto* ptr_find(Vector&& v, const Value& val) noexcept { - auto it = std::find(std::begin(v), std::end(v), val); - return it != std::end(v) ? &*it : nullptr; + if constexpr(requires { v.find(val) != v.end(); }) + { + auto it = v.find(val); + return it != v.end() ? &it->second : nullptr; + } + else + { + auto it = std::find(std::begin(v), std::end(v), val); + return it != std::end(v) ? &*it : nullptr; + } } template diff --git a/src/ossia/detail/config.hpp b/src/ossia/detail/config.hpp index 184a4eeec0a..01391fa76fb 100644 --- a/src/ossia/detail/config.hpp +++ b/src/ossia/detail/config.hpp @@ -97,7 +97,8 @@ #if defined(RAPIDJSON_PARSE_DEFAULT_FLAGS) #error Include to use JSON #endif -#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNanAndInfFlag +#define RAPIDJSON_PARSE_DEFAULT_FLAGS \ + kParseCommentsFlag | kParseTrailingCommasFlag | kParseNanAndInfFlag #if !defined(BOOST_MATH_DISABLE_FLOAT128) #define BOOST_MATH_DISABLE_FLOAT128