Skip to content
Snippets Groups Projects
Verified Commit a7c7c9cd authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Check if alberta is older than 3.1.0 to handle stdbool

parent 018e5f56
No related branches found
No related tags found
1 merge request!769Add `HAVE_STDBOOL_H` define for Alberta when `stdbool.h` is available
Pipeline #77554 canceled
...@@ -109,13 +109,17 @@ find_package_handle_standard_args("Alberta" ...@@ -109,13 +109,17 @@ find_package_handle_standard_args("Alberta"
) )
if(Alberta_FOUND) if(Alberta_FOUND)
include(CheckIncludeFileCXX)
check_include_file_cxx("stdbool.h" HAVE_STDBOOL_H_HEADER) 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}) foreach(dim ${ALBERTA_WORLD_DIMS})
if(NOT Alberta::AlbertaGrid${dim}D) if(NOT Alberta::AlbertaGrid${dim}D)
if (${HAVE_STDBOOL_H_HEADER}) if (${HAVE_STDBOOL_H_HEADER})
# Tell Alberta that we have a stdbool.h header so that it doesn't # 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` # try to define `bool` itself (which would lead to a `typedef bool bool`
# and hence a compile error in clang). # and hence a compile error in clang).
target_compile_definitions(PkgConfig::Alberta${dim}D INTERFACE -DHAVE_STDBOOL_H) target_compile_definitions(PkgConfig::Alberta${dim}D INTERFACE -DHAVE_STDBOOL_H)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment