Skip to content

Commit 082437d

Browse files
authored
Merge branch 'develop' into staticptrfix
2 parents 3168641 + aacd14b commit 082437d

File tree

7 files changed

+179
-8
lines changed

7 files changed

+179
-8
lines changed

.travis.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@ matrix:
2727
- env: BOGUS_JOB=true
2828

2929
include:
30+
- os: linux
31+
env: TEST_CMAKE=true # variables unused - just for identification in travis ci gui
32+
script:
33+
- git submodule update --init tools/cmake
34+
- git submodule update --init libs/conversion
35+
- git submodule update --init libs/function_types
36+
- git submodule update --init libs/fusion
37+
- git submodule update --init libs/typeof
38+
- mkdir __build__ && cd __build__
39+
- cmake .. -DBOOST_ENABLE_CMAKE=ON -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
40+
- cmake --build .
41+
42+
- os: linux
43+
env: TEST_CMAKE=true BUILD_SHARED_LIBS=On # variables unused - just for identification in travis ci gui
44+
script:
45+
- git submodule update --init tools/cmake
46+
- git submodule update --init libs/conversion
47+
- git submodule update --init libs/function_types
48+
- git submodule update --init libs/fusion
49+
- git submodule update --init libs/typeof
50+
- mkdir __build__ && cd __build__
51+
- cmake .. -DBUILD_SHARED_LIBS=ON -DBOOST_ENABLE_CMAKE=ON -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
52+
- cmake --build .
53+
3054
- os: linux
3155
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
3256

@@ -242,9 +266,12 @@ matrix:
242266
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
243267
osx_image: xcode6.4
244268

269+
270+
245271
install:
272+
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
246273
- cd ..
247-
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
274+
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
248275
- cd boost-root
249276
- git submodule update --init tools/build
250277
- git submodule update --init tools/boost_install

