2014-08-15 02:41:02 +01:00
|
|
|
cmake_minimum_required (VERSION 2.8.8)
|
2014-06-20 20:00:00 +01:00
|
|
|
|
|
|
|
project (BoringSSL)
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -ggdb -std=c89")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -ggdb -std=c++0x")
|
|
|
|
elseif(MSVC)
|
|
|
|
# Disable warnings for implicit integer narrowing.
|
|
|
|
set(CMAKE_C_FLAGS "/wd4267")
|
2014-10-31 20:01:29 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "/wd4267")
|
2014-06-20 20:00:00 +01:00
|
|
|
endif()
|
|
|
|
|
2014-07-31 00:02:14 +01:00
|
|
|
add_definitions(-DBORINGSSL_IMPLEMENTATION)
|
|
|
|
|
2014-06-20 20:00:00 +01:00
|
|
|
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
|
|
|
set(ARCH "x86_64")
|
2014-07-31 11:09:49 +01:00
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
|
|
|
|
set(ARCH "x86_64")
|
2014-06-20 20:00:00 +01:00
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
|
|
|
|
# cmake reports AMD64 on Windows, but we might be building for 32-bit.
|
|
|
|
if (CMAKE_CL_64)
|
|
|
|
set(ARCH "x86_64")
|
|
|
|
else()
|
|
|
|
set(ARCH "x86")
|
|
|
|
endif()
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
|
|
|
|
set(ARCH "x86")
|
2014-07-31 11:09:49 +01:00
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
|
|
|
set(ARCH "x86")
|
2014-08-11 21:27:44 +01:00
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
|
|
|
|
set(ARCH "x86")
|
2014-06-20 20:00:00 +01:00
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
|
|
|
|
set(ARCH "arm")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(crypto)
|
|
|
|
add_subdirectory(ssl)
|
|
|
|
add_subdirectory(ssl/test)
|
|
|
|
add_subdirectory(tool)
|