From 7a324da5485528ea80d4dca45997e726a09b1d5d Mon Sep 17 00:00:00 2001 From: John Keiser Date: Fri, 5 Feb 2021 13:34:52 -0800 Subject: [PATCH] Add -DSIMDJSON_PRODUCTION flag --- cmake/simdjson-flags.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/simdjson-flags.cmake b/cmake/simdjson-flags.cmake index e777ab86d..91d7718c2 100644 --- a/cmake/simdjson-flags.cmake +++ b/cmake/simdjson-flags.cmake @@ -172,11 +172,13 @@ endif() # # Other optional flags # -option(SIMDJSON_API_USAGE_CHECKS "Validate ondemand user code at runtime to ensure it is being used correctly. Turning this off disables some checks that have a small performance impact. Defaults to ON." ON) -if(SIMDJSON_API_USAGE_CHECKS) - message(STATUS "Ondemand safety rails enabled. Ondemand user code will be checked at runtime. Turn this on for production to get maximum performance!") +option(SIMDJSON_PRODUCTION "Optimize for production by disabling development-time aids, such as checks for incorrect API usage." OFF) +if(SIMDJSON_PRODUCTION) + message(STATUS "SIMDJSON_PRODUCTION is ON: optimizing for production by disabling development-time aids, such as checks for incorrect API usage.") +else() + message(STATUS "Development-time aids enabled. Use cmake -DSIMDJSON_PRODUCTION=ON to disable development-time aids, such as checks for incorrect API usage.") target_compile_definitions(simdjson-flags INTERFACE SIMDJSON_API_USAGE_CHECKS=1) -endif(SIMDJSON_API_USAGE_CHECKS) +endif() option(SIMDJSON_BASH "Allow usage of bash within CMake" ON)