You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
target information: C++
antlr version: antlr 4.10
smallest possible grammar: None
smallest possible code to reproduce:
when following environment was set, I cannot use ExternalAntlr4Cpp to compile the antlr_runtime:
It's a CentOS 7. The system's gcc is version 4.8.5, ccache version is v4.0 , and I installed gcc 7.3.0 using scl toolset.
# Just g++-5.0 and greater contain <codecvt> header. (test in ubuntu)
if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0))
message(FATAL_ERROR"${PROJECT_NAME} requires g++ 5.0 or greater.")
endif ()
Here the variable value of CMAKE_CXX_COMPILER is the path to ccache(ccache's version is 4.0), and the gcc is in the variable CMAKE_CXX_COMPILER_ARG1. The variable GCC_VERSION here may be empty.
expected behavior:
ExternalAntlr4Cpp can work when using ccache.
a possible solution:
use CMAKE_CXX_COMPILER_VERSION other than ${CMAKE_CXX_COMPILER} -dumpversion
When the file changed, the behavior is normal:
if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0))
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.")
endif ()
target information: C++
antlr version: antlr 4.10
smallest possible grammar: None
smallest possible code to reproduce:
when following environment was set, I cannot use ExternalAntlr4Cpp to compile the antlr_runtime:
It's a CentOS 7. The system's gcc is version 4.8.5, ccache version is v4.0 , and I installed gcc 7.3.0 using scl toolset.
It has an error:
I found the following code cannot get the version 7.3.0 in the latest version:
antlr4/runtime/Cpp/CMakeLists.txt
Lines 124 to 130 in aa1f1f1
as the same in v4.10.1:
antlr4/runtime/Cpp/CMakeLists.txt
Lines 110 to 116 in 44d87bc
Here the variable value of
CMAKE_CXX_COMPILER
is the path to ccache(ccache's version is 4.0), and the gcc is in the variableCMAKE_CXX_COMPILER_ARG1
. The variableGCC_VERSION
here may be empty.expected behavior:
ExternalAntlr4Cpp can work when using ccache.
a possible solution:
use
CMAKE_CXX_COMPILER_VERSION
other than${CMAKE_CXX_COMPILER} -dumpversion
When the file changed, the behavior is normal:
reference:
reference 1 Check GCC minor: https://stackoverflow.com/questions/4058565/check-gcc-minor-in-cmake
reference 2 How to use ccache with cmake:https://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmake
some code segment
Addition cmake file segment:
and then link antlr4_static to the project:
The text was updated successfully, but these errors were encountered: