Skip to content

Commit

Permalink
overlook: stop compililation on the first error
Browse files Browse the repository at this point in the history
  • Loading branch information
zchrissirhcz committed Jan 5, 2025
1 parent d5282c6 commit f810a6b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions plugins/overlook/overlook.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include_guard()

set(OVERLOOK "${CMAKE_CURRENT_LIST_FILE}")

set(OVERLOOK_VERSION "2024.06.12")
set(OVERLOOK_VERSION "2025.01.05")
option(OVERLOOK_GLOBAL "Apply overlook globally?" ON)

set(OVERLOOK_C_COMPILE_OPTIONS)
Expand Down Expand Up @@ -439,8 +439,17 @@ if((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
list(APPEND OVERLOOK_C_COMPILE_OPTIONS -Werror=implicit-fallthrough)
list(APPEND OVERLOOK_CXX_COMPILE_OPTIONS -Werror=implicit-fallthrough)
elseif((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
list(APPEND OVERLOOK_C_COMPILE_OPTIONS -Werror=implicit-fallthrough)
list(APPEND OVERLOOK_CXX_COMPILE_OPTIONS -Werror=implicit-fallthrough)
list(APPEND OVERLOOK_C_COMPILE_OPTIONS -Werror=implicit-fallthrough)
list(APPEND OVERLOOK_CXX_COMPILE_OPTIONS -Werror=implicit-fallthrough)
endif()

## rule37: 遇到第一个报错就停止编译
if((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
list(APPEND OVERLOOK_C_COMPILE_OPTIONS -Wfatal-errors)
list(APPEND OVERLOOK_CXX_COMPILE_OPTIONS -Wfatal-errors)
elseif((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
list(APPEND OVERLOOK_C_COMPILE_OPTIONS -Wfatal-errors)
list(APPEND OVERLOOK_CXX_COMPILE_OPTIONS -Wfatal-errors)
endif()

# rule5: 避免使用影子(shadow)变量
Expand Down

0 comments on commit f810a6b

Please sign in to comment.