From acade9f20c9ff439e71b1c919c3c4889bf98aebf Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 11 Jun 2016 18:46:23 +0100 Subject: [PATCH] Allow use of ICU with static runtime. See: https://svn.boost.org/trac/boost/ticket/12011 --- build/Jamfile.v2 | 90 ++++++++++++------------------------------ build/has_icu_test.cpp | 2 +- 2 files changed, 27 insertions(+), 65 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 887eaea3..ad57a254 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -48,82 +48,46 @@ if ! $(disable-icu) } else { - lib icuuc : : shared shared @path_options ; - lib icuuc : : msvc debug icuucd shared shared @path_options ; - lib icuuc : : intel windows debug icuucd shared shared @path_options ; + lib icuuc : : shared @path_options ; + lib icuuc : : msvc debug icuucd shared @path_options ; + lib icuuc : : intel windows debug icuucd shared @path_options ; + lib icuuc : : sicuuc static @path_options ; + lib icuuc : : msvc debug sicuucd static @path_options ; + lib icuuc : : intel windows debug sicuucd static @path_options ; lib icuuc : : this_is_an_invalid_library_name ; - lib icudt : : icudata shared shared @path_options ; - lib icudt : : icudt msvc shared shared @path_options ; - lib icudt : : icudt intel windows shared shared @path_options ; + lib icudt : : icudata shared @path_options ; + lib icudt : : icudt msvc shared @path_options ; + lib icudt : : icudt intel windows shared @path_options ; + lib icudt : : sicudata static @path_options ; + lib icudt : : sicudt msvc static @path_options ; + lib icudt : : sicudt intel windows static @path_options ; lib icudt : : this_is_an_invalid_library_name ; - lib icuin : : icui18n shared shared @path_options ; - lib icuin : : msvc debug icuind shared shared @path_options ; - lib icuin : : msvc icuin shared shared @path_options ; - lib icuin : : intel windows debug icuind shared shared @path_options ; - lib icuin : : intel windows icuin shared shared @path_options ; + lib icuin : : icui18n shared @path_options ; + lib icuin : : msvc debug icuind shared @path_options ; + lib icuin : : msvc icuin shared @path_options ; + lib icuin : : intel windows debug icuind shared @path_options ; + lib icuin : : intel windows icuin shared @path_options ; + lib icuin : : sicui18n static @path_options ; + lib icuin : : msvc debug sicuind static @path_options ; + lib icuin : : msvc sicuin static @path_options ; + lib icuin : : intel windows debug sicuind static @path_options ; + lib icuin : : intel windows sicuin static @path_options ; lib icuin : : this_is_an_invalid_library_name ; - if $(ICU_PATH) - { - icuucd_name = [ GLOB $(ICU_PATH)/bin : icuuc??d.dll ] ; - if ! $(icuucd_name) - { - icuucd_name = [ GLOB $(ICU_PATH)/bin64 : icuuc??d.dll ] ; - } - icuuc_name = [ GLOB $(ICU_PATH)/bin : icuuc??.dll ] ; - if ! $(icuuc_name) - { - icuuc_name = [ GLOB $(ICU_PATH)/bin64 : icuuc??.dll ] ; - } - icudt_name = [ GLOB $(ICU_PATH)/bin : icudt??.dll ] ; - if ! $(icudt_name) - { - icudt_name = [ GLOB $(ICU_PATH)/bin64 : icudt??.dll ] ; - } - icuin_name = [ GLOB $(ICU_PATH)/bin : icuin??.dll ] ; - if ! $(icuin_name) - { - icuin_name = [ GLOB $(ICU_PATH)/bin64 : icuin??.dll ] ; - } - icuind_name = [ GLOB $(ICU_PATH)/bin : icuin??d.dll ] ; - if ! $(icuind_name) - { - icuind_name = [ GLOB $(ICU_PATH)/bin64 : icuin??d.dll ] ; - } - - #ECHO $(icuucd_name:B) $(icuuc_name:B) $(icudt_name:B) $(icuin_name:B) $(icuind_name:B) ; - } - ICU_OPTS = $(ICU_PATH)/include - icuuc/shared/shared - icudt/shared/shared - icuin/shared/shared + icuuc + icudt + icuin BOOST_HAS_ICU=1 - shared - # As of ICU-54 this does not work anymore (release mode): - #msvc:/delayload:$(icuucd_name:B).dll - #msvc:/delayload:$(icuuc_name:B).dll - #msvc:/delayload:$(icudt_name:B).dll - #msvc:/delayload:$(icuin_name:B).dll - #msvc:/delayload:$(icuind_name:B).dll - #msvc:delayimp.lib + static:U_STATIC_IMPLEMENTATION=1 ; } } -rule regex-run-simple ( sources + : args * : input-files * : requirements * : target-name ) -{ - exe $(target-name)_exe : $(sources) : $(requirements) ; - explicit $(target-name)_exe ; - make $(target-name).output : $(target-name)_exe : @regex_simple_run_action ; - explicit $(target-name).output ; - alias $(target-name) : $(target-name).output ; -} - unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ; explicit has_icu ; @@ -152,8 +116,6 @@ SOURCES = lib boost_regex : ../src/$(SOURCES) icu_options : shared:BOOST_REGEX_DYN_LINK=1 - #gcc-mw:static - #gcc-mingw:static gcc-cygwin:static sun:static ; diff --git a/build/has_icu_test.cpp b/build/has_icu_test.cpp index 7886b352..31c964e7 100644 --- a/build/has_icu_test.cpp +++ b/build/has_icu_test.cpp @@ -18,7 +18,7 @@ #include #if defined(_MSC_VER) && !defined(_DLL) -#error "Mixing ICU with a static runtime doesn't work" +//#error "Mixing ICU with a static runtime doesn't work" #endif void print_error(UErrorCode err, const char* func)