Skip to content
Snippets Groups Projects
Commit fd89143d authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Merge branch 'fix-alberta-stdbool' into 'master'

Add `HAVE_STDBOOL_H` define for Alberta when `stdbool.h` is available

See merge request !769
parents c75f2b61 59be48e9
Branches
No related tags found
1 merge request!769Add `HAVE_STDBOOL_H` define for Alberta when `stdbool.h` is available
Pipeline #78347 passed
......@@ -16,10 +16,6 @@ before_script:
- duneci-install-module https://gitlab.dune-project.org/core/dune-geometry.git
- duneci-install-module https://gitlab.dune-project.org/staging/dune-uggrid.git
variables:
# Alberta + python bindings fail at the moment with linker error
DUNECI_CMAKE_FLAGS: '-DCMAKE_DISABLE_FIND_PACKAGE_Alberta=TRUE'
# Check for spelling mistakes in text
code-spelling-check:
stage: .pre
......
......@@ -109,8 +109,21 @@ find_package_handle_standard_args("Alberta"
)
if(Alberta_FOUND)
if(ALBERTA_GRID_VERSION VERSION_LESS 3.1.0)
unset(HAVE_STDBOOL_H_HEADER)
include(CheckIncludeFileCXX)
check_include_file_cxx("stdbool.h" HAVE_STDBOOL_H_HEADER)
endif()
foreach(dim ${ALBERTA_WORLD_DIMS})
if(NOT Alberta::AlbertaGrid${dim}D)
if (${HAVE_STDBOOL_H_HEADER})
# Tell Alberta(<3.1.0) that we have a stdbool.h header so that it doesn't
# try to define `bool` itself (which would lead to a `typedef bool bool`
# and hence a compile error in clang).
target_compile_definitions(PkgConfig::Alberta${dim}D INTERFACE -DHAVE_STDBOOL_H)
endif()
add_library(Alberta::AlbertaGrid${dim}D ALIAS PkgConfig::Alberta${dim}D)
endif()
endforeach(dim)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment