Skip to content

Commit

Permalink
Merge pull request #6226 from nilsvu/fix_clang_tidy
Browse files Browse the repository at this point in the history
Fix clang-tidy on CI
  • Loading branch information
nilsdeppe authored Aug 18, 2024
2 parents 25e11e1 + 1205ed9 commit e740611
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
11 changes: 7 additions & 4 deletions cmake/SetupBlaze.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ target_compile_definitions(Blaze
BLAZE_USE_ALWAYS_INLINE=${_BLAZE_USE_ALWAYS_INLINE}
)

target_precompile_headers(Blaze
INTERFACE
${CMAKE_SOURCE_DIR}/tools/BlazeExceptions.hpp
)
# We need to make sure `BlazeExceptions.hpp` is included. It is included in the
# PCH (see tools/SpectrePch.hpp). If there's no PCH, we need to include it here.
if (NOT USE_PCH)
target_compile_options(Blaze
INTERFACE
"$<$<COMPILE_LANGUAGE:CXX>:SHELL:-include Utilities/BlazeExceptions.hpp>")
endif()

add_interface_lib_headers(
TARGET Blaze
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Distributed under the MIT License.
// See LICENSE.txt for details.

#pragma once

#include <csignal>

#ifdef __CUDA_ARCH__
Expand All @@ -9,9 +11,6 @@
#define BLAZE_USE_VECTORIZATION 0
#endif

#ifndef SPECTRE_BLAZE_EXCEPTIONS_HPP
#define SPECTRE_BLAZE_EXCEPTIONS_HPP

#ifdef SPECTRE_DEBUG
#define BLAZE_THROW(EXCEPTION) \
struct sigaction handler {}; \
Expand All @@ -24,4 +23,3 @@
#else // SPECTRE_DEBUG
#define BLAZE_THROW(EXCEPTION)
#endif // SPECTRE_DEBUG
#endif // BLAZE_EXCEPTIONSSPECTRE_BLAZE_EXCEPTIONS_HPP
1 change: 1 addition & 0 deletions src/Utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ spectre_target_headers(
Array.hpp
Base64.hpp
Blas.hpp
BlazeExceptions.hpp
CachedFunction.hpp
CallWithDynamicType.hpp
CartesianProduct.hpp
Expand Down
4 changes: 3 additions & 1 deletion tools/SpectrePch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
// Include STL headers
#include <algorithm>
#include <array>
#include <csignal> // For Blaze error handling (see SetupBlaze.cmake)
#include <cstddef>
#include <limits>
#include <memory>
#include <ostream>
#include <utility>
#include <vector>

// For Blaze error handling (see SetupBlaze.cmake)
#include <Utilities/BlazeExceptions.hpp>

#include <Utilities/ErrorHandling/Assert.hpp>
#include <blaze/math/CustomVector.h>
#include <blaze/math/DenseVector.h>
Expand Down

0 comments on commit e740611

Please sign in to comment.