Link vtkm_developer_flags directly into vtkm libraries.

This should properly propogate the flags to superprojects.
This commit is contained in:
Allison Vacanti 2018-12-05 15:30:45 -05:00
parent 1766f213ea
commit 8baacca525
2 changed files with 19 additions and 8 deletions

@ -49,19 +49,14 @@ endif()
add_library(vtkm_compiler_flags INTERFACE)
# When building libraries/tests that are part of the VTK-m repository
# inherit the properties from vtkm_developer_flags and vtkm_vectorization_flags.
# inherit the properties from vtkm_vectorization_flags.
# The flags are intended only for VTK-m itself and are not needed by consumers.
# We will export vtkm_developer_flags, and vtkm_vectorization_flags in general
# We will export vtkm_vectorization_flags in general
# so consumer can either enable vectorization or use VTK-m's build flags if
# they so desire
if (VTKm_ENABLE_DEVELOPER_FLAGS)
target_link_libraries(vtkm_compiler_flags
INTERFACE $<BUILD_INTERFACE:vtkm_developer_flags>)
endif()
target_link_libraries(vtkm_compiler_flags
INTERFACE $<BUILD_INTERFACE:vtkm_vectorization_flags>)
# setup that we need C++11 support
if(CMAKE_VERSION VERSION_LESS 3.8)
target_compile_features(vtkm_compiler_flags INTERFACE cxx_nullptr)

@ -146,7 +146,12 @@ int ${headername}_${headerextension}_testbuild_symbol;"
set_property(TARGET TestBuild_${name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds)
set_property(TARGET TestBuild_${name} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds)
target_link_libraries(TestBuild_${name} PRIVATE vtkm_compiler_flags vtkm_taotuple)
target_link_libraries(TestBuild_${name}
PRIVATE
$<BUILD_INTERFACE:vtkm_developer_flags>
vtkm_compiler_flags
vtkm_taotuple
)
if(TARGET vtkm::tbb)
#make sure that we have the tbb include paths when tbb is enabled.
@ -325,6 +330,17 @@ function(vtkm_library)
EXCLUDE_FROM_TESTING ${VTKm_LIB_TEMPLATE_SOURCES}
)
# When building libraries/tests that are part of the VTK-m repository inherit
# the properties from vtkm_developer_flags. The flags are intended only for
# VTK-m itself and are not needed by consumers. We will export
# vtkm_developer_flags so consumer can use VTK-m's build flags if they so
# desire
if (VTKm_ENABLE_DEVELOPER_FLAGS)
target_link_libraries(${lib_name} PUBLIC $<BUILD_INTERFACE:vtkm_developer_flags>)
else()
target_link_libraries(${lib_name} PRIVATE $<BUILD_INTERFACE:vtkm_developer_flags>)
endif()
#install the library itself
install(TARGETS ${lib_name}
EXPORT ${VTKm_EXPORT_NAME}