Skip to content

Commit 17a62c7

Browse files
committed
COMP: Add -Wno-undefined-var-template to CMAKE_CXX_FLAGS
Only needed when building the template externally with a clang compiler. Hides the following spurious warnings: ```cpp Modules/Core/Common/include/itkNumericTraits.h:1083:36: warning: instantiation of variable 'itk::NumericTraits<std::__1::complex<double> >::Zero' required here, but no definition is available [-Wundefined-var-template] static Self ZeroValue() { return Zero; } Modules/Core/Common/include/itkNumericTraits.h:1083:36: note: add an explicit instantiation declaration to suppress this warning if 'itk::NumericTraits<std::__1::complex<double> >::Zero' is explicitly instantiated in another translation unit static Self ZeroValue() { return Zero; } ``` Fixes #120
1 parent 0fed855 commit 17a62c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ set(IsotropicWavelets_LIBRARIES IsotropicWavelets)
66
if(NOT ITK_SOURCE_DIR)
77
find_package(ITK REQUIRED)
88
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
9+
# Hide clang warnings about undefined-var-template
10+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # using regular Clang or AppleClang
11+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
12+
endif()
913
include(ITKModuleExternal)
1014
else()
1115
itk_module_impl()

0 commit comments

Comments
 (0)