Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4424a0dd1e | ||
|
|
96104a6526 | ||
|
|
59c56044b9 | ||
|
|
3841e83f85 | ||
|
|
7d6641778c |
@@ -5,9 +5,9 @@ How to build
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
To build re2c from a release tarball one needs only a C++ compiler and Python 3
|
||||
(for build-time scripts and for testing). Building on Windows additionally
|
||||
requires either CMake or a Mingw build environment.
|
||||
To build re2c from a release tarball one needs only a C++ compiler (supporting
|
||||
at least C++11) and Python 3 for build-time scripts and for testing. Building on
|
||||
Windows additionally requires either CMake or a Mingw build environment.
|
||||
|
||||
To develop re2c one also needs CMake or Autotools (both build systems are
|
||||
maintained). Other dependencies include Bison (to rebuild parsers), Python 3
|
||||
|
||||
@@ -53,6 +53,7 @@ endif()
|
||||
# -std=gnu++11, not -std=c++11. Extensions are needed to enable POSIX functions on
|
||||
# Cygwin and NetBSD.
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON) # fail if the C++ compiler does not support this standard
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # make sure object libraries work with shared libraries
|
||||
|
||||
# needed for POSIX file API
|
||||
|
||||
+11
@@ -311,17 +311,28 @@ man_MANS = $(DOCS)
|
||||
# include files (stdlib)
|
||||
dist_stdlib_DATA = include/unicode_categories.re
|
||||
|
||||
BAZELFILES := \
|
||||
BUILD.bazel \
|
||||
WORKSPACE \
|
||||
bazel
|
||||
|
||||
CMAKEFILES := \
|
||||
CMakeLists.txt \
|
||||
CMakePresets.json \
|
||||
cmake
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(re2c_BOOT) \
|
||||
$(re2c_CUSTOM) \
|
||||
$(re2c_SRC_DOC_EXT) \
|
||||
$(BAZELFILES) \
|
||||
$(CMAKEFILES) \
|
||||
BUILD.md \
|
||||
CHANGELOG \
|
||||
CONTRIBUTING.md \
|
||||
IDEAS.md \
|
||||
LICENSE \
|
||||
MAINTAINERS.md \
|
||||
NO_WARRANTY \
|
||||
README.md \
|
||||
autogen.sh \
|
||||
|
||||
@@ -12,6 +12,9 @@ target_link_libraries(bench_submatch_dfa_jit benchmark::benchmark)
|
||||
find_path(RE2_INCLUDE_DIRECTORY "re2/re2.h")
|
||||
find_library(RE2_LIBRARY re2)
|
||||
if(RE2_INCLUDE_DIRECTORY AND RE2_LIBRARY)
|
||||
set_target_properties(bench_submatch_dfa_jit PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
target_compile_definitions(bench_submatch_dfa_jit PRIVATE "HAVE_RE2_RE2_H=1")
|
||||
target_include_directories(bench_submatch_dfa_jit PRIVATE "${RE2_INCLUDE_DIRECTORY}")
|
||||
target_link_libraries(bench_submatch_dfa_jit "${RE2_LIBRARY}")
|
||||
|
||||
@@ -12,6 +12,9 @@ target_link_libraries(bench_submatch_nfa benchmark::benchmark)
|
||||
find_path(RE2_INCLUDE_DIRECTORY "re2/re2.h")
|
||||
find_library(RE2_LIBRARY re2)
|
||||
if(RE2_INCLUDE_DIRECTORY AND RE2_LIBRARY)
|
||||
set_target_properties(bench_submatch_nfa PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
target_compile_definitions(bench_submatch_nfa PRIVATE "HAVE_RE2_RE2_H=1")
|
||||
target_include_directories(bench_submatch_nfa PRIVATE "${RE2_INCLUDE_DIRECTORY}")
|
||||
target_link_libraries(bench_submatch_nfa "${RE2_LIBRARY}")
|
||||
|
||||
+7
-2
@@ -124,13 +124,18 @@ AC_DEFUN([TRY_CXXFLAG], [
|
||||
AS_VAR_SET([TRY_CXXFLAG_RESULT], [yes])
|
||||
AS_VAR_SET([CXXFLAGSDEFAULT], ["$CXXFLAGSDEFAULT $1 $2"])
|
||||
],
|
||||
[AS_VAR_SET([TRY_CXXFLAG_RESULT], [no])]
|
||||
[
|
||||
AS_VAR_SET([TRY_CXXFLAG_RESULT], [no])
|
||||
AS_IF([test "x$3" = "xrequired"], [
|
||||
AC_MSG_ERROR([C++ compiler flag $1 is required to build re2c])
|
||||
])
|
||||
]
|
||||
)
|
||||
AC_LANG_POP([C++])
|
||||
AS_VAR_SET([CXXFLAGS], ["$CXXFLAGS_BACKUP"])
|
||||
AC_MSG_RESULT([$TRY_CXXFLAG_RESULT])
|
||||
])
|
||||
TRY_CXXFLAG([-std=c++11])
|
||||
TRY_CXXFLAG([-std=c++11], [], [required])
|
||||
TRY_CXXFLAG([-W])
|
||||
TRY_CXXFLAG([-Wall])
|
||||
TRY_CXXFLAG([-Wextra])
|
||||
|
||||
Reference in New Issue
Block a user