Skip to content

Commit

Permalink
Add pedantic flag for wrapper build. (#899)
Browse files Browse the repository at this point in the history
* Add pedantic flag for wrapper build.

Bump nanobind version to 2.5.0.

* Disable warning
  • Loading branch information
garth-wells authored Feb 9, 2025
1 parent d7bb763 commit cbd03dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.0.0"]
requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0"]
build-backend = "scikit_build_core.build"

[project]
Expand Down
7 changes: 3 additions & 4 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
find_package(nanobind CONFIG REQUIRED)

# Create the binding library
nanobind_add_module(_basixcpp wrapper.cpp)
nanobind_add_module(_basixcpp NB_SUPPRESS_WARNINGS wrapper.cpp)
target_compile_definitions(_basixcpp PRIVATE cxx_std_20)
target_link_libraries(_basixcpp PRIVATE Basix::basix)

# Add strict compiler flags
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wall -Werror -Wextra -Wno-comment -pedantic" HAVE_PEDANTIC)

check_cxx_compiler_flag("-Wall -Werror -Wextra -pedantic" HAVE_PEDANTIC)
if(HAVE_PEDANTIC)
target_compile_options(_basixcpp PRIVATE -Wall;-Wextra;-Werror;-Wno-comment)
target_compile_options(_basixcpp PRIVATE -Wall;-Werror;-Wextra;-Wno-comment;-pedantic)
endif()

# TODO: remove after issue https://github.com/FEniCS/basix/issues/842 is resolved
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.0.0"]
requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0"]
build-backend = "scikit_build_core.build"

[project]
Expand Down

0 comments on commit cbd03dc

Please sign in to comment.