cmake: integrate iwyu, if/when present
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
51c0b1fc56
commit
5ad8e610a4
|
@ -227,6 +227,22 @@ add_executable(fortuna ${FORTUNA_SOURCES} ${FORTUNA_HEADERS})
|
||||||
target_include_directories(fortuna PRIVATE .)
|
target_include_directories(fortuna PRIVATE .)
|
||||||
target_compile_features(fortuna PUBLIC cxx_std_20)
|
target_compile_features(fortuna PUBLIC cxx_std_20)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
message(STATUS "Looking for iwyu...")
|
||||||
|
find_program(iwyu NAMES include-what-you-use iwyu)
|
||||||
|
if(iwyu)
|
||||||
|
message(STATUS "iwyu found at: ${iwyu}")
|
||||||
|
set(iwyu_and_options
|
||||||
|
${iwyu}
|
||||||
|
-Xiwyu
|
||||||
|
-p .
|
||||||
|
--verbose=3)
|
||||||
|
set_property(TARGET fortuna PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu_and_options})
|
||||||
|
else()
|
||||||
|
message(STATUS "iwyu, not found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# ref: https://cmake.org/pipermail/cmake/2016-May/063400.html
|
# ref: https://cmake.org/pipermail/cmake/2016-May/063400.html
|
||||||
target_link_libraries(fortuna
|
target_link_libraries(fortuna
|
||||||
PRIVATE cryptopp
|
PRIVATE cryptopp
|
||||||
|
|
Reference in New Issue