summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-26 13:01:36 +0100
committerLars Knoll <lars.knoll@qt.io>2020-04-13 09:40:09 +0200
commit33752a9bd334a53e891f141afd2357eefb1a9a36 (patch)
treeadf44eafe1d4201b49088d3d8592c0b83877101a /src
parentce1d4d362881b54ff774b49f54ef686f9aa97c73 (diff)
Include QRegularExpression in the bootstrap library
This allows us to use regular expressions in bootstrapped tools such as moc and tracegen. Change-Id: I4310dd15bf26651aac6ab30c884e025ca06b3099 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/pcre2/CMakeLists.txt10
-rw-r--r--src/3rdparty/pcre2/pcre2.pri41
-rw-r--r--src/3rdparty/pcre2/pcre2.pro44
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h4
-rw-r--r--src/corelib/global/qlogging.cpp10
-rw-r--r--src/tools/bootstrap/.prev_CMakeLists.txt40
-rw-r--r--src/tools/bootstrap/CMakeLists.txt39
-rw-r--r--src/tools/bootstrap/bootstrap.pro7
8 files changed, 142 insertions, 53 deletions
diff --git a/src/3rdparty/pcre2/CMakeLists.txt b/src/3rdparty/pcre2/CMakeLists.txt
index d32073dab5..b73f0bff9e 100644
--- a/src/3rdparty/pcre2/CMakeLists.txt
+++ b/src/3rdparty/pcre2/CMakeLists.txt
@@ -51,11 +51,6 @@ qt_set_symbol_visibility_hidden(BundledPcre2)
## Scopes:
#####################################################################
-qt_extend_target(BundledPcre2 CONDITION WIN32
- PUBLIC_DEFINES
- PCRE2_STATIC
-)
-
qt_extend_target(BundledPcre2 CONDITION QNX OR UIKIT OR WINRT
DEFINES
PCRE2_DISABLE_JIT
@@ -70,3 +65,8 @@ qt_extend_target(BundledPcre2 CONDITION (TEST_architecture_arch STREQUAL "arm64"
DEFINES
PCRE2_DISABLE_JIT
)
+
+qt_extend_target(BundledPcre2 CONDITION WIN32
+ PUBLIC_DEFINES
+ PCRE2_STATIC
+)
diff --git a/src/3rdparty/pcre2/pcre2.pri b/src/3rdparty/pcre2/pcre2.pri
new file mode 100644
index 0000000000..fa901f783f
--- /dev/null
+++ b/src/3rdparty/pcre2/pcre2.pri
@@ -0,0 +1,41 @@
+MODULE_INCLUDEPATH += $$PWD/src
+
+MODULE_DEFINES += PCRE2_CODE_UNIT_WIDTH=16
+win32: MODULE_DEFINES += PCRE2_STATIC
+
+DEFINES += HAVE_CONFIG_H
+
+SOURCES += \
+ $$PWD/src/pcre2_auto_possess.c \
+ $$PWD/src/pcre2_chartables.c \
+ $$PWD/src/pcre2_compile.c \
+ $$PWD/src/pcre2_config.c \
+ $$PWD/src/pcre2_context.c \
+ $$PWD/src/pcre2_dfa_match.c \
+ $$PWD/src/pcre2_error.c \
+ $$PWD/src/pcre2_extuni.c \
+ $$PWD/src/pcre2_find_bracket.c \
+ $$PWD/src/pcre2_jit_compile.c \
+ $$PWD/src/pcre2_maketables.c \
+ $$PWD/src/pcre2_match.c \
+ $$PWD/src/pcre2_match_data.c \
+ $$PWD/src/pcre2_newline.c \
+ $$PWD/src/pcre2_ord2utf.c \
+ $$PWD/src/pcre2_pattern_info.c \
+ $$PWD/src/pcre2_script_run.c \
+ $$PWD/src/pcre2_serialize.c \
+ $$PWD/src/pcre2_string_utils.c \
+ $$PWD/src/pcre2_study.c \
+ $$PWD/src/pcre2_substitute.c \
+ $$PWD/src/pcre2_substring.c \
+ $$PWD/src/pcre2_tables.c \
+ $$PWD/src/pcre2_ucd.c \
+ $$PWD/src/pcre2_valid_utf.c \
+ $$PWD/src/pcre2_xclass.c
+
+HEADERS += \
+ $$PWD/src/config.h \
+ $$PWD/src/pcre2.h \
+ $$PWD/src/pcre2_internal.h \
+ $$PWD/src/pcre2_intmodedep.h \
+ $$PWD/src/pcre2_ucp.h
diff --git a/src/3rdparty/pcre2/pcre2.pro b/src/3rdparty/pcre2/pcre2.pro
index 56790f34c5..a3915fa2fa 100644
--- a/src/3rdparty/pcre2/pcre2.pro
+++ b/src/3rdparty/pcre2/pcre2.pro
@@ -5,51 +5,11 @@ CONFIG += \
hide_symbols \
exceptions_off rtti_off warn_off
-
-MODULE_DEFINES += PCRE2_CODE_UNIT_WIDTH=16
-win32: MODULE_DEFINES += PCRE2_STATIC
-MODULE_INCLUDEPATH += $$PWD/src
-
-load(qt_helper_lib)
-
-DEFINES += HAVE_CONFIG_H
+include(pcre2.pri)
# platform/compiler specific definitions
uikit|qnx|winrt: DEFINES += PCRE2_DISABLE_JIT
win32:contains(QT_ARCH, "arm"): DEFINES += PCRE2_DISABLE_JIT
win32:contains(QT_ARCH, "arm64"): DEFINES += PCRE2_DISABLE_JIT
-SOURCES += \
- $$PWD/src/pcre2_auto_possess.c \
- $$PWD/src/pcre2_chartables.c \
- $$PWD/src/pcre2_compile.c \
- $$PWD/src/pcre2_config.c \
- $$PWD/src/pcre2_context.c \
- $$PWD/src/pcre2_dfa_match.c \
- $$PWD/src/pcre2_error.c \
- $$PWD/src/pcre2_extuni.c \
- $$PWD/src/pcre2_find_bracket.c \
- $$PWD/src/pcre2_jit_compile.c \
- $$PWD/src/pcre2_maketables.c \
- $$PWD/src/pcre2_match.c \
- $$PWD/src/pcre2_match_data.c \
- $$PWD/src/pcre2_newline.c \
- $$PWD/src/pcre2_ord2utf.c \
- $$PWD/src/pcre2_pattern_info.c \
- $$PWD/src/pcre2_script_run.c \
- $$PWD/src/pcre2_serialize.c \
- $$PWD/src/pcre2_string_utils.c \
- $$PWD/src/pcre2_study.c \
- $$PWD/src/pcre2_substitute.c \
- $$PWD/src/pcre2_substring.c \
- $$PWD/src/pcre2_tables.c \
- $$PWD/src/pcre2_ucd.c \
- $$PWD/src/pcre2_valid_utf.c \
- $$PWD/src/pcre2_xclass.c
-
-HEADERS += \
- $$PWD/src/config.h \
- $$PWD/src/pcre2.h \
- $$PWD/src/pcre2_internal.h \
- $$PWD/src/pcre2_intmodedep.h \
- $$PWD/src/pcre2_ucp.h
+load(qt_helper_lib)
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 5733864459..0185ad566c 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -106,7 +106,11 @@
#define QT_FEATURE_lttng -1
#define QT_NO_QOBJECT
#define QT_FEATURE_process -1
+#ifndef QT_BUILD_QMAKE
+#define QT_FEATURE_regularexpression 1
+#else
#define QT_FEATURE_regularexpression -1
+#endif
#ifdef __GLIBC_PREREQ
# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
#else
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 123cc88ad6..db4224db91 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -101,6 +101,11 @@
#include <emscripten/emscripten.h>
#endif
+#if QT_CONFIG(slog2)
+extern char *__progname;
+#endif
+
+#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(regularexpression)
# ifdef __UCLIBC__
# if __UCLIBC_HAS_BACKTRACE__
@@ -111,11 +116,6 @@
# endif
#endif
-#if QT_CONFIG(slog2)
-extern char *__progname;
-#endif
-
-#ifndef QT_BOOTSTRAPPED
#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>))
# include <sys/syscall.h>
diff --git a/src/tools/bootstrap/.prev_CMakeLists.txt b/src/tools/bootstrap/.prev_CMakeLists.txt
index b2ecf9d657..47e4877e20 100644
--- a/src/tools/bootstrap/.prev_CMakeLists.txt
+++ b/src/tools/bootstrap/.prev_CMakeLists.txt
@@ -10,6 +10,37 @@ qt_add_module(Bootstrap
NO_SYNC_QT
QMAKE_MODULE_CONFIG gc_binaries
SOURCES
+ ../../3rdparty/pcre2/src/config.h
+ ../../3rdparty/pcre2/src/pcre2.h
+ ../../3rdparty/pcre2/src/pcre2_auto_possess.c
+ ../../3rdparty/pcre2/src/pcre2_chartables.c
+ ../../3rdparty/pcre2/src/pcre2_compile.c
+ ../../3rdparty/pcre2/src/pcre2_config.c
+ ../../3rdparty/pcre2/src/pcre2_context.c
+ ../../3rdparty/pcre2/src/pcre2_dfa_match.c
+ ../../3rdparty/pcre2/src/pcre2_error.c
+ ../../3rdparty/pcre2/src/pcre2_extuni.c
+ ../../3rdparty/pcre2/src/pcre2_find_bracket.c
+ ../../3rdparty/pcre2/src/pcre2_internal.h
+ ../../3rdparty/pcre2/src/pcre2_intmodedep.h
+ ../../3rdparty/pcre2/src/pcre2_jit_compile.c
+ ../../3rdparty/pcre2/src/pcre2_maketables.c
+ ../../3rdparty/pcre2/src/pcre2_match.c
+ ../../3rdparty/pcre2/src/pcre2_match_data.c
+ ../../3rdparty/pcre2/src/pcre2_newline.c
+ ../../3rdparty/pcre2/src/pcre2_ord2utf.c
+ ../../3rdparty/pcre2/src/pcre2_pattern_info.c
+ ../../3rdparty/pcre2/src/pcre2_script_run.c
+ ../../3rdparty/pcre2/src/pcre2_serialize.c
+ ../../3rdparty/pcre2/src/pcre2_string_utils.c
+ ../../3rdparty/pcre2/src/pcre2_study.c
+ ../../3rdparty/pcre2/src/pcre2_substitute.c
+ ../../3rdparty/pcre2/src/pcre2_substring.c
+ ../../3rdparty/pcre2/src/pcre2_tables.c
+ ../../3rdparty/pcre2/src/pcre2_ucd.c
+ ../../3rdparty/pcre2/src/pcre2_ucp.h
+ ../../3rdparty/pcre2/src/pcre2_valid_utf.c
+ ../../3rdparty/pcre2/src/pcre2_xclass.c
../../corelib/codecs/qlatincodec.cpp
../../corelib/codecs/qtextcodec.cpp
../../corelib/codecs/qutfcodec.cpp
@@ -73,6 +104,7 @@ qt_add_module(Bootstrap
../../corelib/text/qlocale.cpp
../../corelib/text/qlocale_tools.cpp
../../corelib/text/qregexp.cpp
+ ../../corelib/text/qregularexpression.cpp
../../corelib/text/qstring.cpp
../../corelib/text/qstring_compat.cpp
../../corelib/text/qstringbuilder.cpp
@@ -99,6 +131,9 @@ qt_add_module(Bootstrap
../../xml/dom/qdom.cpp
../../xml/sax/qxml.cpp
DEFINES
+ HAVE_CONFIG_H
+ PCRE2_CODE_UNIT_WIDTH=16
+ PCRE2_DISABLE_JIT
QT_BOOTSTRAPPED
QT_NO_CAST_FROM_ASCII
QT_NO_CAST_TO_ASCII
@@ -108,6 +143,7 @@ qt_add_module(Bootstrap
QT_VERSION_PATCH=
QT_VERSION_STR=\"\"
PUBLIC_DEFINES
+ PCRE2_CODE_UNIT_WIDTH=16
QT_BOOTSTRAPPED
QT_NO_CAST_TO_ASCII
QT_VERSION_MAJOR=
@@ -117,6 +153,8 @@ qt_add_module(Bootstrap
INCLUDE_DIRECTORIES
..
../../3rdparty/tinycbor/src
+ PUBLIC_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/pcre2/src>
)
#### Keys ignored in scope 1:.:.:bootstrap.pro:<TRUE>:
@@ -155,6 +193,8 @@ qt_extend_target(Bootstrap CONDITION WIN32
../../corelib/kernel/qsystemsemaphore_win.cpp
../../corelib/kernel/qwinregistry.cpp
../../corelib/plugin/qsystemlibrary.cpp
+ PUBLIC_DEFINES
+ PCRE2_STATIC
PUBLIC_LIBRARIES
advapi32
netapi32
diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt
index b7367e2d26..ccac76d184 100644
--- a/src/tools/bootstrap/CMakeLists.txt
+++ b/src/tools/bootstrap/CMakeLists.txt
@@ -11,6 +11,37 @@ add_library(Bootstrap STATIC)
# special case end
qt_extend_target(Bootstrap
SOURCES
+ ../../3rdparty/pcre2/src/config.h
+ ../../3rdparty/pcre2/src/pcre2.h
+ ../../3rdparty/pcre2/src/pcre2_auto_possess.c
+ ../../3rdparty/pcre2/src/pcre2_chartables.c
+ ../../3rdparty/pcre2/src/pcre2_compile.c
+ ../../3rdparty/pcre2/src/pcre2_config.c
+ ../../3rdparty/pcre2/src/pcre2_context.c
+ ../../3rdparty/pcre2/src/pcre2_dfa_match.c
+ ../../3rdparty/pcre2/src/pcre2_error.c
+ ../../3rdparty/pcre2/src/pcre2_extuni.c
+ ../../3rdparty/pcre2/src/pcre2_find_bracket.c
+ ../../3rdparty/pcre2/src/pcre2_internal.h
+ ../../3rdparty/pcre2/src/pcre2_intmodedep.h
+ ../../3rdparty/pcre2/src/pcre2_jit_compile.c
+ ../../3rdparty/pcre2/src/pcre2_maketables.c
+ ../../3rdparty/pcre2/src/pcre2_match.c
+ ../../3rdparty/pcre2/src/pcre2_match_data.c
+ ../../3rdparty/pcre2/src/pcre2_newline.c
+ ../../3rdparty/pcre2/src/pcre2_ord2utf.c
+ ../../3rdparty/pcre2/src/pcre2_pattern_info.c
+ ../../3rdparty/pcre2/src/pcre2_script_run.c
+ ../../3rdparty/pcre2/src/pcre2_serialize.c
+ ../../3rdparty/pcre2/src/pcre2_string_utils.c
+ ../../3rdparty/pcre2/src/pcre2_study.c
+ ../../3rdparty/pcre2/src/pcre2_substitute.c
+ ../../3rdparty/pcre2/src/pcre2_substring.c
+ ../../3rdparty/pcre2/src/pcre2_tables.c
+ ../../3rdparty/pcre2/src/pcre2_ucd.c
+ ../../3rdparty/pcre2/src/pcre2_ucp.h
+ ../../3rdparty/pcre2/src/pcre2_valid_utf.c
+ ../../3rdparty/pcre2/src/pcre2_xclass.c
../../corelib/codecs/qlatincodec.cpp
../../corelib/codecs/qtextcodec.cpp
../../corelib/codecs/qutfcodec.cpp
@@ -74,6 +105,7 @@ qt_extend_target(Bootstrap
../../corelib/text/qlocale.cpp
../../corelib/text/qlocale_tools.cpp
../../corelib/text/qregexp.cpp
+ ../../corelib/text/qregularexpression.cpp
../../corelib/text/qstring.cpp
../../corelib/text/qstring_compat.cpp
../../corelib/text/qstringbuilder.cpp
@@ -99,6 +131,10 @@ qt_extend_target(Bootstrap
../../corelib/tools/qversionnumber.cpp
../../xml/dom/qdom.cpp
../../xml/sax/qxml.cpp
+ DEFINES
+ HAVE_CONFIG_H
+ PCRE2_CODE_UNIT_WIDTH=16
+ PCRE2_DISABLE_JIT
PUBLIC_DEFINES # special case
QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} # special case
QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case
@@ -113,6 +149,7 @@ qt_extend_target(Bootstrap
..
../../3rdparty/tinycbor/src
PUBLIC_INCLUDE_DIRECTORIES # special case
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/pcre2/src>
$<TARGET_PROPERTY:Core,INCLUDE_DIRECTORIES> # special case
$<TARGET_PROPERTY:Xml,INCLUDE_DIRECTORIES> # special case
PUBLIC_LIBRARIES # special case
@@ -155,6 +192,8 @@ qt_extend_target(Bootstrap CONDITION WIN32
../../corelib/kernel/qsystemsemaphore_win.cpp
../../corelib/kernel/qwinregistry.cpp
../../corelib/plugin/qsystemlibrary.cpp
+ PUBLIC_DEFINES
+ PCRE2_STATIC
PUBLIC_LIBRARIES
advapi32
netapi32
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 10d5fd4f95..eb267fc7bb 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -14,6 +14,9 @@ MODULE_DEFINES = \
QT_NO_CAST_TO_ASCII
MODULE_CONFIG = gc_binaries
+DEFINES += PCRE2_DISABLE_JIT
+include(../../3rdparty/pcre2/pcre2.pri)
+
DEFINES += \
$$MODULE_DEFINES \
QT_NO_FOREACH \
@@ -21,7 +24,8 @@ DEFINES += \
INCLUDEPATH += \
$$PWD/.. \
- $$PWD/../../3rdparty/tinycbor/src
+ $$PWD/../../3rdparty/tinycbor/src \
+ $$PWD/../../3rdparty/pcre2/src
SOURCES += \
../../corelib/codecs/qlatincodec.cpp \
@@ -87,6 +91,7 @@ SOURCES += \
../../corelib/text/qlocale.cpp \
../../corelib/text/qlocale_tools.cpp \
../../corelib/text/qregexp.cpp \
+ ../../corelib/text/qregularexpression.cpp \
../../corelib/text/qstring.cpp \
../../corelib/text/qstringbuilder.cpp \
../../corelib/text/qstring_compat.cpp \