mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 14:08:04 +00:00
Correctly configure NXT_ENABLE_ASSERTS on multiconfiguration generators (#88)
And also set a default build type for single-configuration generators
This commit is contained in:
@@ -68,7 +68,7 @@ void HandleAssertionFailure(const char* file, const char* function, int line, co
|
||||
#define NXT_ASSERT(condition) NXT_ASSERT_CALLSITE_HELPER(__FILE__, __func__, __LINE__, condition)
|
||||
#define NXT_UNREACHABLE() \
|
||||
do { \
|
||||
NXT_ASSERT(false && "Unreachable code hit"); NXT_BUILTIN_UNREACHABLE(); \
|
||||
NXT_ASSERT(NXT_ASSERT_LOOP_CONDITION && "Unreachable code hit"); NXT_BUILTIN_UNREACHABLE(); \
|
||||
} while(NXT_ASSERT_LOOP_CONDITION)
|
||||
|
||||
#if !defined(NXT_SKIP_ASSERT_SHORTHANDS)
|
||||
|
||||
@@ -62,7 +62,9 @@ void* AlignVoidPtr(void* ptr, size_t alignment) {
|
||||
}
|
||||
|
||||
uint32_t Align(uint32_t value, size_t alignment) {
|
||||
ASSERT(alignment <= UINT32_MAX);
|
||||
ASSERT(IsPowerOfTwo(alignment));
|
||||
ASSERT(alignment != 0);
|
||||
return (value + (alignment - 1)) & ~(alignment - 1);
|
||||
uint32_t alignment32 = static_cast<uint32_t>(alignment);
|
||||
return (value + (alignment32 - 1)) & ~(alignment32 - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user