Skip to content

Commit

Permalink
Merge branch 'master' into white-list
Browse files Browse the repository at this point in the history
  • Loading branch information
darionyaphet authored Dec 13, 2021
2 parents 81fe797 + 58914a7 commit be03d2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ project("Nebula Graph" C CXX)
option(ENABLE_PACK_ONE "Whether to package into one" ON)
option(ENABLE_VERBOSE_BISON "Enable Bison to report state" OFF)
option(ENABLE_PACKAGE_TAR "Enable package artifacts to tar." OFF)
option(ENABLE_CREATE_GIT_HOOKS "Enable create git hooks." ON)
option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable include-what-you-use find nouse include files" OFF)

add_definitions(-DNEBULA_HOME=${CMAKE_SOURCE_DIR})

Expand All @@ -44,6 +46,7 @@ include(SanitizerConfig)
include(GitHooksConfig)
include(GitInfoConfig)
include(NebulaCustomTargets)
include(IncludeWhatYouUse)

add_custom_target(
clang-format
Expand Down
2 changes: 1 addition & 1 deletion cmake/nebula/GitHooksConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/")
if(ENABLE_CREATE_GIT_HOOKS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/")
# Create the pre-commit hook every time we run cmake
message(STATUS "Create the pre-commit hook")
set(PRE_COMMIT_HOOK ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit)
Expand Down
10 changes: 10 additions & 0 deletions cmake/nebula/IncludeWhatYouUse.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if(ENABLE_INCLUDE_WHAT_YOU_USE)
find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
if(INCLUDE_WHAT_YOU_USE)
message("use include-what-you-use")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "include-what-you-use;-Xiwyu;--transitive_includes_only")
else()
message(STATUS "iwyu requested but executable not found")
endif()
endif()

0 comments on commit be03d2b

Please sign in to comment.