diff --git a/CMakeLists.txt b/CMakeLists.txt index 438e6229a4..c496ad97b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,14 +220,17 @@ if(HAVE_STRCASECMP) add_definitions(-DHAVE_STRCASECMP) endif() -check_function_exists(strlcat HAVE_STRLCAT) -if(HAVE_STRLCAT) - add_definitions(-DHAVE_STRLCAT) -endif() +# Emscripten's strlcat and strlcpy triggers ASAN errors +if(NOT EMSCRIPTEN) + check_function_exists(strlcat HAVE_STRLCAT) + if(HAVE_STRLCAT) + add_definitions(-DHAVE_STRLCAT) + endif() -check_function_exists(strlcpy HAVE_STRLCPY) -if(HAVE_STRLCPY) - add_definitions(-DHAVE_STRLCPY) + check_function_exists(strlcpy HAVE_STRLCPY) + if(HAVE_STRLCPY) + add_definitions(-DHAVE_STRLCPY) + endif() endif() check_function_exists(strndup HAVE_STRNDUP)