Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Heinle committed Nov 6, 2024
1 parent e84a580 commit efb5d58
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 0 additions & 2 deletions ExternalLib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include(FetchContent)



# include google test to project
FetchContent_Declare(
googletest
Expand Down
16 changes: 15 additions & 1 deletion cmake/ProjectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ macro(myproject_global_options)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

# set(CMAKE_LINK_WHAT_YOU_USE TRUE)
set(CMAKE_LINK_WHAT_YOU_USE TRUE)

if(myproject_ENABLE_IPO)
include(cmake/InterproceduralOptimization.cmake)
Expand Down Expand Up @@ -216,6 +216,20 @@ macro(myproject_local_options)
myproject_enable_hardening(myproject_options OFF ${ENABLE_UBSAN_MINIMAL_RUNTIME})
endif()

if (myproject_ENABLE_IWYU)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
find_program(IWYU_PATH NAMES include-what-you-use iwyu)
if (IWYU_PATH)
set_target_properties(myproject_options PROPERTIES
CXX_INCLUDE_WHAT_YOU_USE "${IWYU_PATH}"
)
message(STATUS "Include-What-You-Use found: ${IWYU_PATH}")
else()
message(STATUS "Include-What-You-Use not found!")
endif()
endif()
endif()

# include(cmake/Doxygen.cmake)
# enable_doxygen()

Expand Down
9 changes: 0 additions & 9 deletions cmake/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,3 @@ macro(myproject_enable_clang_tidy target WARNINGS_AS_ERRORS)
message(${WARNING_MESSAGE} "clang-tidy requested but executable not found")
endif()
endmacro()

macro(myproject_enable_include_what_you_use)
find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
if(INCLUDE_WHAT_YOU_USE)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
else()
message(${WARNING_MESSAGE} "include-what-you-use requested but executable not found")
endif()
endmacro()

0 comments on commit efb5d58

Please sign in to comment.