Skip to content

Commit

Permalink
Suppress nanobind compiler warnings (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jul 25, 2024
1 parent 4c5dc61 commit 42eb9b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ if(BUILD_PYTHON)
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
# master on 2024-07-24
GIT_TAG 68265d36f89a825f0db930fbc77bb57bdd8d6dfe
PATCH_COMMAND
git apply
${CMAKE_CURRENT_SOURCE_DIR}/cmake/0001-Replace-zero-size-array.patch
UPDATE_DISCONNECTED 1
)
fetchcontent_makeavailable(nanobind)
else()
Expand All @@ -310,9 +306,18 @@ if(BUILD_PYTHON)
target_link_libraries(_jormungandr PUBLIC Threads::Threads Eigen3::Eigen)

# Suppress compiler warnings in nanobind
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
# nanobind/include/nanobind/nb_attr.h:212:14: warning: ISO C++ forbids zero-size array
# 212 | arg_data args[Size];
# | ^~~~
target_compile_options(_jormungandr PRIVATE -Wno-pedantic)
endif()
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
target_compile_options(nanobind-static PRIVATE -Wno-array-bounds)
target_compile_options(_jormungandr PRIVATE -Wno-nested-anon-types)
target_compile_options(
_jormungandr
PRIVATE -Wno-nested-anon-types -Wno-zero-length-array
)
endif()

install(
Expand Down
27 changes: 0 additions & 27 deletions cmake/0001-Replace-zero-size-array.patch

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ include = [
"CMakeLists.txt",
"SleipnirConfig.cmake.in",
"cmake/modules/*.cmake",
"cmake/*.patch",
"cmake/*.py",
"jormungandr/*",
"include/*",
Expand Down

0 comments on commit 42eb9b1

Please sign in to comment.