Tue, 04 Oct 2022 19:25:07 +0200
fix over-optimization of strstr
1. it's actually less performant to frequently read bytes
from an array instead of using the native word length
2. the SBO buffer should be local and not static to allow
multi-threading usage
cmake_minimum_required(VERSION 3.14) project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions") # Configuration set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED 99) option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF) if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC) add_compile_options(-Wall -Wextra -pedantic) endif() # Library add_subdirectory(src) # Tests enable_testing() add_subdirectory(test) # Web Documentation add_subdirectory(docs/src) # API Documentation message(CHECK_START "Seaching for Doxygen") find_package(Doxygen) if(DOXYGEN_FOUND) message(CHECK_PASS "found.") else() message(CHECK_FAIL "not found - documentation will not be generated.") endif() option(BUILD_API_DOC "Create API documentation." ON) if(BUILD_API_DOC AND DOXYGEN_FOUND) set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src/cx) set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs) set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png) configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile) add_custom_target(docs-api-21 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Copying UCX 2.1 API documentation.") add_custom_target(docs-api COMMAND ${DOXYGEN_EXECUTABLE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Generating API documentation with Doxygen.") add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21) else() add_custom_target(docs-all DEPENDS docs-html) endif()