mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Bug #58372 cmake should not write temporary files in the source directory
This commit is contained in:
parent
54dd014a13
commit
229da09502
1 changed files with 17 additions and 13 deletions
|
@ -53,23 +53,27 @@
|
|||
SET(abi_check_out ${BINARY_DIR}/abi_check.out)
|
||||
|
||||
FOREACH(file ${ABI_HEADERS})
|
||||
SET(tmpfile ${file}.pp.tmp)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${COMPILER}
|
||||
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
|
||||
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
|
||||
${file}
|
||||
ERROR_QUIET OUTPUT_FILE ${tmpfile})
|
||||
EXECUTE_PROCESS(
|
||||
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})
|
||||
GET_FILENAME_COMPONENT(header_basename ${file} NAME)
|
||||
SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${COMPILER}
|
||||
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
|
||||
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
|
||||
${file}
|
||||
ERROR_QUIET OUTPUT_FILE ${tmpfile})
|
||||
EXECUTE_PROCESS(
|
||||
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)
|
||||
MESSAGE(FATAL_ERROR "sed returned error ${result}")
|
||||
ENDIF()
|
||||
FILE(REMOVE ${tmpfile})
|
||||
EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
|
||||
result)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
|
||||
IF(NOT ${result} EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"ABI check found difference between ${file}.pp and ${abi_check_out}")
|
||||
|
|
Loading…
Add table
Reference in a new issue