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,7 +53,9 @@ ...@@ -53,7 +53,9 @@
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)
SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND ${COMPILER} COMMAND ${COMPILER}
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
...@@ -61,15 +63,17 @@ FOREACH(file ${ABI_HEADERS}) ...@@ -61,15 +63,17 @@ FOREACH(file ${ABI_HEADERS})
${file} ${file}
ERROR_QUIET OUTPUT_FILE ${tmpfile}) ERROR_QUIET OUTPUT_FILE ${tmpfile})
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND sed -e COMMAND sed -e "/^# /d"
"/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d" -e "/^[ ]*$/d"
-e "/^#pragma GCC set_debug_pwd/d"
-e "/^#ident/d"
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile}) 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