2016-12-18 18:58:16 +00:00
|
|
|
set (re2_sources
|
2016-12-01 22:44:59 +00:00
|
|
|
./re2/tostring.cc
|
|
|
|
./re2/dfa.cc
|
|
|
|
./re2/prefilter.cc
|
|
|
|
./re2/compile.cc
|
|
|
|
./re2/regexp.cc
|
|
|
|
./re2/onepass.cc
|
|
|
|
./re2/prefilter_tree.cc
|
|
|
|
./re2/set.cc
|
|
|
|
./re2/filtered_re2.cc
|
|
|
|
./re2/perl_groups.cc
|
|
|
|
./re2/parse.cc
|
|
|
|
./re2/nfa.cc
|
|
|
|
./re2/bitstate.cc
|
|
|
|
./re2/simplify.cc
|
|
|
|
./re2/unicode_groups.cc
|
|
|
|
./re2/mimics_pcre.cc
|
|
|
|
./re2/re2.cc
|
|
|
|
./re2/prog.cc
|
|
|
|
./re2/unicode_casefold.cc
|
|
|
|
./util/strutil.cc
|
|
|
|
./util/stringpiece.cc
|
|
|
|
./util/hash.cc
|
|
|
|
./util/arena.cc
|
|
|
|
./util/valgrind.cc
|
|
|
|
./util/pcre.cc
|
|
|
|
./util/stringprintf.cc
|
|
|
|
./util/rune.cc
|
|
|
|
./util/random.cc
|
|
|
|
./util/thread.cc
|
2016-02-07 21:58:58 +00:00
|
|
|
)
|
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
# Building re2 which is thread-safe and re2_st which is not.
|
|
|
|
# re2 changes its state during matching of regular expression, e.g. creates temporary DFA.
|
|
|
|
# It uses RWLock to process the same regular expression object from different threads.
|
|
|
|
# In order to avoid redundant locks in some cases, we use not thread-safe version of the library (re2_st).
|
2017-01-16 19:47:11 +00:00
|
|
|
|
2016-12-18 18:58:16 +00:00
|
|
|
add_library (re2 ${re2_sources})
|
|
|
|
add_library (re2_st ${re2_sources})
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-08-03 12:44:39 +00:00
|
|
|
target_compile_definitions (re2 PRIVATE NDEBUG)
|
|
|
|
target_compile_definitions (re2_st PRIVATE NDEBUG NO_THREADS re2=re2_st)
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-08-09 20:52:55 +00:00
|
|
|
target_include_directories (re2 PUBLIC .)
|
2017-08-09 23:11:28 +00:00
|
|
|
target_include_directories (re2_st PRIVATE . PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
2017-08-09 20:52:55 +00:00
|
|
|
|
2016-11-02 09:29:39 +00:00
|
|
|
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/re2_st)
|
|
|
|
foreach (FILENAME filtered_re2.h re2.h set.h stringpiece.h variadic_function.h)
|
2016-12-13 09:37:33 +00:00
|
|
|
add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/re2_st/${FILENAME}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DSOURCE_FILENAME="${CMAKE_CURRENT_SOURCE_DIR}/re2/${FILENAME}"
|
|
|
|
-DTARGET_FILENAME="${CMAKE_CURRENT_BINARY_DIR}/re2_st/${FILENAME}"
|
|
|
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/re2_transform.cmake"
|
|
|
|
COMMENT "Creating ${FILENAME} for re2_st library.")
|
|
|
|
add_custom_target (transform_${FILENAME} DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/re2_st/${FILENAME}")
|
|
|
|
add_dependencies (re2_st transform_${FILENAME})
|
2016-11-02 09:29:39 +00:00
|
|
|
endforeach ()
|