~aleteoryx/muditaos

ref: 652fc46c94209f2c58f18bbd359bce3bcabe6748 muditaos/module-utils/third-party/re2.cmake -rw-r--r-- 1.7 KiB
652fc46c — Pawel Olejniczak [EGD-5369] Fix for incorrect assertions in DBServiceAPI 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
include (thirdparty)

# add re2 library sources
set (RE2_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/re2)
set (RE2_SOURCES
        ${RE2_SRCDIR}/re2/bitstate.cc
        ${RE2_SRCDIR}/re2/compile.cc
        ${RE2_SRCDIR}/re2/dfa.cc
        ${RE2_SRCDIR}/re2/filtered_re2.cc
        ${RE2_SRCDIR}/re2/mimics_pcre.cc
        ${RE2_SRCDIR}/re2/nfa.cc
        ${RE2_SRCDIR}/re2/onepass.cc
        ${RE2_SRCDIR}/re2/parse.cc
        ${RE2_SRCDIR}/re2/perl_groups.cc
        ${RE2_SRCDIR}/re2/prefilter.cc
        ${RE2_SRCDIR}/re2/prefilter_tree.cc
        ${RE2_SRCDIR}/re2/prog.cc
        ${RE2_SRCDIR}/re2/re2.cc
        ${RE2_SRCDIR}/re2/regexp.cc
        ${RE2_SRCDIR}/re2/set.cc
        ${RE2_SRCDIR}/re2/simplify.cc
        ${RE2_SRCDIR}/re2/stringpiece.cc
        ${RE2_SRCDIR}/re2/tostring.cc
        ${RE2_SRCDIR}/re2/unicode_casefold.cc
        ${RE2_SRCDIR}/re2/unicode_groups.cc
        ${RE2_SRCDIR}/util/rune.cc
        ${RE2_SRCDIR}/util/strutil.cc
)

# create static library for the third party
set (RE2_TARGET re2)
add_library (${RE2_TARGET} STATIC ${RE2_SOURCES})

# setup flags for the third party
third_party_target_setup (${RE2_TARGET})

# use FreeRTOS cpp wrapper to provide thread safety
target_compile_definitions (${RE2_TARGET}
	PUBLIC
	RE2_USE_RTOS_WRAPPER
)

# suppress warning for RE2 to avoid big changes in the original library
set_source_files_properties (${RE2_SRCDIR}/re2/perl_groups.cc
        PROPERTIES COMPILE_FLAGS
        -Wno-missing-field-initializers
)

# add include directory path
target_include_directories(${RE2_TARGET} PUBLIC ${RE2_SRCDIR})

# module-os dependency (locking support)
target_link_libraries (${RE2_TARGET} PUBLIC module-os)

# optimize thirdy party sources in dbeug
third_party_source_optimization(${RE2_SOURCES})