Skip to content

Commit

Permalink
Allow -DHIGHFIVE_MAX_ERROR=3. (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc authored Feb 19, 2024
1 parent aee2b97 commit 94ede4f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ option(HIGHFIVE_TEST_HALF_FLOAT "Enable half-precision floats" OFF)
# TODO remove entirely.
option(HIGHFIVE_HAS_CONCEPTS "Print readable compiler errors w/ C++20 concepts" OFF)

set(HIGHFIVE_MAX_ERROR 0 "Maximum number of compiler errors.")
option(HIGHFIVE_HAS_WERROR "Convert warnings to errors." OFF)
option(HIGHFIVE_GLIBCXX_ASSERTIONS "Enable bounds check for STL." OFF)
# TODO these some magic to get a drop down menu in ccmake
Expand Down
21 changes: 14 additions & 7 deletions cmake/HighFiveWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
-Wcast-align
-Wdouble-promotion
)
endif()

if(HIGHFIVE_HAS_WERROR)
target_compile_options(HighFiveWarnings
INTERFACE
-Werror
-Wno-error=deprecated-declarations
)
if(HIGHFIVE_MAX_ERRORS)
target_compile_options(HighFiveWarnings
INTERFACE
-fmax-errors=${HIGHFIVE_MAX_ERRORS}
)
endif()

if(HIGHFIVE_HAS_WERROR)
target_compile_options(HighFiveWarnings
INTERFACE
-Werror
-Wno-error=deprecated-declarations
)
endif()
endif()
endif()
9 changes: 7 additions & 2 deletions doc/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ cmake --build build --parallel
ctest --test-dir build
```

You might want to turn Boost `-DHIGHFIVE_TEST_BOOST=On` or optional
dependencies on.
You might want to add:
* `-DHIGHFIVE_TEST_BOOST=On` or other optional dependencies on,
* `-DHIGHFIVE_MAX_ERROR=3` to only show the first three errors.

Generic CMake reminders:
* `-DCMAKE_INSTALL_PREFIX` defines where HighFive will be installed,
* `-DCMAKE_PREFIX_PATH` defines where `*Config.cmake` files are found.

## Contributing
There's numerous HDF5 features that haven't been wrapped yet. HighFive is a
Expand Down

0 comments on commit 94ede4f

Please sign in to comment.