mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-06-08 08:13:49 +00:00
Make RECASTNAVIGATION_ENABLE_ASSERTS do what it looks like it does (#806)
This commit is contained in:
@@ -15,7 +15,7 @@ option(RECASTNAVIGATION_TESTS "Build tests" ON)
|
||||
option(RECASTNAVIGATION_EXAMPLES "Build examples" ON)
|
||||
option(RECASTNAVIGATION_DT_POLYREF64 "Use 64bit polyrefs instead of 32bit for Detour" OFF)
|
||||
option(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER "Use dynamic dispatch for dtQueryFilter in Detour to allow for custom filters" OFF)
|
||||
option(RECASTNAVIGATION_ENABLE_ASSERTS "Enable custom recastnavigation asserts" "$<IF:$<CONFIG:Debug>,ON,OFF>")
|
||||
set(RECASTNAVIGATION_ENABLE_ASSERTS "$<CONFIG:Debug>" CACHE STRING "Condition to enable custom recastnavigation asserts, evaluated as generator expression")
|
||||
option(RECASTNAVIGATION_ENABLE_FAST_MATH "Enable faster math calculations." OFF)
|
||||
|
||||
# dll export
|
||||
@@ -62,9 +62,6 @@ if(NOT MSVC)
|
||||
add_compile_options(-g)
|
||||
endif()
|
||||
|
||||
# Release optimizations and disable asserts
|
||||
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:RC_DISABLE_ASSERTS>)
|
||||
|
||||
configure_file(
|
||||
"${RecastNavigation_SOURCE_DIR}/version.h.in"
|
||||
"${RecastNavigation_BINARY_DIR}/version.h")
|
||||
|
||||
@@ -22,9 +22,7 @@ if (RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
target_compile_definitions(Detour PUBLIC DT_VIRTUAL_QUERYFILTER)
|
||||
endif()
|
||||
|
||||
if (NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
target_compile_definitions(Detour PUBLIC RC_DISABLE_ASSERTS)
|
||||
endif()
|
||||
target_compile_definitions(Detour PUBLIC "$<$<NOT:${RECASTNAVIGATION_ENABLE_ASSERTS}>:RC_DISABLE_ASSERTS>")
|
||||
|
||||
# Set include path
|
||||
set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
@@ -19,9 +19,7 @@ target_include_directories(Recast PUBLIC
|
||||
"$<BUILD_INTERFACE:${Recast_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
if (NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
target_compile_definitions(Recast PUBLIC RC_DISABLE_ASSERTS)
|
||||
endif()
|
||||
target_compile_definitions(Recast PUBLIC "$<$<NOT:${RECASTNAVIGATION_ENABLE_ASSERTS}>:RC_DISABLE_ASSERTS>")
|
||||
|
||||
install(TARGETS Recast
|
||||
EXPORT recastnavigation-targets
|
||||
|
||||
Reference in New Issue
Block a user