Skip to content

Commit

Permalink
Add ENABLE_POLYGON_TO_CELLS_ASSERT to cmake options (#935)
Browse files Browse the repository at this point in the history
* Add ENABLE_POLYGON_TO_CELLS_ASSERT

* typo
  • Loading branch information
isaacbrodsky authored Oct 21, 2024
1 parent 5d5ad33 commit 09d96cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ option(BUILD_GENERATORS "Build code generation applications." ON)
# for afl++ is provided instead.
option(ENABLE_LIBFUZZER "Build fuzzers with libFuzzer support." OFF)

option(ENABLE_POLYGON_TO_CELLS_ASSERT "Build additional asserts into the polyfill algorithm for debugging." OFF)
mark_as_advanced(ENABLE_POLYGON_TO_CELLS_ASSERT)

# These options exist for integration with OSS-Fuzz, so that the fuzzer options
# can be passed through only to the fuzzer executables but not the H3 library,
# since passing those options to the library too may result in too many implementations
Expand Down Expand Up @@ -350,6 +353,9 @@ function(add_h3_library name h3_alloc_prefix_override)
if(ENABLE_COVERAGE)
target_compile_definitions(${name} PRIVATE H3_COVERAGE_TEST=1)
endif()
if(ENABLE_POLYGON_TO_CELLS_ASSERT)
target_compile_definitions(${name} PRIVATE H3_POLYGON_TO_CELLS_ASSERT=1)
endif()

target_compile_definitions(${name} PUBLIC H3_PREFIX=${H3_PREFIX})
target_compile_definitions(${name} PRIVATE BUILDING_H3=1)
Expand Down
6 changes: 6 additions & 0 deletions website/docs/core-library/compilation-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ Whether to enable using clang-tidy to lint source files when building. Only invo
[Makefile or Ninja CMake generators](https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html)
are used.

## ENABLE_POLYGON_TO_CELLS_ASSERT

Whether to enable additional debugging assertions in the `polygonToCells` functions. These are not compatible
with all tests and are intended for debugging only. It is not recommended to build release versions with
this flag because that configuration is not well tested.

## H3_ALLOC_PREFIX

Used for directing the library to use a [different set of functions for memory management](./custom-alloc).
Expand Down

0 comments on commit 09d96cd

Please sign in to comment.