2017-05-06 17:55:19 +08:00
|
|
|
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
|
|
|
message(FATAL_ERROR "Folly only supports the x64 architecture.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
|
|
|
|
set(VCPKG_LIBRARY_LINKAGE static)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO facebook/folly
|
|
|
|
REF v2017.05.08.00
|
|
|
|
SHA512 1f689ec288e2a5de28223bddd68fdbb37c26c46ed9d9b831cacc46580788b9bf8eed151a043a4905172e509c70ed3d845689bf2c0cd45ce05fbe76907e2049aa
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch"
|
2017-05-06 17:55:19 +08:00
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-deps.patch"
|
2017-05-06 17:55:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL static)
|
|
|
|
set(MSVC_USE_STATIC_RUNTIME ON)
|
|
|
|
else()
|
|
|
|
set(MSVC_USE_STATIC_RUNTIME OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-05-06 17:55:19 +08:00
|
|
|
PREFER_NINJA
|
2017-05-06 17:55:19 +08:00
|
|
|
OPTIONS
|
|
|
|
-DMSVC_USE_STATIC_RUNTIME=${MSVC_USE_STATIC_RUNTIME}
|
|
|
|
)
|
|
|
|
|
2017-05-09 11:52:53 +08:00
|
|
|
# Folly runs built executables during the build, so they need access to the installed DLLs.
|
|
|
|
# TODO: Confirm it's ok that we aren't adding the debug/bin folder.
|
|
|
|
set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin")
|
|
|
|
|
2017-05-06 17:55:19 +08:00
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
vcpkg_fixup_cmake_targets()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/folly)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/folly/LICENSE ${CURRENT_PACKAGES_DIR}/share/folly/copyright)
|