Boost logo

Boost Users :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2020-02-26 20:29:21


On 26/02/2020 19:09, Eko palypse via Boost-users wrote:
> I'm confused about the different post I've found on the web therefore
> would appreciate
> if someone could answer if it is possible to build a static regex
> library with ICU support on windows?

Yes of course, the trick is to tell b2 where to find ICU, using the
latest ICU x64 release I just built with ICU support and:

cd boost-root-directory.

./b2 --reconfigure -a --with-regex -sICU_PATH='D:\some-path\icu-65.1' 
address-model=64 --build-type=complete

The --reconfigure -a options are only required if you have a
stale/failed build already lurking on your HD.

Note that this assumes that you have both debug and release builds of
ICU available - if you downloaded the ICU binaries they only provide
release builds, and the above will fail and you will see ICU not
detected and a message:

 Â Â Â  - has_icu builds           : no

You can find out what went wrong by inspecting
boost-root/bin.v2/config.txt, but in this telling the build script what
names the ICU binaries have fixed things:

./b2 --reconfigure --with-regex -sICU_PATH='D:\some-path\icu-65.1'
-sICU_ICUIN_NAME=icuin -sICU_ICUUC_NAME=icuuc -j6 address-model=64
--build-type=complete

Note that these options require Boost-1.72.

And finally.... for all Boost releases, please remember that Boost.Regex
is "just a bunch of source files", you can always build everything in
libs/regex/src/*.cpp as a static library using whatever build system and
compiler you wish - there is no great magic going on.  For msvc you will
need to define BOOST_REGEX_NO_LIB when using a custom built binary to
avoid the auto-linking kicking in and looking for a specifically named
binary.  And also define BOOST_HAS_ICU when building the binary so it
includes ICU support.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net