You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

50 lines
1.5 KiB

  1. cmake_minimum_required (VERSION 2.8.8)
  2. project (BoringSSL)
  3. if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  4. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wshadow -Werror -ggdb -std=c89")
  5. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Werror -ggdb -std=c++0x")
  6. elseif(MSVC)
  7. # Disable warnings for implicit integer narrowing.
  8. set(CMAKE_C_FLAGS "/wd4267")
  9. set(CMAKE_CXX_FLAGS "/wd4267")
  10. endif()
  11. add_definitions(-DBORINGSSL_IMPLEMENTATION)
  12. if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
  13. set(ARCH "x86_64")
  14. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
  15. set(ARCH "x86_64")
  16. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
  17. # cmake reports AMD64 on Windows, but we might be building for 32-bit.
  18. if (CMAKE_CL_64)
  19. set(ARCH "x86_64")
  20. else()
  21. set(ARCH "x86")
  22. endif()
  23. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
  24. set(ARCH "x86")
  25. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
  26. set(ARCH "x86")
  27. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
  28. set(ARCH "x86")
  29. elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
  30. set(ARCH "arm")
  31. else()
  32. message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
  33. endif()
  34. if (${ARCH} STREQUAL "x86" AND APPLE)
  35. # With CMake 2.8.x, ${CMAKE_SYSTEM_PROCESSOR} evalutes to i386 on OS X,
  36. # but clang defaults to 64-bit builds on OS X unless otherwise told.
  37. # Set ARCH to x86_64 so clang and CMake agree. This is fixed in CMake 3.
  38. set(ARCH "x86_64")
  39. endif()
  40. add_subdirectory(crypto)
  41. add_subdirectory(ssl)
  42. add_subdirectory(ssl/test)
  43. add_subdirectory(tool)