diff --git a/CMake/VTKmCompilerFlags.cmake b/CMake/VTKmCompilerFlags.cmake index 6e60a362b..a0b1cfa3c 100644 --- a/CMake/VTKmCompilerFlags.cmake +++ b/CMake/VTKmCompilerFlags.cmake @@ -53,8 +53,12 @@ add_library(vtkm_compiler_flags INTERFACE) # The flags are intended only for VTK-m itself and are not needed by consumers. # We will export vtkm_vectorization_flags in general so consumer can enable # vectorization if they so desire +if (VTKm_ENABLE_DEVELOPER_FLAGS) + target_link_libraries(vtkm_compiler_flags + INTERFACE $) +endif() target_link_libraries(vtkm_compiler_flags - INTERFACE $) + INTERFACE $) # setup that we need C++11 support diff --git a/CMakeLists.txt b/CMakeLists.txt index eb7fdcde8..9c3ca2edf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,10 +112,16 @@ vtkm_option(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY "Don't explicitly hide symbols fr vtkm_option(BUILD_SHARED_LIBS "Build VTK-m with shared libraries" ON) set(VTKm_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +# This flag can be used to prevent VTK-m from exporting its warning flags in its +# build interface. This is useful when building VTK-m as a thirdparty library +# and the warnings are too strict for the parent project. +vtkm_option(VTKm_ENABLE_DEVELOPER_FLAGS "Enable compiler flags that are usefull while developing VTK-m" ON) + mark_as_advanced( VTKm_NO_ASSERT VTKm_INSTALL_ONLY_LIBRARIES VTKm_USE_DEFAULT_SYMBOL_VISIBILITY + VTKm_ENABLE_DEVELOPER_FLAGS ) #-----------------------------------------------------------------------------