CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Disable warnings to avoid changing 3rd party code.
  2. if(CMAKE_C_COMPILER_ID MATCHES
  3. "^(GNU|LCC|Clang|AppleClang|IBMClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|NVHPC)$")
  4. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
  5. elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
  6. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
  7. endif()
  8. # Re-use some check result cache entries from cmcurl:
  9. # * HAVE_ARPA_INET_H (referenced in cmakeconfig.h.in)
  10. # * HAVE_NETINET_IN_H (referenced in cmakeconfig.h.in)
  11. # * HAVE_SIZEOF_SSIZE_T (referenced here)
  12. if(NOT HAVE_SIZEOF_SSIZE_T)
  13. set(ssize_t KWIML_INT_intptr_t)
  14. endif()
  15. configure_file(cmakeconfig.h.in config.h)
  16. add_library(cmnghttp2 STATIC
  17. lib/nghttp2_buf.c
  18. lib/nghttp2_callbacks.c
  19. lib/nghttp2_debug.c
  20. lib/nghttp2_frame.c
  21. lib/nghttp2_hd.c
  22. lib/nghttp2_hd_huffman.c
  23. lib/nghttp2_hd_huffman_data.c
  24. lib/nghttp2_helper.c
  25. lib/nghttp2_http.c
  26. lib/nghttp2_map.c
  27. lib/nghttp2_mem.c
  28. lib/nghttp2_npn.c
  29. lib/nghttp2_option.c
  30. lib/nghttp2_outbound_item.c
  31. lib/nghttp2_pq.c
  32. lib/nghttp2_priority_spec.c
  33. lib/nghttp2_queue.c
  34. lib/nghttp2_rcbuf.c
  35. lib/nghttp2_session.c
  36. lib/nghttp2_stream.c
  37. lib/nghttp2_submit.c
  38. lib/nghttp2_version.c
  39. )
  40. target_compile_definitions(cmnghttp2
  41. PUBLIC NGHTTP2_STATICLIB
  42. PRIVATE HAVE_CONFIG_H
  43. )
  44. target_include_directories(cmnghttp2 PRIVATE
  45. ${CMAKE_CURRENT_BINARY_DIR}
  46. ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
  47. )
  48. install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)