diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-05-09 21:35:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-09 21:35:07 -0700 |
| commit | 181099fecc71a301953560dcfbcd9a1e45cc4422 (patch) | |
| tree | cc23e448c7abf02aa317f4f13a0d2701ebce6c81 | |
| parent | 8c38bf62d62e2b77bdbdc01b579091f84bdc7fb0 (diff) | |
| parent | 861d7976d6a6e194c3a24ea4f5824746a7934ce3 (diff) | |
| download | vcpkg-181099fecc71a301953560dcfbcd9a1e45cc4422.tar.gz vcpkg-181099fecc71a301953560dcfbcd9a1e45cc4422.zip | |
Merge pull request #1059 from KindDragon/folly
[folly] Use Ninja to build Folly
| -rw-r--r-- | ports/folly/CONTROL | 2 | ||||
| -rw-r--r-- | ports/folly/fix-generators.patch | 36 | ||||
| -rw-r--r-- | ports/folly/portfile.cmake | 7 |
3 files changed, 44 insertions, 1 deletions
diff --git a/ports/folly/CONTROL b/ports/folly/CONTROL index 754bebb67..f9a4a4329 100644 --- a/ports/folly/CONTROL +++ b/ports/folly/CONTROL @@ -1,4 +1,4 @@ Source: folly -Version: v2017.05.08.00 +Version: v2017.05.08.00-2 Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows Build-Depends: zlib, openssl, boost, libevent, double-conversion, glog, gflags, lz4, liblzma, snappy diff --git a/ports/folly/fix-generators.patch b/ports/folly/fix-generators.patch new file mode 100644 index 000000000..e774b8c6b --- /dev/null +++ b/ports/folly/fix-generators.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4c796ea..684f48f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,13 +1,5 @@ + cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR) + +-if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio 15( 2017)? Win64") +- set(MSVC_IS_2017 ON) +-elseif ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 14 2015 Win64") +- 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() +- + # includes + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -24,10 +16,14 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + + project(${PACKAGE_NAME} CXX) + +-# Check architecture OS +-if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8) +- message(FATAL_ERROR "Folly requires a 64bit OS") ++if (NOT MSVC_VERSION LESS 1910) ++ set(MSVC_IS_2017 ON) ++elseif (NOT MSVC_VERSION LESS 1900) ++ 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() ++ + if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + message(FATAL_ERROR "You should only be using CMake to build Folly if you are on Windows!") + endif() diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake index 8f36fb160..8f033cbfc 100644 --- a/ports/folly/portfile.cmake +++ b/ports/folly/portfile.cmake @@ -9,6 +9,11 @@ endif() include(vcpkg_common_functions) +# Required to run build/generate_escape_tables.py et al. +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${PYTHON3_DIR}") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebook/folly @@ -20,6 +25,7 @@ vcpkg_from_github( vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-generators.patch" ) if(VCPKG_CRT_LINKAGE STREQUAL static) @@ -30,6 +36,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DMSVC_USE_STATIC_RUNTIME=${MSVC_USE_STATIC_RUNTIME} ) |
