Skip to content

Commit a08edf8

Browse files
author
Felix Nieuwenhuizen
committed
add hints about C++ standard to readmes
1 parent 03ee69b commit a08edf8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

runtime/Cpp/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This folder contains the C++ runtime support for ANTLR. See [the canonical antl
55
## Authors and major contributors
66

77
ANTLR 4 is the result of substantial effort of the following people:
8-
8+
99
* [Terence Parr](http://www.cs.usfca.edu/~parrt/), [email protected]
1010
ANTLR project lead and supreme dictator for life
1111
[University of San Francisco](http://www.usfca.edu/)
12-
* [Sam Harwell](http://tunnelvisionlabs.com/)
12+
* [Sam Harwell](http://tunnelvisionlabs.com/)
1313
Tool co-author, Java and C# target)
1414

1515
The C++ target has been the work of the following people:
@@ -40,6 +40,7 @@ The minimum C++ version to compile the ANTLR C++ runtime with is C++11. The supp
4040
Include the antlr4-runtime.h umbrella header in your target application to get everything needed to use the library.
4141

4242
If you are compiling with cmake, the minimum version required is cmake 2.8.
43+
By default, the libraries produced by the CMake build target C++11. If you want to target a different C++ standard, you can explicitly pass the standard - e.g. `-DCMAKE_CXX_STANDARD=17`.
4344

4445
#### Compiling on Windows with Visual Studio using he Visual Studio projects
4546
Simply open the VS project from the runtime folder (VS 2013+) and build it.
@@ -69,5 +70,3 @@ If the CMake variable 'ANTLR4_INSTALL' is set, CMake Packages will be build and
6970
They expose two packages: antlr4_runtime and antlr4_generator which can be referenced to ease up the use of the
7071
ANTLR Generator and runtime.
7172
Use and Sample can be found [here](cmake/Antlr4Package.md)
72-
73-

runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ if(ANTLR4_ZIP_REPOSITORY)
8888
CMAKE_CACHE_ARGS
8989
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
9090
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
91+
# -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard
92+
# -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} # alternatively, compile the runtime with the same C++ standard as the outer project
9193
INSTALL_COMMAND ""
9294
EXCLUDE_FROM_ALL 1)
9395
else()
@@ -105,6 +107,7 @@ else()
105107
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
106108
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
107109
# -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard
110+
# -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} # alternatively, compile the runtime with the same C++ standard as the outer project
108111
INSTALL_COMMAND ""
109112
EXCLUDE_FROM_ALL 1)
110113
endif()

runtime/Cpp/cmake/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ The ANTLR C++ runtime source is downloaded from GitHub by default. However, user
129129

130130
Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt.
131131

132+
You may need to modify your local copy of ExternalAntlr4Cpp.cpp to modify some build settings. For example, to specify the C++ standard to use when building the runtime, add `-DCMAKE_CXX_STANDARD:STRING=17` to `CMAKE_CACHE_ARGS`.
133+
132134
### Examples
133135

134136
To build and link ANTLR4 static library to a target one may call:

0 commit comments

Comments
 (0)