Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 94ede4f

Browse files
authored
Allow -DHIGHFIVE_MAX_ERROR=3. (#967)
1 parent aee2b97 commit 94ede4f

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ option(HIGHFIVE_TEST_HALF_FLOAT "Enable half-precision floats" OFF)
6060
# TODO remove entirely.
6161
option(HIGHFIVE_HAS_CONCEPTS "Print readable compiler errors w/ C++20 concepts" OFF)
6262

63+
set(HIGHFIVE_MAX_ERROR 0 "Maximum number of compiler errors.")
6364
option(HIGHFIVE_HAS_WERROR "Convert warnings to errors." OFF)
6465
option(HIGHFIVE_GLIBCXX_ASSERTIONS "Enable bounds check for STL." OFF)
6566
# TODO these some magic to get a drop down menu in ccmake

cmake/HighFiveWarnings.cmake

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
3131
-Wcast-align
3232
-Wdouble-promotion
3333
)
34-
endif()
3534

36-
if(HIGHFIVE_HAS_WERROR)
37-
target_compile_options(HighFiveWarnings
38-
INTERFACE
39-
-Werror
40-
-Wno-error=deprecated-declarations
41-
)
35+
if(HIGHFIVE_MAX_ERRORS)
36+
target_compile_options(HighFiveWarnings
37+
INTERFACE
38+
-fmax-errors=${HIGHFIVE_MAX_ERRORS}
39+
)
40+
endif()
41+
42+
if(HIGHFIVE_HAS_WERROR)
43+
target_compile_options(HighFiveWarnings
44+
INTERFACE
45+
-Werror
46+
-Wno-error=deprecated-declarations
47+
)
48+
endif()
4249
endif()
4350
endif()

doc/developer_guide.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ cmake --build build --parallel
2323
ctest --test-dir build
2424
```
2525

26-
You might want to turn Boost `-DHIGHFIVE_TEST_BOOST=On` or optional
27-
dependencies on.
26+
You might want to add:
27+
* `-DHIGHFIVE_TEST_BOOST=On` or other optional dependencies on,
28+
* `-DHIGHFIVE_MAX_ERROR=3` to only show the first three errors.
29+
30+
Generic CMake reminders:
31+
* `-DCMAKE_INSTALL_PREFIX` defines where HighFive will be installed,
32+
* `-DCMAKE_PREFIX_PATH` defines where `*Config.cmake` files are found.
2833

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

0 commit comments

Comments
 (0)