Skip to content
Snippets Groups Projects
Commit 76784f35 authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Merge branch 'feature/have-packages' into 'master'

Handle optional dependencies GMP, QuadMath, and Vc by directly passing HAVE_xxx flags

See merge request !1309
parents e4793dc6 b91d9cfa
Branches
Tags
1 merge request!1309Handle optional dependencies GMP, QuadMath, and Vc by directly passing HAVE_xxx flags
Pipeline #66315 passed with warnings
Pipeline: Dune Nightly Test

#66316

    ......@@ -79,7 +79,7 @@ In order to build the DUNE core modules you need at least the following software
    https://gitlab.dune-project.org/core/dune-common/-/merge_requests/1251
    for more details on how to use this feature in the source modules and on
    some new feature.
    - Remove deprecated `add_directory_test_target` function.
    - Do not overwrite the `add_test` cmake function with an error message.
    ......@@ -98,6 +98,11 @@ In order to build the DUNE core modules you need at least the following software
    - Deprecate CMake macro `message_verbose`. Use `message(VERBOSE "message text")` instead.
    This macro will be removed after Dune 2.10.
    - We have changed the way optional dependencies are activated in the build-system internally.
    The cmake macros `add_dune_xy_flags` do not set the compiler flag `-DENABLE_XY=1` anymore, but instead
    set directly the flag `-DHAVE_XY=1`. Neither `ENABLE_XY` nor `HAVE_XY` should be modified manually
    by the user. Since the `HAVE_XY` flag is now set as a compiler flag, it is not included in the
    `config.h` files anymore.
    ## Deprecations and removals
    ......
    ......@@ -21,7 +21,7 @@ set(HAVE_GMP ${GMP_FOUND})
    if(GMP_FOUND)
    dune_register_package_flags(
    LIBRARIES GMP::gmpxx
    COMPILE_DEFINITIONS "ENABLE_GMP=1"
    COMPILE_DEFINITIONS "HAVE_GMP=1"
    )
    endif()
    ......@@ -30,7 +30,7 @@ function(add_dune_gmp_flags _targets)
    if(GMP_FOUND)
    foreach(_target ${_targets})
    target_link_libraries(${_target} PUBLIC GMP::gmpxx)
    target_compile_definitions(${_target} PUBLIC ENABLE_GMP=1)
    target_compile_definitions(${_target} PUBLIC HAVE_GMP=1)
    endforeach(_target ${_targets})
    endif(GMP_FOUND)
    endfunction(add_dune_gmp_flags)
    ......@@ -21,7 +21,7 @@ set(HAVE_QUADMATH ${QuadMath_FOUND})
    if(QuadMath_FOUND)
    dune_register_package_flags(
    LIBRARIES QuadMath::QuadMath
    COMPILE_DEFINITIONS "ENABLE_QUADMATH=1"
    COMPILE_DEFINITIONS "HAVE_QUADMATH=1"
    )
    endif()
    ......@@ -30,7 +30,7 @@ function(add_dune_quadmath_flags _targets)
    if(QuadMath_FOUND)
    foreach(_target ${_targets})
    target_link_libraries(${_target} PUBLIC QuadMath::QuadMath)
    target_compile_definitions(${_target} PUBLIC ENABLE_QUADMATH=1)
    target_compile_definitions(${_target} PUBLIC HAVE_QUADMATH=1)
    endforeach(_target ${_targets})
    endif()
    endfunction(add_dune_quadmath_flags)
    ......@@ -28,14 +28,14 @@ function(add_dune_vc_flags _targets)
    foreach(_target ${_targets})
    target_link_libraries(${_target} PUBLIC ${Vc_LIBRARIES})
    target_compile_options(${_target} PUBLIC ${Vc_COMPILE_FLAGS})
    target_compile_definitions(${_target} PUBLIC ENABLE_VC=1)
    target_compile_definitions(${_target} PUBLIC HAVE_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_COMPILE_FLAGS};-DENABLE_VC=1"
    dune_register_package_flags(COMPILE_OPTIONS "${Vc_COMPILE_FLAGS};-DHAVE_VC=1"
    LIBRARIES "${Vc_LIBRARIES}"
    INCLUDE_DIRS "${Vc_INCLUDE_DIR}")
    endif(Vc_FOUND)
    ......
    ......@@ -48,18 +48,6 @@
    #define _MPICC_H
    #endif
    /* Define if you have the GNU GMP library. The value should be ENABLE_GMP
    to facilitate activating and deactivating GMP using compile flags. */
    #cmakedefine HAVE_GMP ENABLE_GMP
    /* Define if you have the GCC Quad-Precision library. The value should be ENABLE_QUADMATH
    to facilitate activating and deactivating QuadMath using compile flags. */
    #cmakedefine HAVE_QUADMATH ENABLE_QUADMATH
    /* 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 Threading Building Blocks (TBB) library */
    #cmakedefine HAVE_TBB 1
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment