From 8d4f0014c9be0ecf2f12afa11185bd33fd08e108 Mon Sep 17 00:00:00 2001 From: Peter Harris <peter.harris@arm.com> Date: Thu, 16 Jan 2025 22:39:53 +0000 Subject: [PATCH] Fix test build --- Source/CMakeLists.txt | 13 ++++++++++--- Source/astcenc_internal.h | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9cd22684..7a430f07 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -105,10 +105,17 @@ if(${ASTCENC_UNITTEST}) set(CMAKE_OSX_ARCHITECTURES x86_64;arm64) add_subdirectory(GoogleTest) - # Workaround Google Test issue + # Workaround GoogleTest CRT selection issue issue # See https://github.com/google/googletest/issues/4067 - set_property(TARGET gtest PROPERTY MSVC_RUNTIME_LIBRARY "-MT") - set_property(TARGET gtest_main PROPERTY MSVC_RUNTIME_LIBRARY "-MT") + set_property( + TARGET gtest + PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") + + set_property( + TARGET gtest_main + PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") enable_testing() add_subdirectory(UnitTest) diff --git a/Source/astcenc_internal.h b/Source/astcenc_internal.h index df6e07f9..0b1d9450 100644 --- a/Source/astcenc_internal.h +++ b/Source/astcenc_internal.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2024 Arm Limited +// Copyright 2011-2025 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -257,6 +257,7 @@ static inline unsigned int get_quant_level(quant_method method) case QUANT_160: return 160; case QUANT_192: return 192; case QUANT_256: return 256; + default: break; } // Unreachable - the enum is fully described