Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow -DHIGHFIVE_MAX_ERROR=3. #967

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading