Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

101 wiersze
4.1 KiB

  1. cmake_minimum_required (VERSION 2.8.10)
  2. project (BoringSSL)
  3. if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  4. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -ggdb -fvisibility=hidden")
  5. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -ggdb -std=c++0x -fvisibility=hidden")
  6. elseif(MSVC)
  7. set(MSVC_DISABLED_WARNINGS_LIST
  8. "C4100" # 'exarg' : unreferenced formal parameter
  9. "C4127" # conditional expression is constant
  10. "C4200" # nonstandard extension used : zero-sized array in
  11. # struct/union.
  12. "C4242" # 'function' : conversion from 'int' to 'uint8_t',
  13. # possible loss of data
  14. "C4244" # 'function' : conversion from 'int' to 'uint8_t',
  15. # possible loss of data
  16. "C4245" # 'initializing' : conversion from 'long' to
  17. # 'unsigned long', signed/unsigned mismatch
  18. "C4296" # '>=' : expression is always true
  19. "C4350" # behavior change: 'std::_Wrap_alloc...'
  20. "C4365" # '=' : conversion from 'size_t' to 'int',
  21. # signed/unsigned mismatch
  22. "C4389" # '!=' : signed/unsigned mismatch
  23. "C4510" # 'argument' : default constructor could not be generated
  24. "C4512" # 'argument' : assignment operator could not be generated
  25. "C4514" # 'function': unreferenced inline function has been removed
  26. "C4548" # expression before comma has no effect; expected expression with
  27. # side-effect" caused by FD_* macros.
  28. "C4610" # struct 'argument' can never be instantiated - user defined
  29. # constructor required.
  30. "C4701" # potentially uninitialized local variable 'mdlen' used
  31. "C4706" # assignment within conditional expression
  32. "C4710" # 'function': function not inlined
  33. "C4711" # function 'function' selected for inline expansion
  34. "C4800" # 'int' : forcing value to bool 'true' or 'false'
  35. # (performance warning)
  36. "C4820" # 'bytes' bytes padding added after construct 'member_name'
  37. "C4996" # 'read': The POSIX name for this item is deprecated. Instead,
  38. # use the ISO C++ conformant name: _read.
  39. )
  40. string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
  41. ${MSVC_DISABLED_WARNINGS_LIST})
  42. set(CMAKE_C_FLAGS "-Wall -WX ${MSVC_DISABLED_WARNINGS_STR}")
  43. set(CMAKE_CXX_FLAGS "-Wall -WX ${MSVC_DISABLED_WARNINGS_STR}")
  44. add_definitions(-D_HAS_EXCEPTIONS=0)
  45. add_definitions(-DWIN32_LEAN_AND_MEAN)
  46. endif()
  47. if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.5.99") OR
  48. CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  49. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
  50. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
  51. endif()
  52. add_definitions(-DBORINGSSL_IMPLEMENTATION)
  53. if (BUILD_SHARED_LIBS)
  54. add_definitions(-DBORINGSSL_SHARED_LIBRARY)
  55. # Enable position-independent code globally. This is needed because
  56. # some library targets are OBJECT libraries.
  57. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
  58. endif()
  59. if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
  60. set(ARCH "x86_64")
  61. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
  62. set(ARCH "x86_64")
  63. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
  64. # cmake reports AMD64 on Windows, but we might be building for 32-bit.
  65. if (CMAKE_CL_64)
  66. set(ARCH "x86_64")
  67. else()
  68. set(ARCH "x86")
  69. endif()
  70. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
  71. set(ARCH "x86")
  72. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
  73. set(ARCH "x86")
  74. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
  75. set(ARCH "x86")
  76. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
  77. set(ARCH "arm")
  78. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
  79. set(ARCH "aarch64")
  80. else()
  81. message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
  82. endif()
  83. if (${ARCH} STREQUAL "x86" AND APPLE)
  84. # With CMake 2.8.x, ${CMAKE_SYSTEM_PROCESSOR} evalutes to i386 on OS X,
  85. # but clang defaults to 64-bit builds on OS X unless otherwise told.
  86. # Set ARCH to x86_64 so clang and CMake agree. This is fixed in CMake 3.
  87. set(ARCH "x86_64")
  88. endif()
  89. add_subdirectory(crypto)
  90. add_subdirectory(ssl)
  91. add_subdirectory(ssl/test)
  92. add_subdirectory(tool)