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(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns) include(CheckCXXSourceRuns)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckIncludeFile) include(CheckIncludeFileCXX)
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckTypeSize) include(CheckTypeSize)
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
......
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
include(CheckIncludeFileCXX)
find_package(Boost 1.55.0 MODULE find_package(Boost 1.51.0 MODULE
COMPONENTS COMPONENTS
context context
chrono chrono
...@@ -12,17 +13,8 @@ find_package(Boost 1.55.0 MODULE ...@@ -12,17 +13,8 @@ find_package(Boost 1.55.0 MODULE
thread thread
REQUIRED REQUIRED
) )
set(FOLLY_SHINY_DEPENDENCIES list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES})
Boost::chrono list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
Boost::context
Boost::date_time
Boost::filesystem
Boost::program_options
Boost::regex
Boost::system
OpenSSL::SSL
OpenSSL::Crypto
)
find_package(DoubleConversion MODULE REQUIRED) find_package(DoubleConversion MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
...@@ -69,6 +61,8 @@ else() ...@@ -69,6 +61,8 @@ else()
endif() endif()
find_package(OpenSSL MODULE REQUIRED) find_package(OpenSSL MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR})
find_package(PThread MODULE) find_package(PThread MODULE)
set(FOLLY_HAVE_PTHREAD ${LIBPTHREAD_FOUND}) 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 # includes
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) 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") ...@@ -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. # 150+ tests in the root folder anyone? No? I didn't think so.
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(${PACKAGE_NAME} CXX) project(${PACKAGE_NAME} CXX C)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Check target architecture # Check target architecture
...@@ -363,7 +363,7 @@ if (BUILD_TESTS) ...@@ -363,7 +363,7 @@ if (BUILD_TESTS)
) )
target_link_libraries(folly_test_support target_link_libraries(folly_test_support
PUBLIC PUBLIC
Boost::thread ${BOOST_LIBRARIES}
follybenchmark follybenchmark
folly folly
${LIBGMOCK_LIBRARIES} ${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