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

Improve information content of GCC error messages. #985

Merged
merged 1 commit into from
Apr 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
8 changes: 7 additions & 1 deletion cmake/HighFiveWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if(TARGET HighFiveWarnings)
endif()

add_library(HighFiveWarnings INTERFACE)
add_library(HighFiveFlags INTERFACE)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
Expand All @@ -32,8 +33,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
-Wdouble-promotion
)

target_compile_options(HighFiveWarnings
INTERFACE
-ftemplate-backtrace-limit=0
)

if(HIGHFIVE_MAX_ERRORS)
target_compile_options(HighFiveWarnings
target_compile_options(HighFiveFlags
INTERFACE
-fmax-errors=${HIGHFIVE_MAX_ERRORS}
)
Expand Down
2 changes: 1 addition & 1 deletion src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function(compile_example example_source)
message("example_name: ${example_name}")

add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} PUBLIC HighFive HighFiveWarnings)
target_link_libraries(${example_name} PUBLIC HighFive HighFiveWarnings HighFiveFlags)
if(${ARGC} EQUAL 2)
target_link_libraries(${example_name} PUBLIC ${ARGV1})
endif()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()
## Base tests
foreach(test_name tests_high_five_base tests_high_five_multi_dims tests_high_five_easy test_all_types test_high_five_selection tests_high_five_data_type test_legacy)
add_executable(${test_name} "${test_name}.cpp")
target_link_libraries(${test_name} HighFive HighFiveWarnings Catch2::Catch2WithMain)
target_link_libraries(${test_name} HighFive HighFiveWarnings HighFiveFlags Catch2::Catch2WithMain)
target_link_libraries(${test_name} HighFiveOptionalDependencies)

catch_discover_tests(${test_name})
Expand All @@ -19,7 +19,7 @@ if(HIGHFIVE_PARALLEL_HDF5)

## parallel MPI tests
add_executable(tests_parallel_bin ${tests_parallel_src})
target_link_libraries(tests_parallel_bin HighFive HighFiveWarnings Catch2::Catch2)
target_link_libraries(tests_parallel_bin HighFive HighFiveWarnings HighFiveFlags Catch2::Catch2)
target_link_libraries(tests_parallel_bin HighFiveOptionalDependencies)

# We need to patch in a call to `mpirun` or equivalent when using
Expand Down Expand Up @@ -62,6 +62,6 @@ if(HIGHFIVE_TEST_SINGLE_INCLUDES)
get_filename_component(CLASS_NAME ${PUBLIC_HEADER} NAME_WE)
configure_file(tests_import_public_headers.cpp "tests_${CLASS_NAME}.cpp" @ONLY)
add_executable("tests_include_${CLASS_NAME}" "${CMAKE_CURRENT_BINARY_DIR}/tests_${CLASS_NAME}.cpp")
target_link_libraries("tests_include_${CLASS_NAME}" HighFive HighFiveWarnings)
target_link_libraries("tests_include_${CLASS_NAME}" HighFive HighFiveWarnings HighFiveFlags)
endforeach()
endif()
Loading