2022-10-20 05:32:31 +03:00
|
|
|
# Copyright (C) 2015 Ivailo Monev <xakepa10@gmail.com>
|
2019-05-13 00:59:14 +00:00
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
|
2021-06-25 14:59:50 +03:00
|
|
|
# UNIFDEF_EXECUTABLE and HEADERS_DIRECTORY origin from the macro call
|
2015-12-10 05:06:13 +02:00
|
|
|
|
2021-06-25 14:59:50 +03:00
|
|
|
set(headers_directory "$ENV{DESTDIR}/${HEADERS_DIRECTORY}")
|
|
|
|
file(GLOB_RECURSE headers "${headers_directory}/*.h")
|
2015-12-10 05:06:13 +02:00
|
|
|
|
2021-06-25 14:59:50 +03:00
|
|
|
set(unifdef_arguments
|
|
|
|
# bootstrap
|
2021-06-21 08:07:47 +03:00
|
|
|
-UQT_BOOTSTRAPPED
|
2021-06-25 14:59:50 +03:00
|
|
|
# not supported
|
2021-06-21 08:07:47 +03:00
|
|
|
-UQT_NO_QOBJECT
|
|
|
|
-UQT_NO_COMPRESS
|
|
|
|
-UQT_NO_THREAD
|
|
|
|
-UQT_NO_PROCESS
|
|
|
|
-UQT_NO_DATASTREAM
|
|
|
|
-UQT_NO_TEXTSTREAM
|
|
|
|
-UQT_NO_REGEXP
|
|
|
|
-UQT_NO_REGEXP_ANCHOR_ALT
|
|
|
|
-UQT_NO_REGEXP_BACKREF
|
|
|
|
-UQT_NO_REGEXP_CAPTURE
|
|
|
|
-UQT_NO_REGEXP_CCLASS
|
|
|
|
-UQT_NO_REGEXP_ESCAPE
|
|
|
|
-UQT_NO_REGEXP_INTERVAL
|
|
|
|
-UQT_NO_REGEXP_LOOKAHEAD
|
|
|
|
-UQT_NO_REGEXP_OPTIM
|
|
|
|
-UQT_NO_REGEXP_WILDCARD
|
|
|
|
-UQT_NO_STANDARDPATHS
|
|
|
|
-UQT_NO_SETTINGS
|
|
|
|
-UQT_NO_TEXTCODEC
|
2021-08-24 23:34:39 +03:00
|
|
|
# exports
|
|
|
|
-UKtCore_EXPORTS
|
|
|
|
-UKtGui_EXPORTS
|
|
|
|
-UKtNetwork_EXPORTS
|
|
|
|
-UKtSvg_EXPORTS
|
|
|
|
-UKtTest_EXPORTS
|
|
|
|
-UKtXml_EXPORTS
|
|
|
|
-UKtDBus_EXPORTS
|
|
|
|
-UKtUiTools_EXPORTS
|
2021-06-21 08:07:47 +03:00
|
|
|
)
|
|
|
|
|
2021-06-25 14:59:50 +03:00
|
|
|
message(STATUS "Optimizing header in: ${headers_directory}")
|
2015-12-21 23:32:05 +02:00
|
|
|
execute_process(
|
2021-06-25 14:59:50 +03:00
|
|
|
COMMAND ${UNIFDEF_EXECUTABLE} -m ${unifdef_arguments} ${headers}
|
2015-12-21 23:32:05 +02:00
|
|
|
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()
|