Skip to content

Commit

Permalink
Merge pull request #563 from borglab/fix/unknown-warning
Browse files Browse the repository at this point in the history
Fix warning on clang
  • Loading branch information
dellaert authored Oct 29, 2020
2 parents 0857dd1 + 1da968a commit 2fc8785
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmake/GtsamBuildTypes.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(CheckCXXCompilerFlag) # for check_cxx_compiler_flag()

# Set cmake policy to recognize the AppleClang compiler
# independently from the Clang compiler.
if(POLICY CMP0025)
Expand Down Expand Up @@ -105,11 +107,14 @@ if(MSVC)
else()
# Common to all configurations, next for each configuration:

if (
((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0)) OR
(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
)
set(flag_override_ -Wsuggest-override) # -Werror=suggest-override: Add again someday
if (NOT MSVC)
check_cxx_compiler_flag(-Wsuggest-override COMPILER_HAS_WSUGGEST_OVERRIDE)
check_cxx_compiler_flag(-Wmissing COMPILER_HAS_WMISSING_OVERRIDE)
if (COMPILER_HAS_WSUGGEST_OVERRIDE)
set(flag_override_ -Wsuggest-override) # -Werror=suggest-override: Add again someday
elseif(COMPILER_HAS_WMISSING_OVERRIDE)
set(flag_override_ -Wmissing-override) # -Werror=missing-override: Add again someday
endif()
endif()

set(GTSAM_COMPILE_OPTIONS_PRIVATE_COMMON
Expand Down

0 comments on commit 2fc8785

Please sign in to comment.