File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,17 @@ option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON)
134
134
option (SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND} )
135
135
option (SECP256K1_BUILD_EXAMPLES "Build examples." OFF )
136
136
137
+ if (CMAKE_VERSION VERSION_GREATER 3.2)
138
+ option (SECP256K1_RUN_IWYU "Run include-what-you-use (IWYU) with the compiler." OFF )
139
+ if (SECP256K1_RUN_IWYU)
140
+ find_program (INCLUDE_WHAT_YOU_USE_COMMAND NAMES include -what-you-use)
141
+ if (NOT INCLUDE_WHAT_YOU_USE_COMMAND)
142
+ message (FATAL_ERROR "SECP256K1_RUN_IWYU is ON but include-what-you-use is not found." )
143
+ endif ()
144
+ set (CMAKE_C_INCLUDE_WHAT_YOU_USE "${INCLUDE_WHAT_YOU_USE_COMMAND} " )
145
+ endif ()
146
+ endif ()
147
+
137
148
# Redefine configuration flags.
138
149
if (MSVC )
139
150
string (REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} )
@@ -263,6 +274,9 @@ get_directory_property(definitions COMPILE_DEFINITIONS)
263
274
string (REPLACE ";" " " definitions "${definitions} " )
264
275
message ("Preprocessor defined macros ........... ${definitions} " )
265
276
message ("C compiler ............................ ${CMAKE_C_COMPILER} " )
277
+ if (SECP256K1_RUN_IWYU)
278
+ message ("Run IWYU with the compiler ............ ${CMAKE_C_INCLUDE_WHAT_YOU_USE} " )
279
+ endif ()
266
280
message ("CFLAGS ................................ ${CMAKE_C_FLAGS} " )
267
281
get_directory_property (compile_options COMPILE_OPTIONS)
268
282
string (REPLACE ";" " " compile_options "${compile_options} " )
You can’t perform that action at this time.
0 commit comments