mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 11:21:12 +08:00
Use ICU in boost build
This commit is contained in:
parent
f76244f700
commit
99a8d74549
166
ports/boost/0001-Fix-boost-ICU-support.patch
Normal file
166
ports/boost/0001-Fix-boost-ICU-support.patch
Normal file
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: boost
|
||||
Version: 1.65-1
|
||||
Description: Peer-reviewed portable C++ source libraries
|
||||
Build-Depends: zlib, bzip2
|
||||
Build-Depends: zlib, bzip2, icu [windows]
|
||||
|
@ -5,3 +5,31 @@ using msvc : 14.0 : cl.exe :
|
||||
using msvc : 14.1 : cl.exe :
|
||||
<setup>echo
|
||||
;
|
||||
|
||||
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@ ;
|
@ -32,7 +32,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
|
||||
@ -83,6 +84,7 @@ 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
|
||||
@ -92,10 +94,12 @@ set(B2_OPTIONS
|
||||
threading=multi
|
||||
)
|
||||
|
||||
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)
|
||||
|
@ -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 ;
|
Loading…
x
Reference in New Issue
Block a user