CMakeLists.txt

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Copyright 2018-2019 Mike Dev
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
4+
#
5+
# NOTE: CMake support for Boost.Regex is currently experimental at best
6+
# and the interface is likely to change in the future
7+
8+
9+
##### How-To:
10+
#
11+
# If you have a cmake project that wants to use and compile
12+
# boost_regex, as part of a single build system run, do the following:
13+
# 1) clone the boost project and all its sub-projects:
14+
#
15+
# git clone --branch develop --depth 1 --recursive --shallow-submodules https://github.com/boostorg/boost.git boost-root
16+
#
17+
# 2) add to your cmake script:
18+
#
19+
# add_subdirectory( <path-to-boost-root> [<build-dir-for-boost-libs>])
20+
# target_link_libraries( <my-exec> PUBLIC Boost::regex)
21+
#
22+
# 3) run your cmake build as usual
23+
#
24+
# ## Explanation:
25+
#
26+
# Currently this file does not work standalone. It is expected to be
27+
# invoked from a parent script via add_subdirectory. That parent script
28+
# is responsible for providing targets for direct and indirect dependencies,
29+
# such as Boost::assert, Boost::concept_check, e.g. by also adding those
30+
# libraries via add_submodule (order doesn't matter).
31+
# The parent script can be your own cmake script, but it is easier to just
32+
# use add the CMakeLists in the root of the boost super project, which
33+
# will in turn add all boost libraries usable with the add_subdirectory
34+
# Workflow.
35+
#
36+
# Note: You don't need to actually clone all boost libraries. E.g. look
37+
# into the travis ci file to see on which libraries boost_regex actually
38+
# depends or use boostdep https://github.com/boostorg/boostdep
39+
40+
41+
##### Current Limitations:
42+
#
43+
# - Doesn't compile or run tests
44+
# - Doesn't support installation
45+
#
46+
47+
cmake_minimum_required( VERSION 3.5 )
48+
project( BoostRegex LANGUAGES CXX )
49+
50+
option( BOOST_REGEX_INCLUDE_EXAMPLES "Also build (some) boost regex examples" OFF )
51+
option( BOOST_REGEX_USE_ICU "Enable ICU support in boost regex" OFF )
52+
53+
file( GLOB BOOST_REGEX_SRC ./src/*.cpp )
54+
55+
add_library( boost_regex ${BOOST_REGEX_SRC} )
56+
add_library( Boost::regex ALIAS boost_regex )
57+
58+
# Currently, installation isn't supported directly,
59+
# but someone else might install this target from the parent
60+
# CMake script, so lets proactively differentiate between
61+
# the include directory during regular use (BUILD_INTERFACE)
62+
# and after installation
63+
target_include_directories( boost_regex
64+
PUBLIC
65+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
66+
$<INSTALL_INTERFACE:include>
67+
)
68+
69+
target_compile_definitions( boost_regex
70+
PUBLIC
71+
# No need for autolink and we don't mangle library name anyway
72+
BOOST_REGEX_NO_LIB
73+
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1>
74+
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1>
75+
)
76+
77+
# Specify dependencies (including header-only libraries)
78+
target_link_libraries( boost_regex
79+
PUBLIC
80+
Boost::assert
81+
Boost::concept_check
82+
Boost::config
83+
Boost::container_hash
84+
Boost::core
85+
Boost::integer
86+
Boost::iterator
87+
Boost::mpl
88+
Boost::predef
89+
Boost::smart_ptr
90+
Boost::static_assert
91+
Boost::throw_exception
92+
Boost::type_traits
93+
)
94+
95+
if( BOOST_REGEX_USE_ICU )
96+
# ICU Targets could be provided by parent project,
97+
# if not, look for them ourselves
98+
if( NOT TARGET ICU::dt )
99+
# components need to be listed explicitly
100+
find_package( ICU COMPONENTS dt in uc REQUIRED )
101+
endif()
102+
103+
target_link_libraries( boost_regex
104+
PRIVATE
105+
ICU::dt ICU::in ICU::uc
106+
)
107+
target_compile_definitions( boost_regex PRIVATE BOOST_HAS_ICU=1 )
108+
endif()
109+
110+
if( BOOST_REGEX_INCLUDE_EXAMPLES )
111+
add_subdirectory( example/snippets )
112+
endif()
113+

doc/history.qbk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88

99
[section:history History]
1010

11-
New issues should be submitted at [@http://svn.boost.org svn.boost.org] - don't forget to include your
12-
email address in the ticket!
11+
New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues]
1312

14-
Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
13+
Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here].
1514

16-
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
15+
All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here].
1716

1817
[h4 Boost.Regex-5.1.4 (Boost-172.0)]
1918

example/snippets/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2019 Mike Dev
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
4+
#
5+
# NOTE: CMake support for Boost.Regex is currently experimental at best
6+
# and we are currently only building a few examples
7+
8+
set(examples
9+
partial_regex_grep
10+
partial_regex_iterate
11+
partial_regex_match
12+
regex_grep_example_1
13+
regex_grep_example_2
14+
regex_grep_example_3
15+
regex_grep_example_4
16+
regex_iterator_example
17+
regex_match_example
18+
regex_merge_example
19+
regex_replace_example
20+
regex_search_example
21+
regex_split_example_1
22+
regex_split_example_2
23+
regex_token_iterator_eg_1
24+
regex_token_iterator_eg_2
25+
)
26+
27+
foreach( example IN LISTS examples )
28+
add_executable( boost_regex_ex_${example} ${example}.cpp )
29+
target_link_libraries( boost_regex_ex_${example} Boost::regex )
30+
endforeach()

include/boost/regex/v4/regex_iterator.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class regex_iterator_implementation
5050
public:
5151
regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
5252
: base(), end(last), re(*p), flags(f){}
53+
regex_iterator_implementation(const regex_iterator_implementation& other)
54+
:what(other.what), base(other.base), end(other.end), re(other.re), flags(other.flags){}
5355
bool init(BidirectionalIterator first)
5456
{
5557
base = first;

include/boost/regex/v4/regex_traits_defaults.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ inline bool is_separator<char>(char c)
141141
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);
142142

143143
//
144-
// get the state_id of a character clasification, the individual
144+
// get the state_id of a character classification, the individual
145145
// traits classes then transform that state_id into a bitmask:
146146
//
147147
template <class charT>

src/regex_traits_defaults.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l
193193
//
194194
// these are the POSIX collating names:
195195
//
196-
BOOST_REGEX_DECL extern const char* const def_coll_names[] = {
196+
static const char* def_coll_names[] = {
197197
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
198198
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
199199
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
@@ -214,7 +214,7 @@ BOOST_REGEX_DECL extern const char* const def_coll_names[] = {
214214
// little more - but this will have to do for
215215
// now:
216216

217-
BOOST_REGEX_DECL extern const char* const def_multi_coll[] = {
217+
static const char* def_multi_coll[] = {
218218
"ae",
219219
"Ae",
220220
"AE",

0 commit comments

Comments
 (0)