llhttp_build.cmake 774 B

123456789101112131415161718192021
  1. macro( clone_llhttp )
  2. find_package( Git REQUIRED )
  3. message( "Cloning submodule llhttp." )
  4. execute_process( COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${LLHTTP_DIR}
  5. WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  6. RESULT_VARIABLE LLHTTP_CLONE_RESULT )
  7. if( NOT ${LLHTTP_CLONE_RESULT} STREQUAL "0" )
  8. message( FATAL_ERROR "Failed to clone llhttp submodule." )
  9. endif()
  10. endmacro()
  11. # llhttp library target.
  12. add_library( llhttp
  13. ${LLHTTP_DIR}/src/api.c
  14. ${LLHTTP_DIR}/src/http.c
  15. ${LLHTTP_DIR}/src/llhttp.c )
  16. # llhttp public include path.
  17. target_include_directories( llhttp PUBLIC
  18. ${LLHTTP_DIR}/include )