M .gitmodules => .gitmodules +4 -5
@@ 11,11 11,6 @@
[submodule "module-utils/crc32"]
path = third-party/crc32/src
url = ../crc32
-[submodule "module-utils/re2"]
- path = module-utils/re2
- url = ../re2.git
- branch = rt1051
- shallow = true
[submodule "module-utils/protobuf"]
path = third-party/protobuf/src
url = ../protobuf.git
@@ 87,3 82,7 @@
[submodule "third-party/gsl"]
path = third-party/gsl
url = https://github.com/microsoft/GSL.git
+[submodule "third-party/re2/src"]
+ path = third-party/re2/src
+ url = ../re2.git
+ branch = rt1051
M cmake/modules/PureCoverage.cmake => cmake/modules/PureCoverage.cmake +0 -1
@@ 31,7 31,6 @@ if(COVERAGE_ENABLE)
module-utils/gsl/.*
module-utils/json/.*
module-utils/libphonenumber/.*
- module-utils/re2/.*
module-utils/segger/.*
source/main.cpp
test/.*
M doc/Doxyfile.in => doc/Doxyfile.in +0 -1
@@ 889,7 889,6 @@ EXCLUDE = @PROJECT_SOURCE_DIR@/module-bluetooth/lib \
@PROJECT_SOURCE_DIR@/module-utils/tinyfsm \
@PROJECT_SOURCE_DIR@/module-utils/segger \
@PROJECT_SOURCE_DIR@/module-utils/sbini \
- @PROJECT_SOURCE_DIR@/module-utils/re2 \
@PROJECT_SOURCE_DIR@/module-utils/libphonenumber \
@PROJECT_SOURCE_DIR@/module-utils/test \
@PROJECT_SOURCE_DIR@/module-db/tests \
M module-services/service-cellular/CMakeLists.txt => module-services/service-cellular/CMakeLists.txt +1 -0
@@ 53,6 53,7 @@ target_link_libraries(${PROJECT_NAME}
module-bsp
module-cellular
Microsoft.GSL::GSL
+ re2::re2
)
if (${ENABLE_TESTS})
M module-utils/CMakeLists.txt => module-utils/CMakeLists.txt +0 -1
@@ 49,7 49,6 @@ add_library(${PROJECT_NAME} STATIC ${SOURCES} ${BOARD_SOURCES})
include(segger/rtt/CMakeLists.txt)
# add third party libs
-include(third-party/re2.cmake)
include(third-party/libphonenumber.cmake)
# link against libphonenumber
D module-utils/re2 => module-utils/re2 +0 -1
@@ 1,1 0,0 @@
-Subproject commit a583c1f7d5d20be34856032ad76510691631c760
M module-utils/third-party/libphonenumber.cmake => module-utils/third-party/libphonenumber.cmake +6 -10
@@ 58,16 58,12 @@ set_source_files_properties (${LIBPHONENUMBER}/asyoutypeformatter.cc
# add include directory path
target_include_directories (${LIBPHONENUMBER_TARGET} PUBLIC ${LIBPHONENUMBER_SRCDIR})
-# module-os dependency (locking support)
-target_link_libraries (${LIBPHONENUMBER_TARGET} PUBLIC module-os)
-
-# RE2 dependency
-if (NOT RE2_TARGET)
- message (FATAL_ERROR "RE2 is required for libphonenumber")
-endif ()
-target_link_libraries (${LIBPHONENUMBER_TARGET} PUBLIC ${RE2_TARGET})
-
-target_link_libraries (${LIBPHONENUMBER_TARGET} PUBLIC protobuf::libprotobuf-lite)
+target_link_libraries (${LIBPHONENUMBER_TARGET}
+ PRIVATE
+ re2::re2
+ PUBLIC
+ protobuf::libprotobuf-lite
+)
# turn on optimization in debug
third_party_source_optimization (${LIBPHONENUMBER_SOURCES})
D module-utils/third-party/re2.cmake => module-utils/third-party/re2.cmake +0 -56
@@ 1,56 0,0 @@
-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})
M third-party/CMakeLists.txt => third-party/CMakeLists.txt +1 -0
@@ 12,3 12,4 @@ add_subdirectory(parallel-hashmap)
add_subdirectory(protobuf)
add_subdirectory(littlefs)
add_subdirectory(gsl)
+add_subdirectory(re2)
A third-party/re2/CMakeLists.txt => third-party/re2/CMakeLists.txt +7 -0
@@ 0,0 1,7 @@
+add_subdirectory(src)
+
+target_compile_definitions(re2 PUBLIC RE2_USE_RTOS_WRAPPER)
+
+target_compile_options (re2 PRIVATE -Wno-missing-field-initializers)
+
+target_link_libraries(re2 PUBLIC module-os)
A third-party/re2/src => third-party/re2/src +1 -0
@@ 0,0 1,1 @@
+Subproject commit 9d3b376ba3a41b498f13264131102d48c4b3271a