Skip to content

Commit 99bc87c

Browse files
committed
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.
1 parent 7951f57 commit 99bc87c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ConfigureChecks.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(NOT ${SIZEOF_LONGLONG} EQUAL 8)
2020
endif()
2121

2222
check_type_size("wchar_t" SIZEOF_WCHAR_T)
23-
if(${SIZEOF_WCHAR_T} LESS 2)
23+
if(NOT ${SIZEOF_WCHAR_T} GREATER 1)
2424
message(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
2525
endif()
2626

0 commit comments

Comments
 (0)