X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=CMakeLists.txt;h=c17760a2ed731b3d2c9e21cc81206a24c3d6f9d8;hp=030d1c7b6b1ce015b3a325ddde5e81b0a85ebef4;hb=b3e7df8220f410398011fea71b280ba8be459fcc;hpb=7e9117ad80bc5a5402d71a4e036e404f087adc68 diff --git a/CMakeLists.txt b/CMakeLists.txt index 030d1c7b..c17760a2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,10 @@ cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR) # the alternatives are far, far worse. if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio 15( 2017)? Win64") set(CMAKE_GENERATOR_TOOLSET "v141truev141") + set(MSVC_IS_2017 ON) elseif ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 14 2015 Win64") set(CMAKE_GENERATOR_TOOLSET "v140truev140") + set(MSVC_IS_2017 OFF) else() message(FATAL_ERROR "This build script only supports building Folly on 64-bit Windows with Visual Studio 2015 or Visual Studio 2017.") endif() @@ -62,6 +64,11 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/folly/build/ COMMENT "Generating the group varint tables..." VERBATIM ) + +include(folly-deps) # Find the required packages +if (LIBPTHREAD_FOUND) + set(FOLLY_HAVE_PTHREAD ON) +endif() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CMake/folly-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h @@ -125,14 +132,12 @@ source_group("folly\\build" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/build/GroupVarintTables.cpp ) -include(folly-deps) # Find the required packages target_include_directories(folly_base PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR} ${LIBGFLAGS_INCLUDE_DIR} ${LIBGLOG_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR} - ${LIBPTHREAD_INCLUDE_DIRS} ) target_link_libraries(folly_base PUBLIC @@ -147,11 +152,14 @@ target_link_libraries(folly_base ${LIBEVENT_LIB} ${LIBGFLAGS_LIBRARY} ${LIBGLOG_LIBRARY} - ${LIBPTHREAD_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto Ws2_32.lib ) +if (FOLLY_HAVE_PTHREAD) + target_include_directories(folly_base PUBLIC ${LIBPTHREAD_INCLUDE_DIRS}) + target_link_libraries(folly_base PUBLIC ${LIBPTHREAD_LIBRARIES}) +endif() # Now to generate the fingerprint tables add_executable(GenerateFingerprintTables @@ -255,6 +263,10 @@ if (BUILD_TESTS) ${FOLLY_DIR}/io/async/test/UndelayedDestruction.h ${FOLLY_DIR}/io/async/test/Util.h ) + target_compile_definitions(folly_test_support + PUBLIC + ${LIBGMOCK_DEFINES} + ) target_include_directories(folly_test_support PUBLIC ${LIBGMOCK_INCLUDE_DIR}