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

Add ENABLE_POLYGON_TO_CELLS_ASSERT to cmake options #935

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
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
Loading