Skip to content

Commit

Permalink
#1602: CMake: stop checking for parent when enabling warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Nov 23, 2021
1 parent bbb60c6 commit ba10c44
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions cmake/turn_on_warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ function(enable_cxx_compiler_flag_if_supported flag)
endfunction()

function(turn_on_warnings vt_target)
if(NOT hasParent)
enable_cxx_compiler_flag_if_supported("-Wall")
enable_cxx_compiler_flag_if_supported("-pedantic")
enable_cxx_compiler_flag_if_supported("-Wshadow")
enable_cxx_compiler_flag_if_supported("-Wno-unknown-pragmas")
enable_cxx_compiler_flag_if_supported("-Wsign-compare")
# Not really a warning, is still diagnostic related..
enable_cxx_compiler_flag_if_supported("-ftemplate-backtrace-limit=100")
enable_cxx_compiler_flag_if_supported("-Wall")
enable_cxx_compiler_flag_if_supported("-pedantic")
enable_cxx_compiler_flag_if_supported("-Wshadow")
enable_cxx_compiler_flag_if_supported("-Wno-unknown-pragmas")
enable_cxx_compiler_flag_if_supported("-Wsign-compare")
# Not really a warning, is still diagnostic related..
enable_cxx_compiler_flag_if_supported("-ftemplate-backtrace-limit=100")

if (vt_werror_enabled) # Treat warning as errors
enable_cxx_compiler_flag_if_supported("-Werror")
endif()
if (vt_werror_enabled) # Treat warning as errors
enable_cxx_compiler_flag_if_supported("-Werror")
endif()
endfunction()

0 comments on commit ba10c44

Please sign in to comment.