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 @@ -132,6 +132,17 @@ option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON)
132
132
option (SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND} )
133
133
option (SECP256K1_BUILD_EXAMPLES "Build examples." OFF )
134
134
135
+ if (CMAKE_VERSION VERSION_GREATER 3.2)
136
+ option (SECP256K1_ENABLE_IWYU "Run include-what-you-use (IWYU) with the compiler." OFF )
137
+ if (SECP256K1_ENABLE_IWYU)
138
+ find_program (INCLUDE_WHAT_YOU_USE_COMMAND NAMES include -what-you-use)
139
+ if (NOT INCLUDE_WHAT_YOU_USE_COMMAND)
140
+ message (FATAL_ERROR "SECP256K1_ENABLE_IWYU is ON but include-what-you-use is not found." )
141
+ endif ()
142
+ set (CMAKE_C_INCLUDE_WHAT_YOU_USE "${INCLUDE_WHAT_YOU_USE_COMMAND} " )
143
+ endif ()
144
+ endif ()
145
+
135
146
# Redefine configuration flags.
136
147
# We leave assertions on, because they are only used in the examples, and we want them always on there.
137
148
if (MSVC )
@@ -269,6 +280,9 @@ get_directory_property(definitions COMPILE_DEFINITIONS)
269
280
string (REPLACE ";" " " definitions "${definitions} " )
270
281
message ("Preprocessor defined macros ........... ${definitions} " )
271
282
message ("C compiler ............................ ${CMAKE_C_COMPILER} " )
283
+ if (SECP256K1_ENABLE_IWYU)
284
+ message ("Run IWYU with the compiler ............ ${CMAKE_C_INCLUDE_WHAT_YOU_USE} " )
285
+ endif ()
272
286
message ("CFLAGS ................................ ${CMAKE_C_FLAGS} " )
273
287
get_directory_property (compile_options COMPILE_OPTIONS)
274
288
string (REPLACE ";" " " compile_options "${compile_options} " )
You can’t perform that action at this time.
0 commit comments