Commit Graph

35 Commits

Author SHA1 Message Date
ArthurSonzogni f68c47a988 Fix clang compile error with --stdlib=libc++
On linux. Most users haven't installed libc++-dev, but ANTLR is passing
the "--stdlib=libc++" argument. As a result, this won't compile. Users
will see:
```
/tmp/antlr4/runtime/Cpp/runtime/src/antlr4-common.h:8:10: fatal error:
'algorithm' file not found
```

This is caused by the "WITH_LIBCXX" option.
It was introduced by:
d46ef90aa0

It causes the option "--stdlib=libc++" to be appended by default.

I believe its default value should have been left as "Off".

With "off" by default, clang will use its default C++ library, which is
always available.

The WITH_LIBCXX option is kept, being able to change the C++ library
might be useful?

BUG=https://github.com/antlr/antlr4/issues/2898
2020-09-06 15:30:54 +02:00
julibert b37d2e3815
Fix CMake packaging. 2020-02-09 20:01:24 +01:00
Markus Zancolò 4fec5f9f7c fix cpp cmake for emscripten
Emscripten can do C++11. added it to the compilercheck in CMakeLists
2019-01-16 14:55:03 +01:00
Terence Parr 7ef7770db1
Merge branch 'master' into master 2018-11-11 09:25:33 -08:00
Sönke Schau 444fe24bb0
Merge branch 'master' into master 2018-11-11 13:21:57 +01:00
Terence Parr f45e36509c
Merge branch 'master' into cppruntime-non-appleclang-macosx 2018-11-08 13:41:32 -08:00
Christopher C. Aycock 5a7912abde Parenthetical spacing in CMake files is more consistent 2018-10-30 12:48:58 -04:00
Christopher C. Aycock 0a1b3c7df6 Improved ExternalAntlr4Cpp and added CMake option for static CRT (Fixes #1872) 2018-10-29 17:20:24 -04:00
James Goppert ee92d8caf1 Add support for cpack. 2018-07-03 20:21:55 -04:00
uvguy bb516f0e91
add note android build 2018-03-10 12:53:39 +07:00
Marcus Ong 526e6cdb9d (Visual C++) Added CMake option to link CRT
Previously Visual C++ users were forced to link CRT statically,
i.e. use /MT flag whenever they want to use the static library.
Linker have an error if user tries to link a /MT static library
to a /MD executable.

This commit defaults the build to statically link with CRT, but
may be turned off if needed.
2018-02-28 14:09:01 -06:00
Soenke Schau 0218f5454a Changed the compiler detection code for Clang so that FreeBSD is supported too 2018-01-15 18:10:19 +01:00
Sönke Schau 10d7878ed1 Add code to optionaly generate two cmake package during install when 'ANTLR4_INSTALL' is set:
'antlr4-runtime' which imports the required runtime targets and
'antlr4-generator' which provides a convenient function to use the generator.
Only the latter one has a dependency to the Java package.
2018-01-15 17:31:14 +01:00
Ajay Panyala 505f672ca1 Remove suggested fix comment 2017-12-17 08:09:55 -08:00
Ajay Panyala 18bdbb5a22 suggest alternative fix 2017-12-16 17:36:06 -08:00
Ajay Panyala 07d7bd1f36 Add missing -std=c++11 flag when using non-appleclang compiler on macosx 2017-12-16 17:20:54 -08:00
Ajay Panyala e8a2fbe524 Support building ANTLR Cpp Runtime with Intel compilers 2017-11-05 13:53:56 -08:00
gendalph 1a4f5770dd update CMAKE_POLICY CMP0026 NEW 2017-10-30 22:56:57 +03:00
Terence Parr b8fd54780a Merge pull request #1974 from matthauck/cmake-windows
Add MSVC support to c++ cmake build
2017-10-21 13:16:23 -07:00
Terence Parr 0839970e00 Revert "CMake build fixes for Visual Studio" 2017-10-21 12:55:16 -07:00
Terence Parr fa72e72de0 Merge pull request #2011 from gendalph/master
CMake build fixes for Visual Studio
2017-10-21 12:53:53 -07:00
gendalph 50d2d3ef55 CMake build fixes for Visual Studio
Remove unsupported cmd line options (gcc).
Disable warning for DLL.
2017-09-12 22:10:59 +03:00
Matt Hauck 11d185f744 add some missing flags; fix debug build 2017-07-27 22:08:13 -07:00
Matt Hauck b41782964b Add MSVC support to c++ cmake build 2017-07-27 21:37:09 -07:00
Matt Hauck 95338f710e Ignore Cmake policy CMP0054 2017-07-27 20:54:59 -07:00
Mike Lischke 1503821fa6 Small fix in cmake file. Fixes #1809. 2017-04-13 09:08:56 +02:00
Mike Lischke 8b43f3f7e0 Some deployment changes because of license file changes. 2017-01-16 13:14:40 +01:00
Mike Lischke fc5c1a29f9 Next attempt to get the C++ runtime compiled in Travis CI. 2016-10-04 10:17:59 +02:00
Mike Lischke bb5d7ef0b6 Set minimum cmake version to 3.1 for C++ target. 2016-10-04 10:09:31 +02:00
Tim O'Callaghan d6d50457ff Updated CMake for demo to:
- Only require JRE
- Support out of tree build from antlr repostitory
- Support Superproject build with ExternalAntlr4Cpp cmake module

ExternalAntlr4Cpp module has quickstart documentation for people to be
able to start working quicly with antlr4cpp from the base demo sources
see source file for example.
2016-07-24 21:58:45 +02:00
Mike Lischke d46ef90aa0 Fixed some cmake issues. Closes issue #13 and issue #8.
Additionally a warning was fixed (std::move prevents copy elision)
2016-07-20 16:24:12 +02:00
Mike Lischke 9e30f3f265 A few minor changes related to building via cmake. 2016-05-23 09:40:48 +02:00
Mike Lischke e2d545fb2e Changed exception object back in error reporting + removed precompiled headers with cmake.
- Reverted the change from RecognitionException to exception_ptr (and removed the make_exception_ptr() call). This is not needed and only leads to object slicing. Instead we check directly the given exception object for the individual handling in reportError() and use std::current_exception() to get the exception pointer for our contexts.
- Removed precompiled header stuff from cmake file for the same reasons as I did in the XCode project (Visual Studio still pending).
2016-05-18 18:16:08 +02:00
Marcin Szalowicz 5653be36fa Runtime Cpp: disable warnings and remove unnecessary files
Signed-off-by: Mike Lischke <mike@lischke-online.de>
2016-05-09 15:24:03 +02:00
Mike Lischke 6c21223d2e Added cmake target (Linux + OSX) + fixed a number of warnings.
- Compiling with cmake brought up quite a number of new warnings. Some of them have to be disabled yet (dollar in identifier, four char constant, overloaded virtual). The others have all been fixed.
- Updated the README to include build instruction.
2016-05-06 16:48:59 +02:00