build-macos: fix C++20 compatibility for Clang13.1
Fixes compilation on Clang13.1 by backporting some C++20 features that aren't available in Clang and fixing the CMake config. Note that this doesn't yet properly package the app nor does anything work at this point. jthread, stop_token, and condition_variable_any impls taken from josuttis/jthread and appleCompat.h taken from Citra and modified by me.
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
#include <bit>
|
||||
#include <memory>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "common/apple_compat/appleCompat.h"
|
||||
#endif
|
||||
#include "common/common_types.h"
|
||||
#include "shader_recompiler/exception.h"
|
||||
#include "shader_recompiler/frontend/maxwell/decode.h"
|
||||
@@ -63,9 +66,16 @@ constexpr std::array UNORDERED_ENCODINGS{
|
||||
|
||||
constexpr auto SortedEncodings() {
|
||||
std::array encodings{UNORDERED_ENCODINGS};
|
||||
#ifdef __APPLE__
|
||||
std::sort(encodings.begin(), encodings.end(),
|
||||
[](const InstEncoding& lhs, const InstEncoding& rhs) {
|
||||
return std::popcount(lhs.mask_value.mask) > std::popcount(rhs.mask_value.mask);
|
||||
});
|
||||
#else
|
||||
std::ranges::sort(encodings, [](const InstEncoding& lhs, const InstEncoding& rhs) {
|
||||
return std::popcount(lhs.mask_value.mask) > std::popcount(rhs.mask_value.mask);
|
||||
});
|
||||
#endif
|
||||
return encodings;
|
||||
}
|
||||
constexpr auto ENCODINGS{SortedEncodings()};
|
||||
|
||||
Reference in New Issue
Block a user