|
|
@ -137,10 +137,19 @@ ${CMAKE_MODULE_PATH}
|
|
|
|
# generates compile_commands.json, used for autocompletion by some editors
|
|
|
|
# generates compile_commands.json, used for autocompletion by some editors
|
|
|
|
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
|
|
|
|
|
|
|
include(CheckIncludeFileCXX)
|
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
CHECK_INCLUDE_FILE_CXX("cuchar" HAVE_CUCHAR)
|
|
|
|
CHECK_CXX_SOURCE_COMPILES("
|
|
|
|
if(HAVE_CUCHAR)
|
|
|
|
#include <cstdlib>
|
|
|
|
add_definitions("-DHAVE_CUCHAR")
|
|
|
|
#include <cuchar>
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
|
|
|
|
char32_t in = 0;
|
|
|
|
|
|
|
|
char out[MB_CUR_MAX];
|
|
|
|
|
|
|
|
std::mbstate_t state{};
|
|
|
|
|
|
|
|
std::c32rtomb(out, in, &state);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}" HAVE_CUCHAR2)
|
|
|
|
|
|
|
|
if(HAVE_CUCHAR2)
|
|
|
|
|
|
|
|
add_definitions("-DHAVE_CUCHAR")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# mixing the build system with the source code is ugly and stupid. enforce the opposite :)
|
|
|
|
# mixing the build system with the source code is ugly and stupid. enforce the opposite :)
|
|
|
|