add_subdirectory(dom)


include_directories( . linux )
link_libraries(simdjson-windows-headers test-data)
link_libraries(simdjson)
if(SIMDJSON_STATIC_REFLECTION)
  add_compile_definitions(SIMDJSON_STATIC_REFLECTION=1)
endif(SIMDJSON_STATIC_REFLECTION)

add_executable(benchfeatures benchfeatures.cpp)
add_executable(get_corpus_benchmark get_corpus_benchmark.cpp)

if (TARGET benchmark::benchmark)
  link_libraries(benchmark::benchmark)
  add_executable(bench_parse_call bench_parse_call.cpp)
  add_executable(bench_dom_api bench_dom_api.cpp)
  if(SIMDJSON_EXCEPTIONS)
    add_executable(bench_ondemand bench_ondemand.cpp)
    if(TARGET yyjson)
      target_link_libraries(bench_ondemand PRIVATE yyjson)
    endif()
    if(TARGET rapidjson)
      target_link_libraries(bench_ondemand PRIVATE rapidjson)
    endif()
    if(TARGET sajson)
      target_link_libraries(bench_ondemand PRIVATE sajson)
    endif()
    if(TARGET nlohmann_json)
      target_link_libraries(bench_ondemand PRIVATE nlohmann_json)
    endif()
    if(TARGET boostjson)
      target_link_libraries(bench_ondemand PRIVATE boostjson)
    endif()
  endif()
endif()


include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++20" SIMDJSON_COMPILER_SUPPORTS_CXX20)
if(SIMDJSON_STATIC_REFLECTION)
  add_subdirectory(static_reflect)
else()
  if(SIMDJSON_EXCEPTIONS AND SIMDJSON_COMPILER_SUPPORTS_CXX20)
    add_subdirectory(from)
    add_subdirectory(car_builder)
  endif()
endif(SIMDJSON_STATIC_REFLECTION)


