mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
cmake: Only check mbrtowc on Apple
The only thing we know ever triggered this is old macOS versions, there's no need to use it for everyone else. Since this uses try_run it breaks when cross-compiling, which shouldn't be a common thing on macOS. Fixes #7737
This commit is contained in:
parent
2cf5fd3d5d
commit
9b763581cf
1 changed files with 9 additions and 6 deletions
|
@ -227,10 +227,13 @@ IF (NOT LIBATOMIC_NOT_NEEDED)
|
|||
set(ATOMIC_LIBRARY "atomic")
|
||||
endif()
|
||||
|
||||
# Check if mbrtowc implementation attempts to encode invalid UTF-8 sequences
|
||||
# Known culprits: at least some versions of macOS (confirmed Snow Leopard and Yosemite)
|
||||
try_run(mbrtowc_invalid_utf8_exit mbrtowc_invalid_utf8_compiles ${CMAKE_CURRENT_BINARY_DIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/checks/mbrtowc_invalid_utf8.cpp")
|
||||
IF ("${mbrtowc_invalid_utf8_compiles}" AND ("${mbrtowc_invalid_utf8_exit}" EQUAL 1))
|
||||
SET(HAVE_BROKEN_MBRTOWC_UTF8 1)
|
||||
IF (APPLE)
|
||||
# Check if mbrtowc implementation attempts to encode invalid UTF-8 sequences
|
||||
# Known culprits: at least some versions of macOS (confirmed Snow Leopard and Yosemite)
|
||||
try_run(mbrtowc_invalid_utf8_exit mbrtowc_invalid_utf8_compiles ${CMAKE_CURRENT_BINARY_DIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/checks/mbrtowc_invalid_utf8.cpp")
|
||||
IF ("${mbrtowc_invalid_utf8_compiles}" AND ("${mbrtowc_invalid_utf8_exit}" EQUAL 1))
|
||||
SET(HAVE_BROKEN_MBRTOWC_UTF8 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
|
Loading…
Reference in a new issue