[xpressive] Installation prepares .lib files?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[xpressive] Installation prepares .lib files?

l_d_allan
WinXp-SP2 vc7.1

Would it be feasible/advantageous for xpressive to have an
installation procedure a'la regex to build a whole series of .lib
libraries?

That seems to speed up builds quite a bit.


_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [xpressive] Installation prepares .lib files?

Eric Niebler
Lynn Allan wrote:
> WinXp-SP2 vc7.1
>
> Would it be feasible/advantageous for xpressive to have an
> installation procedure a'la regex to build a whole series of .lib
> libraries?
>
> That seems to speed up builds quite a bit.

Everything is a template. What should be exported from the lib? It would
be impossible for static regexes. For dynamic regexes, it would be
possible to put sregex_compiler, cregex_compiler, and the wide char
variants into a separate lib, but you're the first to ask for it, and I
haven't felt the need. In fact, some prefer header only libs because
they're easier to work with. A significant fraction of the problems
reported with boost.regex have to do with problems linking to the
separate lib. I'm not sure I want to spend my time debugging other
people's build configurations. :-P

My suggestion would be to have one cpp file in your project that exports
the following function:

sregex sregex_compile(
     std::string const &pat
   , regex_constants::syntax_option_type flags)
{
     return sregex::compile(pat, flags);
}

In this file and this file only, you include xpressive_dynamic.hpp. (You
can export other functions for other basic_regex instantiations.) In
files where you use regexes, you can include basic_regex.hpp,
regex_algorithms.hpp, match_results.hpp, and sub_match.hpp. Wherever you
need static regexes, you should include xpressive_static.hpp. This
should give you all the benefit of separate compilation.

HTH,

--
Eric Niebler
Boost Consulting
www.boost-consulting.com
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users