mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
1086016477
- Simplify error checking when using execute_process. - Set BUILD_SHARED_LIBS to OFF when building dependencies. This is normally not needed, but msgpack interprets an unset BUILD_SHARED_LIBS to build a shared library, which is the opposite of the cmake behavior. - Move function check_lua_module to Util.cmake. - Remove unnecessary code. - Make variable naming more consistent
22 lines
701 B
CMake
22 lines
701 B
CMake
string(TOUPPER ${INPUT_ENC} upperInputEnc)
|
|
string(TOLOWER ${INPUT_ENC} lowerInputEnc)
|
|
get_filename_component(inputName ${INPUT_FILE} NAME)
|
|
execute_process(
|
|
COMMAND ${ICONV_PRG} -f ${INPUT_ENC} -t ${OUTPUT_ENC} ${INPUT_FILE}
|
|
OUTPUT_VARIABLE trans
|
|
ERROR_VARIABLE err
|
|
RESULT_VARIABLE res)
|
|
if(res)
|
|
message(FATAL_ERROR "iconv failed to run correctly: ${err}")
|
|
endif()
|
|
|
|
string(REPLACE "charset=${lowerInputEnc}" "charset=${OUTPUT_CHARSET}"
|
|
trans "${trans}")
|
|
string(REPLACE "charset=${upperInputEnc}" "charset=${OUTPUT_CHARSET}"
|
|
trans "${trans}")
|
|
string(REPLACE "# Original translations"
|
|
"# Generated from ${inputName}, DO NOT EDIT"
|
|
trans "${trans}")
|
|
|
|
file(WRITE ${OUTPUT_FILE} "${trans}")
|