Skip to content

Commit

Permalink
Clang: Add -Wno-error=undefined-func-template
Browse files Browse the repository at this point in the history
Recent clang versions include this diagnostic.  Until it is confirmed
whether this is a false positive, a library misuse or an upstream bug,
it should stay in as a warning.
  • Loading branch information
dannyedel committed Oct 23, 2017
1 parent 1016f38 commit d8eb9af
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmake/compiler_clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ add_definitions(-Wno-error=undefined-reinterpret-cast)
# Clang on recent XCode fails to compile the boost tests
add_definitions(-Wno-error=disabled-macro-expansion)

# Clang-5.0 notices this on runtimeconfiguration.cpp:201:14
#
# 'boost::program_options::parse_config_file<char>' required here, but no
# definition is available [-Werror,-Wundefined-func-template]
# store( parse_config_file( cfile, configFileOptions), vm);
#
# FIXME: This is a workaround, not a solution.
# See #191 at https://github.com/dannyedel/dspdfviewer/issues/191
#
# Older clang versions (at least including clang-3.8) abort compilation
# with this flag, so first check if this current version supports it.
Include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wno-error=undefined-func-template"
CLANG_SUPPORTS_UNDEFINED_FUNC_TEMPLATE_DIAGNOSTIC)
if(CLANG_SUPPORTS_UNDEFINED_FUNC_TEMPLATE_DIAGNOSTIC)
# Add the command-l
add_definitions(-Wno-error=undefined-func-template)
endif()

#message(FATAL_ERROR "Version: ${CMAKE_CXX_COMPILER_VERSION}")

# clang will complain about -isystem passed but not used.
Expand Down

0 comments on commit d8eb9af

Please sign in to comment.