Commit a8d7a000 authored by Tor Didriksen's avatar Tor Didriksen

Bug #58372 cmake should not write temporary files in the source directory


cmake/do_abi_check.cmake:
  Put temporary files in ${BINARY_DIR} rather than in source directory.
  Slight reformatting for readability of commands.
parent e569efd1
...@@ -53,23 +53,27 @@ ...@@ -53,23 +53,27 @@
SET(abi_check_out ${BINARY_DIR}/abi_check.out) SET(abi_check_out ${BINARY_DIR}/abi_check.out)
FOREACH(file ${ABI_HEADERS}) FOREACH(file ${ABI_HEADERS})
SET(tmpfile ${file}.pp.tmp) GET_FILENAME_COMPONENT(header_basename ${file} NAME)
EXECUTE_PROCESS( SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
COMMAND ${COMPILER}
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include EXECUTE_PROCESS(
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql COMMAND ${COMPILER}
${file} -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
ERROR_QUIET OUTPUT_FILE ${tmpfile}) -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
EXECUTE_PROCESS( ${file}
COMMAND sed -e ERROR_QUIET OUTPUT_FILE ${tmpfile})
"/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d" EXECUTE_PROCESS(
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile}) COMMAND sed -e "/^# /d"
-e "/^[ ]*$/d"
-e "/^#pragma GCC set_debug_pwd/d"
-e "/^#ident/d"
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
IF(NOT ${result} EQUAL 0) IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR "sed returned error ${result}") MESSAGE(FATAL_ERROR "sed returned error ${result}")
ENDIF() ENDIF()
FILE(REMOVE ${tmpfile}) FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE EXECUTE_PROCESS(
result) COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0) IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR MESSAGE(FATAL_ERROR
"ABI check found difference between ${file}.pp and ${abi_check_out}") "ABI check found difference between ${file}.pp and ${abi_check_out}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment