aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-10-17 14:44:16 -0700
committerGitHub <noreply@github.com>2017-10-17 14:44:16 -0700
commitafe2028b754deb35a6ccf824a08abb6989b82e5d (patch)
treef3ff61df9e6451bb51d509e788d591780c875133
parente2163df1c24f65b35c62e191b6dc6e0c661441ce (diff)
parentae3fe7cd16c82b794d5074104cf078afc1a12c7d (diff)
downloadvcpkg-afe2028b754deb35a6ccf824a08abb6989b82e5d.tar.gz
vcpkg-afe2028b754deb35a6ccf824a08abb6989b82e5d.zip
Merge pull request #1453 from muemart/boost
Build Boost with ICU and Python
-rw-r--r--ports/boost/0001-Fix-boost-ICU-support.patch166
-rw-r--r--ports/boost/CONTROL14
-rw-r--r--ports/boost/desktop/user-config.jam31
-rw-r--r--ports/boost/portfile.cmake58
-rw-r--r--ports/boost/uwp/user-config.jam8
-rw-r--r--toolsrc/src/vcpkg/install.cpp3
6 files changed, 267 insertions, 13 deletions
diff --git a/ports/boost/0001-Fix-boost-ICU-support.patch b/ports/boost/0001-Fix-boost-ICU-support.patch
new file mode 100644
index 000000000..1952f5a64
--- /dev/null
+++ b/ports/boost/0001-Fix-boost-ICU-support.patch
@@ -0,0 +1,166 @@
+---
+ libs/locale/build/Jamfile.v2 | 63 ++++++--------------------------------
+ libs/locale/build/has_icu_test.cpp | 4 ---
+ libs/regex/build/Jamfile.v2 | 47 +++++++---------------------
+ 3 files changed, 20 insertions(+), 94 deletions(-)
+
+diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2
+index 578e722..5f25917 100644
+--- a/libs/locale/build/Jamfile.v2
++++ b/libs/locale/build/Jamfile.v2
+@@ -70,62 +70,17 @@ if $(ICU_LINK)
+ }
+ else
+ {
+- searched-lib icuuc : : <name>icuuc
+- <search>$(ICU_PATH)/lib
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icuuc : : <toolset>msvc
+- <variant>debug
+- <name>icuucd
+- <search>$(ICU_PATH)/lib
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icuuc : : <name>this_is_an_invalid_library_name ;
+-
+- searched-lib icudt : : <search>$(ICU_PATH)/lib
+- <name>icudata
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icudt : : <search>$(ICU_PATH)/lib
+- <name>icudt
+- <toolset>msvc
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icudt : : <name>this_is_an_invalid_library_name ;
+-
+- searched-lib icuin : : <search>$(ICU_PATH)/lib
+- <name>icui18n
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icuin : : <toolset>msvc
+- <variant>debug
+- <name>icuind
+- <search>$(ICU_PATH)/lib
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icuin : : <toolset>msvc
+- <variant>release
+- <name>icuin
+- <search>$(ICU_PATH)/lib
+- <link>shared
+- <runtime-link>shared ;
+-
+- searched-lib icuin : : <name>this_is_an_invalid_library_name ;
+-
+- explicit icuuc icudt icuin ;
++ alias icuuc : /user-config//icuuc ;
++ alias icuin : /user-config//icuin ;
++ alias icudt : /user-config//icudt ;
++
++ explicit icuuc icuin icudt ;
+
+ ICU_OPTS = <include>$(ICU_PATH)/include
+- <library>icuuc/<link>shared/<runtime-link>shared
+- <library>icudt/<link>shared/<runtime-link>shared
+- <library>icuin/<link>shared/<runtime-link>shared
+- <dll-path>$(ICU_PATH)/bin
+- <runtime-link>shared ;
++ <library>icuuc
++ <library>icuin
++ <library>icudt
++ <dll-path>$(ICU_PATH)/bin ;
+
+
+
+diff --git a/libs/locale/build/has_icu_test.cpp b/libs/locale/build/has_icu_test.cpp
+index 9419b30..ed9be05 100644
+--- a/libs/locale/build/has_icu_test.cpp
++++ b/libs/locale/build/has_icu_test.cpp
+@@ -15,10 +15,6 @@
+ #include <unicode/uchar.h>
+ #include <unicode/coll.h>
+
+-#if defined(_MSC_VER) && !defined(_DLL)
+-#error "Mixing ICU with a static runtime doesn't work"
+-#endif
+-
+ int main()
+ {
+ icu::Locale loc;
+diff --git a/libs/regex/build/Jamfile.v2 b/libs/regex/build/Jamfile.v2
+index 58fd1fb..76ee9f4 100644
+--- a/libs/regex/build/Jamfile.v2
++++ b/libs/regex/build/Jamfile.v2
+@@ -48,50 +48,25 @@ if ! $(disable-icu)
+ }
+ else
+ {
+- lib icuuc : : <runtime-link>shared <conditional>@path_options ;
+- lib icuuc : : <toolset>msvc <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
+- lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
+- lib icuuc : : <name>sicuuc <runtime-link>static <conditional>@path_options ;
+- lib icuuc : : <toolset>msvc <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
+- lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
+- lib icuuc : : <name>this_is_an_invalid_library_name ;
+-
+- lib icudt : : <name>icudata <runtime-link>shared <conditional>@path_options ;
+- lib icudt : : <name>icudt <toolset>msvc <runtime-link>shared <conditional>@path_options ;
+- lib icudt : : <name>icudt <toolset>intel <target-os>windows <runtime-link>shared <conditional>@path_options ;
+- lib icudt : : <name>sicudata <runtime-link>static <conditional>@path_options ;
+- lib icudt : : <name>sicudt <toolset>msvc <runtime-link>static <conditional>@path_options ;
+- lib icudt : : <name>sicudt <toolset>intel <target-os>windows <runtime-link>static <conditional>@path_options ;
+- lib icudt : : <name>this_is_an_invalid_library_name ;
+-
+- lib icuin : : <name>icui18n <runtime-link>shared <conditional>@path_options ;
+- lib icuin : : <toolset>msvc <variant>debug <name>icuind <runtime-link>shared <conditional>@path_options ;
+- lib icuin : : <toolset>msvc <name>icuin <runtime-link>shared <conditional>@path_options ;
+- lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>icuind <runtime-link>shared <conditional>@path_options ;
+- lib icuin : : <toolset>intel <target-os>windows <name>icuin <runtime-link>shared <conditional>@path_options ;
+- lib icuin : : <name>sicui18n <runtime-link>static <conditional>@path_options ;
+- lib icuin : : <toolset>msvc <variant>debug <name>sicuind <runtime-link>static <conditional>@path_options ;
+- lib icuin : : <toolset>msvc <name>sicuin <runtime-link>static <conditional>@path_options ;
+- lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>sicuind <runtime-link>static <conditional>@path_options ;
+- lib icuin : : <toolset>intel <target-os>windows <name>sicuin <runtime-link>static <conditional>@path_options ;
+- lib icuin : : <name>this_is_an_invalid_library_name ;
++
++ alias icuuc : /user-config//icuuc ;
++ alias icuin : /user-config//icuin ;
++ alias icudt : /user-config//icudt ;
++
++ explicit icuuc icuin icudt ;
+
+ ICU_OPTS =
+ <include>$(ICU_PATH)/include
+- <runtime-link>shared:<library>icuuc/<link>shared
+- <runtime-link>shared:<library>icudt/<link>shared
+- <runtime-link>shared:<library>icuin/<link>shared
+- <runtime-link>static:<library>icuuc
+- <runtime-link>static:<library>icudt
+- <runtime-link>static:<library>icuin
+- <define>BOOST_HAS_ICU=1
+- <runtime-link>static:<define>U_STATIC_IMPLEMENTATION=1
++ <library>icuuc
++ <library>icudt
++ <library>icuin
++ <define>BOOST_HAS_ICU=1
+ ;
+ }
+
+ }
+
+-unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
++exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
+ explicit has_icu ;
+
+ alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;
+--
+2.12.2.windows.2
+
diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL
index 4fc7efdec..a5da89a5a 100644
--- a/ports/boost/CONTROL
+++ b/ports/boost/CONTROL
@@ -1,4 +1,16 @@
Source: boost
-Version: 1.65.1
+Version: 1.65.1-1
Description: Peer-reviewed portable C++ source libraries
Build-Depends: zlib, bzip2
+
+Feature: locale-icu
+Description: ICU backend for Boost.Locale
+Build-Depends: icu
+
+Feature: regex-icu
+Description: ICU support for Boost.Regex
+Build-Depends: icu
+
+Feature: python
+Description: a C++ library which enables seamless interoperability between C++ and the Python programming language.
+Build-Depends: python3
diff --git a/ports/boost/desktop/user-config.jam b/ports/boost/desktop/user-config.jam
index 8faba6d72..83206c098 100644
--- a/ports/boost/desktop/user-config.jam
+++ b/ports/boost/desktop/user-config.jam
@@ -5,3 +5,34 @@ using msvc : 14.0 : cl.exe :
using msvc : 14.1 : cl.exe :
<setup>echo
;
+
+using python : @PYTHON_VERSION@ : : @PYTHON_INCLUDE_PATH@ : @PYTHONLIBS_RELEASE@ ;
+using python : @PYTHON_VERSION@ : : @PYTHON_INCLUDE_PATH@ : @PYTHONLIBS_DEBUG@ : <python-debugging>on ;
+
+project user-config ;
+lib advapi32 ;
+lib icuuc : : <search>@CURRENT_INSTALLED_DIR@/lib : :
+ <runtime-link>@LIB_RUNTIME_LINK@
+ <library>advapi32 ;
+
+lib icuuc : : <search>@CURRENT_INSTALLED_DIR@/debug/lib
+ <variant>debug
+ <name>icuucd : :
+ <runtime-link>@LIB_RUNTIME_LINK@
+ <library>advapi32 ;
+
+lib icuin : : <search>@CURRENT_INSTALLED_DIR@/lib : :
+ <runtime-link>@LIB_RUNTIME_LINK@ ;
+
+lib icuin : : <search>@CURRENT_INSTALLED_DIR@/debug/lib
+ <variant>debug
+ <name>icuind : :
+ <runtime-link>@LIB_RUNTIME_LINK@ ;
+
+lib icudt : : <search>@CURRENT_INSTALLED_DIR@/lib : :
+ <runtime-link>@LIB_RUNTIME_LINK@ ;
+
+lib icudt : : <search>@CURRENT_INSTALLED_DIR@/debug/lib
+ <variant>debug
+ <name>icudtd : :
+ <runtime-link>@LIB_RUNTIME_LINK@ ; \ No newline at end of file
diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake
index f153aaf69..b0699eaa2 100644
--- a/ports/boost/portfile.cmake
+++ b/ports/boost/portfile.cmake
@@ -25,7 +25,8 @@ FILE(READ "${DIFF}" content)
STRING(REGEX REPLACE "include/" "" content "${content}")
set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed)
FILE(WRITE ${DIFF2} "${content}")
-vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2})
+vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2}
+ ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-boost-ICU-support.patch)
######################
# Cleanup previous builds
@@ -76,19 +77,36 @@ message(STATUS "Bootstrapping done")
set(B2_OPTIONS
-sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include"
-sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}\\include"
+ -sICU_PATH="${CURRENT_INSTALLED_DIR}"
-j$ENV{NUMBER_OF_PROCESSORS}
--debug-configuration
--hash
-q
- --without-python
threading=multi
)
+# Add build type specific options
+set(B2_OPTIONS_DBG
+ -sZLIB_BINARY=zlibd
+ -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib"
+ -sBZIP2_BINARY=bz2d
+ -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib"
+)
+
+set(B2_OPTIONS_REL
+ -sZLIB_BINARY=zlib
+ -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib"
+ -sBZIP2_BINARY=bz2
+ -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib"
+)
+
+set(LIB_RUNTIME_LINK "shared")
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
list(APPEND B2_OPTIONS runtime-link=shared)
else()
list(APPEND B2_OPTIONS runtime-link=static)
+ set(LIB_RUNTIME_LINK "static")
endif()
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
@@ -101,6 +119,30 @@ if(TRIPLET_SYSTEM_ARCH MATCHES "x64")
list(APPEND B2_OPTIONS address-model=64)
endif()
+if("python" IN_LIST FEATURES)
+ # Find Python. Can't use find_package here, but we already know where everything is
+ file(GLOB PYTHON_INCLUDE_PATH "${CURRENT_INSTALLED_DIR}/include/python[0-9.]*")
+ set(PYTHONLIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
+ set(PYTHONLIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
+ string(REGEX REPLACE ".*python([0-9\.]+)$" "\\1" PYTHON_VERSION ${PYTHON_INCLUDE_PATH})
+ list(APPEND B2_OPTIONS_DBG python-debugging=on)
+else()
+ list(APPEND B2_OPTIONS --without-python)
+endif()
+
+if("locale-icu" IN_LIST FEATURES)
+ list(APPEND B2_OPTIONS boost.locale.icu=on)
+else()
+ list(APPEND B2_OPTIONS boost.locale.icu=off)
+endif()
+
+if("regex-icu" IN_LIST FEATURES)
+ list(APPEND B2_OPTIONS --enable-icu)
+else()
+ list(APPEND B2_OPTIONS --disable-icu)
+endif()
+
+
if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
list(APPEND B2_OPTIONS
windows-api=store
@@ -136,6 +178,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
--without-thread
--without-iostreams
--without-container
+ --without-python
)
if(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
find_path(PATH_TO_CL cl.exe)
@@ -166,21 +209,14 @@ else()
message(FATAL_ERROR "Unsupported value for VCPKG_PLATFORM_TOOLSET: '${VCPKG_PLATFORM_TOOLSET}'")
endif()
-# Add build type specific options
set(B2_OPTIONS_DBG
${B2_OPTIONS}
- -sZLIB_BINARY=zlibd
- -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib"
- -sBZIP2_BINARY=bz2d
- -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib"
+ ${B2_OPTIONS_DBG}
)
set(B2_OPTIONS_REL
${B2_OPTIONS}
- -sZLIB_BINARY=zlib
- -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib"
- -sBZIP2_BINARY=bz2
- -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib"
+ ${B2_OPTIONS_REL}
)
######################
diff --git a/ports/boost/uwp/user-config.jam b/ports/boost/uwp/user-config.jam
index 88e7c5974..975b1d412 100644
--- a/ports/boost/uwp/user-config.jam
+++ b/ports/boost/uwp/user-config.jam
@@ -13,3 +13,11 @@ using msvc : 14.1 : cl.exe :
<linkflags>RuntimeObject.lib
<linkflags>ole32.lib
;
+
+project user-config ;
+
+lib icuuc : : <name>dummy_lib_that_doesnt_exist ;
+
+lib icuin : : <name>dummy_lib_that_doesnt_exist ;
+
+lib icudt : : <name>dummy_lib_that_doesnt_exist ; \ No newline at end of file
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp
index adbd8c943..70757ff38 100644
--- a/toolsrc/src/vcpkg/install.cpp
+++ b/toolsrc/src/vcpkg/install.cpp
@@ -591,11 +591,12 @@ namespace vcpkg::Install
const Build::BuildPackageOptions install_plan_options = {Build::to_use_head_version(use_head_version),
Build::to_allow_downloads(!no_downloads)};
+ // Note: action_plan will hold raw pointers to SourceControlFiles from this map
+ std::unordered_map<std::string, SourceControlFile> scf_map;
std::vector<AnyAction> action_plan;
if (GlobalState::feature_packages)
{
- std::unordered_map<std::string, SourceControlFile> scf_map;
auto all_ports = Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
for (auto&& port : all_ports)
{