mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
fix error detection in headers optimizer cmake file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d1b70a3aca
commit
4400040671
2 changed files with 11 additions and 10 deletions
|
@ -180,6 +180,7 @@ macro(KATIE_OPTIMIZE_HEADERS DIR)
|
|||
find_program(unifdef NAMES unifdef)
|
||||
if(unifdef)
|
||||
install(
|
||||
CODE "set(UNIFDEF_EXECUTABLE \"${unifdef}\")"
|
||||
CODE "set(HEADERS_DIRECTORY \"${DIR}\")"
|
||||
CODE "set(HEADERS_DEFINITIONS \"${ARGN}\")"
|
||||
SCRIPT "${CMAKE_SOURCE_DIR}/cmake/modules/OptimizeHeaders.cmake"
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
file(GLOB headers "$ENV{DESTDIR}/${HEADERS_DIRECTORY}/*.h")
|
||||
|
||||
message(STATUS "Optimizing header in: $ENV{DESTDIR}/${HEADERS_DIRECTORY}")
|
||||
foreach(header ${headers})
|
||||
execute_process(
|
||||
COMMAND unifdef -UQT_BOOTSTRAPPED -UQT_MOC -UQT_RCC -UQT_UIC ${HEADERS_DEFINITIONS} "${header}" -o "${header}"
|
||||
RESULT_VARIABLE unifdef_result
|
||||
ERROR_VARIABLE unifdef_error
|
||||
)
|
||||
if(NOT unifdef_result EQUAL 0)
|
||||
message(SEND_ERROR "${unifdef_error}")
|
||||
endif()
|
||||
endforeach()
|
||||
execute_process(
|
||||
COMMAND ${UNIFDEF_EXECUTABLE} -m -UQT_BOOTSTRAPPED -UQT_MOC -UQT_RCC -UQT_UIC ${HEADERS_DEFINITIONS} ${headers}
|
||||
RESULT_VARIABLE unifdef_result
|
||||
ERROR_VARIABLE unifdef_output
|
||||
OUTPUT_VARIABLE unifdef_output
|
||||
)
|
||||
# unifdef exits with status 1 if the output differes, see its man page
|
||||
if(unifdef_result GREATER 1)
|
||||
message(FATAL_ERROR "${unifdef_output} (${unifdef_result})")
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue