diff --git a/cmake/modules/AddVcFlags.cmake b/cmake/modules/AddVcFlags.cmake index 0ca689adbb221979cae908a65c28548995753885..01d2494a934909916a36348ee8199a045b1c13cf 100644 --- a/cmake/modules/AddVcFlags.cmake +++ b/cmake/modules/AddVcFlags.cmake @@ -18,13 +18,14 @@ function(add_dune_vc_flags _targets) foreach(_target ${_targets}) target_link_libraries(${_target} ${Vc_LIBRARIES}) target_compile_options(${_target} PUBLIC ${Vc_ALL_FLAGS}) + target_compile_definitions(${_target} PUBLIC ENABLE_VC=1) target_include_directories(${_target} SYSTEM PUBLIC ${Vc_INCLUDE_DIR}) endforeach(_target ${_targets}) endif(Vc_FOUND) endfunction(add_dune_vc_flags) if(Vc_FOUND) - dune_register_package_flags(COMPILE_OPTIONS "${Vc_ALL_FLAGS}" + dune_register_package_flags(COMPILE_OPTIONS "${Vc_ALL_FLAGS} -DENABLE_VC=1" LIBRARIES "${Vc_LIBRARIES}" INCLUDE_DIRS "${Vc_INCLUDE_DIR}") endif(Vc_FOUND) diff --git a/config.h.cmake b/config.h.cmake index 6e1fd357d2a8f210f3977e7efa705015869816c9..75a78ecc8bda27d93ce5ddf1e82a226cb4e5ce72 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -45,8 +45,9 @@ to facilitate activating and deactivating GMP using compile flags. */ #cmakedefine HAVE_GMP ENABLE_GMP -/* Define to 1 if you have the Vc library. */ -#cmakedefine HAVE_VC 1 +/* Define if you have the Vc library. The value should be ENABLE_VC + to facilitate activating and deactivating Vc using compile flags. */ +#cmakedefine HAVE_VC ENABLE_VC /* Define to 1 if you have the symbol mprotect. */ #cmakedefine HAVE_MPROTECT 1