diff --git a/.github/workflows/build_clang_tidy_qt5.yml b/.github/workflows/build_clang_tidy_qt5.yml index ce5dab93..5c3d63f7 100644 --- a/.github/workflows/build_clang_tidy_qt5.yml +++ b/.github/workflows/build_clang_tidy_qt5.yml @@ -31,12 +31,12 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install uuid-dev shell: bash - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the project diff --git a/.github/workflows/build_clang_tidy_qt6.yml b/.github/workflows/build_clang_tidy_qt6.yml index 69784474..a3e7d7a6 100644 --- a/.github/workflows/build_clang_tidy_qt6.yml +++ b/.github/workflows/build_clang_tidy_qt6.yml @@ -31,12 +31,12 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install uuid-dev shell: bash - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the project diff --git a/.github/workflows/build_linux_qt5.yml b/.github/workflows/build_linux_qt5.yml index f3a7aa17..6cd43438 100644 --- a/.github/workflows/build_linux_qt5.yml +++ b/.github/workflows/build_linux_qt5.yml @@ -26,12 +26,12 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install uuid-dev shell: bash - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the ${{ github.event.repository.name }} diff --git a/.github/workflows/build_linux_qt6.yml b/.github/workflows/build_linux_qt6.yml index 8d1107b4..e22b0a1e 100644 --- a/.github/workflows/build_linux_qt6.yml +++ b/.github/workflows/build_linux_qt6.yml @@ -26,12 +26,12 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install uuid-dev shell: bash - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the ${{ github.event.repository.name }} diff --git a/.github/workflows/build_windows_qt5.yml b/.github/workflows/build_windows_qt5.yml index 397719f5..fe7ebe7a 100644 --- a/.github/workflows/build_windows_qt5.yml +++ b/.github/workflows/build_windows_qt5.yml @@ -46,12 +46,12 @@ jobs: echo "D:/a/${{ github.event.repository.name }}/tools/jom/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append shell: powershell - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the project diff --git a/.github/workflows/build_windows_qt6.yml b/.github/workflows/build_windows_qt6.yml index 7d9db0c7..020882db 100644 --- a/.github/workflows/build_windows_qt6.yml +++ b/.github/workflows/build_windows_qt6.yml @@ -46,12 +46,12 @@ jobs: echo "D:/a/${{ github.event.repository.name }}/tools/jom/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append shell: powershell - # Checkout dlt-viewer's revision v2.24.0 + # Checkout dlt-viewer's revision v2.25.0 - name: Checkout of the dlt-viewer uses: actions/checkout@v3 with: repository: GENIVI/dlt-viewer - ref: ebb3c355bc0edf2b6c3be84452b8afa4d1a82641 + ref: v2.25.0 # Checkout project's revision, which is pushed - name: Checkout of the project diff --git a/dltmessageanalyzerplugin/src/CMakeLists.txt b/dltmessageanalyzerplugin/src/CMakeLists.txt index 58792a92..044990f5 100644 --- a/dltmessageanalyzerplugin/src/CMakeLists.txt +++ b/dltmessageanalyzerplugin/src/CMakeLists.txt @@ -1,5 +1,5 @@ ################### CPP ################################### -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ################### CPP ( END ) ########################### @@ -94,10 +94,10 @@ DMA_sync_q_custom_plot() # minimum required CMAKE version CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR) -cmake_policy(SET CMP0071 NEW) - list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +cmake_policy(SET CMP0071 NEW) + # required if linking to static library add_definitions(-DANTLR4CPP_STATIC) @@ -110,7 +110,7 @@ include_directories(${ANTLR4_INCLUDE_DIRS}) # set variable pointing to the antlr tool that supports C++ # this is not required if the jar file can be found under PATH environment -set(ANTLR_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/antlr/antlr-4.8-complete.jar) +set(ANTLR_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/antlr/antlr-4.13.1-complete.jar) # add macros to generate ANTLR Cpp code from grammar find_package(ANTLR REQUIRED) diff --git a/dltmessageanalyzerplugin/src/cmake/Antlr4Package.md b/dltmessageanalyzerplugin/src/cmake/Antlr4Package.md index 17a63037..40e7cc2f 100644 --- a/dltmessageanalyzerplugin/src/cmake/Antlr4Package.md +++ b/dltmessageanalyzerplugin/src/cmake/Antlr4Package.md @@ -2,17 +2,17 @@ ## The `antlr4-generator` Package -To use the Package you must insert a +To use the Package you must insert a ```cmake find_package(antlr4-generator REQUIRED) ``` line in your `CMakeList.txt` file. -The package exposes a function `antlr4_generate` that generates the required setup to call ANTLR for a +The package exposes a function `antlr4_generate` that generates the required setup to call ANTLR for a given input file during build. The following table lists the parameters that can be used with the function: - + Argument# | Required | Default | Use ----------|-----------|---------|--- 0 | Yes | n/a | Unique target name. It is used to generate CMake Variables to reference the various outputs of the generation @@ -42,7 +42,7 @@ Output variable | Meaning ```cmake # generate parser with visitor classes. # put the classes in C++ namespace 'antlrcpptest::' - antlr4_generate( + antlr4_generate( antlrcpptest_parser ${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4 LEXER @@ -56,7 +56,7 @@ Output variable | Meaning ## The `antlr4-runtime` Package -To use the Package you must insert a +To use the Package you must insert a ```cmake find_package(antlr4-runtime REQUIRED) ``` @@ -85,7 +85,7 @@ include_directories( ${ANTLR4_INCLUDE_DIR} ) add_dependencies( Parsertest antlr4_shared ) # add runtime to project link libraries -target_link_libraries( Parsertest PRIVATE +target_link_libraries( Parsertest PRIVATE antlr4_shared) ``` @@ -94,12 +94,12 @@ target_link_libraries( Parsertest PRIVATE # Bring in the required packages find_package(antlr4-runtime REQUIRED) find_package(antlr4-generator REQUIRED) - + # Set path to generator - set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.8-complete.jar) - + set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.13.1-complete.jar) + # generate lexer - antlr4_generate( + antlr4_generate( antlrcpptest_lexer ${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4 LEXER @@ -107,9 +107,9 @@ target_link_libraries( Parsertest PRIVATE FALSE "antlrcpptest" ) - + # generate parser - antlr4_generate( + antlr4_generate( antlrcpptest_parser ${CMAKE_CURRENT_SOURCE_DIR}/TParser.g4 PARSER @@ -119,18 +119,18 @@ target_link_libraries( Parsertest PRIVATE "${ANTLR4_TOKEN_FILES_antlrcpptest_lexer}" "${ANTLR4_TOKEN_DIRECTORY_antlrcpptest_lexer}" ) - + # add directories for generated include files include_directories( ${PROJECT_BINARY_DIR} ${ANTLR4_INCLUDE_DIR} ${ANTLR4_INCLUDE_DIR_antlrcpptest_lexer} ${ANTLR4_INCLUDE_DIR_antlrcpptest_parser} ) - + # add generated source files add_executable( Parsertest main.cpp ${ANTLR4_SRC_FILES_antlrcpptest_lexer} ${ANTLR4_SRC_FILES_antlrcpptest_parser} ) - + # add required runtime library add_dependencies( Parsertest antlr4_shared ) - - target_link_libraries( Parsertest PRIVATE + + target_link_libraries( Parsertest PRIVATE antlr4_shared) - + ``` - + diff --git a/dltmessageanalyzerplugin/src/cmake/ExternalAntlr4Cpp.cmake b/dltmessageanalyzerplugin/src/cmake/ExternalAntlr4Cpp.cmake index 222112e3..38df997a 100644 --- a/dltmessageanalyzerplugin/src/cmake/ExternalAntlr4Cpp.cmake +++ b/dltmessageanalyzerplugin/src/cmake/ExternalAntlr4Cpp.cmake @@ -5,7 +5,7 @@ include(ExternalProject) set(ANTLR4_ROOT ${CMAKE_CURRENT_BINARY_DIR}/antlr4_runtime/src/antlr4_runtime) set(ANTLR4_INCLUDE_DIRS ${ANTLR4_ROOT}/runtime/Cpp/runtime/src) set(ANTLR4_GIT_REPOSITORY https://github.com/antlr/antlr4.git) -set(ANTLR4_ZIP_REPOSITORY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/antlr/antlr4-4.8.zip) +set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.13.1.zip) if(NOT DEFINED ANTLR4_TAG) # Set to branch name to keep library updated at the cost of needing to rebuild after 'clean' # Set to commit hash to keep the build stable and does not need to rebuild after 'clean' @@ -89,6 +89,7 @@ if(ANTLR4_ZIP_REPOSITORY) CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT} + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON INSTALL_COMMAND "" EXCLUDE_FROM_ALL 1) else() diff --git a/dltmessageanalyzerplugin/src/cmake/FindANTLR.cmake b/dltmessageanalyzerplugin/src/cmake/FindANTLR.cmake index 5ff866fc..fb71cc51 100644 --- a/dltmessageanalyzerplugin/src/cmake/FindANTLR.cmake +++ b/dltmessageanalyzerplugin/src/cmake/FindANTLR.cmake @@ -2,7 +2,7 @@ find_package(Java QUIET COMPONENTS Runtime) if(NOT ANTLR_EXECUTABLE) find_program(ANTLR_EXECUTABLE - NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.8-complete.jar) + NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.13.1-complete.jar) endif() if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE) @@ -14,7 +14,7 @@ if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE) if(ANTLR_COMMAND_RESULT EQUAL 0) - string(REGEX MATCH "Version [0-9]+(\\.[0-9])*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT}) + string(REGEX MATCH "Version [0-9]+(\\.[0-9]+)*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT}) string(REPLACE "Version " "" ANTLR_VERSION ${ANTLR_VERSION}) else() message( diff --git a/dltmessageanalyzerplugin/src/cmake/README.md b/dltmessageanalyzerplugin/src/cmake/README.md index 77e9da6c..c28af520 100644 --- a/dltmessageanalyzerplugin/src/cmake/README.md +++ b/dltmessageanalyzerplugin/src/cmake/README.md @@ -6,7 +6,7 @@ Here is how you can use this external project to create the antlr4cpp demo to st 1. Make a subfolder cmake 2. Copy the files in this folder to srcfolder/cmake 3. Cut below and use it to create srcfolder/CMakeLists.txt - 4. Copy main.cpp, TLexer.g4 and TParser.g4 to ./srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo) + 4. Copy main.cpp, TLexer.g4 and TParser.g4 to srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo) 2. Make a build folder e.g. ~/buildfolder/ 3. From the buildfolder, run `cmake ~/srcfolder; make` @@ -16,14 +16,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -# compiler must be 11 or 14 -set(CMAKE_CXX_STANDARD 11) +# compiler must be 17 +set(CMAKE_CXX_STANDARD 17) # required if linking to static library add_definitions(-DANTLR4CPP_STATIC) # using /MD flag for antlr4_runtime (for Visual C++ compilers only) set(ANTLR4_WITH_STATIC_CRT OFF) + +# Specify the version of the antlr4 library needed for this project. +# By default the latest version of antlr4 will be used. You can specify a +# specific, stable version by setting a repository tag value or a link +# to a zip file containing the libary source. +# set(ANTLR4_TAG 4.13.1) +# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.13.1.zip) + # add external build for antlrcpp include(ExternalAntlr4Cpp) # add antrl4cpp artifacts to project environment @@ -31,7 +39,7 @@ include_directories(${ANTLR4_INCLUDE_DIRS}) # set variable pointing to the antlr tool that supports C++ # this is not required if the jar file can be found under PATH environment -set(ANTLR_EXECUTABLE /home/user/antlr-4.8-complete.jar) +set(ANTLR_EXECUTABLE /home/user/antlr-4.13.1-complete.jar) # add macros to generate ANTLR Cpp code from grammar find_package(ANTLR REQUIRED) @@ -123,12 +131,14 @@ ANTLR4_RUNTIME_LIBRARIES - path to antlr4 shared runtime library (such as DLL, D ANTLR4_TAG - branch/tag used for building antlr4 library ``` -`ANTLR4_TAG` is set to master branch by default to keep antlr4 updated. However, it will be required to rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically update to latest commit. +`ANTLR4_TAG` is set to master branch by default to keep the antlr4 library up to date. However, this will require a rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically updating to latest commit. -The ANTLR C++ runtime source is downloaded from GitHub by default. However, users may specify `ANTLR4_ZIP_REPOSITORY` to list the zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*). This variable can list a zip file included in the project directory; this is useful for maintaining a canonical source for each new build. +By defualt the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build. 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. +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`. + ### Examples To build and link ANTLR4 static library to a target one may call: diff --git a/dltmessageanalyzerplugin/src/cmake/antlr4-generator.cmake.in b/dltmessageanalyzerplugin/src/cmake/antlr4-generator.cmake.in index 5839cbe2..63996514 100644 --- a/dltmessageanalyzerplugin/src/cmake/antlr4-generator.cmake.in +++ b/dltmessageanalyzerplugin/src/cmake/antlr4-generator.cmake.in @@ -88,7 +88,7 @@ function(antlr4_generate else() set(Antlr4_BuildListenerOption "-no-listener") endif () - + if ( ( ARGC GREATER_EQUAL 5 ) AND ARGV4 ) set(Antlr4_BuildVisitorOption "-visitor") @@ -101,7 +101,7 @@ function(antlr4_generate else() set(Antlr4_BuildVisitorOption "-no-visitor") endif () - + if ( (ARGC GREATER_EQUAL 6 ) AND (NOT ${ARGV5} STREQUAL "") ) set(Antlr4_NamespaceOption "-package;${ARGV5}") @@ -109,7 +109,7 @@ function(antlr4_generate else() set(Antlr4_NamespaceOption "") endif () - + if ( (ARGC GREATER_EQUAL 7 ) AND (NOT ${ARGV6} STREQUAL "") ) set(Antlr4_AdditionalDependencies ${ARGV6}) else() @@ -157,7 +157,7 @@ function(antlr4_generate # export generated cpp files into list foreach(generated_file ${Antlr4_GeneratedTargets}) - + if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set_source_files_properties( ${generated_file} diff --git a/dltmessageanalyzerplugin/src/cmake/antlr4-runtime.cmake.in b/dltmessageanalyzerplugin/src/cmake/antlr4-runtime.cmake.in index 860aeb60..697b36c6 100644 --- a/dltmessageanalyzerplugin/src/cmake/antlr4-runtime.cmake.in +++ b/dltmessageanalyzerplugin/src/cmake/antlr4-runtime.cmake.in @@ -5,6 +5,9 @@ set(ANTLR_VERSION @ANTLR_VERSION@) set_and_check(ANTLR4_INCLUDE_DIR "@PACKAGE_ANTLR4_INCLUDE_DIR@") set_and_check(ANTLR4_LIB_DIR "@PACKAGE_ANTLR4_LIB_DIR@") +include(CMakeFindDependencyMacro) +find_dependency(Threads) + include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake) check_required_components(antlr) diff --git a/md/installation_guide/installation_guide.md b/md/installation_guide/installation_guide.md index 5e5287c0..cca099db 100644 --- a/md/installation_guide/installation_guide.md +++ b/md/installation_guide/installation_guide.md @@ -31,7 +31,7 @@ Table of contents > **Note!** > -> Currently plugin can be built against the v2.24.0 release. +> Currently plugin can be built against the v2.25.0 release. > > The build under the earlier versions, down to the the v2.19.0 is also supported. But you will need to use the compatibility mode. Such an option is described below later on down this page. Search for the "PLUGIN_INTERFACE_VERSION" keyword. > diff --git a/thirdparty/antlr/antlr-4.13.1-complete.jar b/thirdparty/antlr/antlr-4.13.1-complete.jar new file mode 100644 index 00000000..f539ab04 Binary files /dev/null and b/thirdparty/antlr/antlr-4.13.1-complete.jar differ diff --git a/thirdparty/antlr/antlr-4.8-complete.jar b/thirdparty/antlr/antlr-4.8-complete.jar deleted file mode 100644 index 89a0640e..00000000 Binary files a/thirdparty/antlr/antlr-4.8-complete.jar and /dev/null differ diff --git a/thirdparty/antlr/antlr4-4.8.zip b/thirdparty/antlr/antlr4-4.8.zip deleted file mode 100644 index a7d2c07a..00000000 Binary files a/thirdparty/antlr/antlr4-4.8.zip and /dev/null differ