Commit 29a859ad authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: update to work with CMake 3.2.2

Summary:
Update the CMake build scripts to work with CMake 3.2.2, as well as older boost
libraries.

Several other open source Facebook projects have CI that checks that the code
builds with modified Ubuntu 14.04 systems (Ubuntu 14.04 + gcc 4.9 +
CMake 3.2.2).  By default Ubuntu 14.04 ships with gcc 4.8.2 and CMake 2.8; we
do not support vanilla Ubuntu 14.04.

Reviewed By: yfeldblum

Differential Revision: D6806326

fbshipit-source-id: 243f2f9cea20c7a9430dc386c921e3cafeee77f7
parent f3929d8e
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CheckCXXCompilerFlag)
......
include(CheckCXXSourceCompiles)
include(CheckIncludeFileCXX)
find_package(Boost 1.55.0 MODULE
find_package(Boost 1.51.0 MODULE
COMPONENTS
context
chrono
......@@ -12,17 +13,8 @@ find_package(Boost 1.55.0 MODULE
thread
REQUIRED
)
set(FOLLY_SHINY_DEPENDENCIES
Boost::chrono
Boost::context
Boost::date_time
Boost::filesystem
Boost::program_options
Boost::regex
Boost::system
OpenSSL::SSL
OpenSSL::Crypto
)
list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
find_package(DoubleConversion MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
......@@ -69,6 +61,8 @@ else()
endif()
find_package(OpenSSL MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR})
find_package(PThread MODULE)
set(FOLLY_HAVE_PTHREAD ${LIBPTHREAD_FOUND})
......
cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
# includes
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
......@@ -14,7 +14,7 @@ set(PACKAGE_BUGREPORT "https://github.com/facebook/folly/issues")
# 150+ tests in the root folder anyone? No? I didn't think so.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(${PACKAGE_NAME} CXX)
project(${PACKAGE_NAME} CXX C)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Check target architecture
......@@ -363,7 +363,7 @@ if (BUILD_TESTS)
)
target_link_libraries(folly_test_support
PUBLIC
Boost::thread
${BOOST_LIBRARIES}
follybenchmark
folly
${LIBGMOCK_LIBRARIES}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment