From 99bc87ccff30a23e999d3505a13b43b902c52d18 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Sun, 24 Mar 2024 19:27:03 +0100 Subject: [PATCH] Fix WASM build by inverting wchar_t size check When building WASM with emscripten cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake ... all SIZEOF_ variables which should be defined in ConfigureChecks.cmake are empty and the wchar_t check fails with "LESS" "2", the other checks seem to pass since they start with NOT. Instead of explicitly skipping the check for "if(NOT EMSCRIPTEN)" as is done in vcpkg's disable-wchar-t-check-emscripten.patch, the check is inverted to start with NOT, so the build still has a chance to run for compilers which behave like emscripten. --- ConfigureChecks.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index f89f70d1..acffa3fb 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -20,7 +20,7 @@ if(NOT ${SIZEOF_LONGLONG} EQUAL 8) endif() check_type_size("wchar_t" SIZEOF_WCHAR_T) -if(${SIZEOF_WCHAR_T} LESS 2) +if(NOT ${SIZEOF_WCHAR_T} GREATER 1) message(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.") endif()