diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/antlr4 | |
Diffstat (limited to 'vcpkg/ports/antlr4')
| -rw-r--r-- | vcpkg/ports/antlr4/add-include-chrono.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/antlr4/portfile.cmake | 36 | ||||
| -rw-r--r-- | vcpkg/ports/antlr4/set-export-macro-define-as-private.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/antlr4/vcpkg.json | 23 |
4 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/antlr4/add-include-chrono.patch b/vcpkg/ports/antlr4/add-include-chrono.patch new file mode 100644 index 0000000..c36e848 --- /dev/null +++ b/vcpkg/ports/antlr4/add-include-chrono.patch @@ -0,0 +1,12 @@ +diff --git a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +index 9fd86d6..5220492 100644 +--- a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp ++++ b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +@@ -10,6 +10,7 @@ + #include "support/CPPUtils.h" + + #include "atn/ProfilingATNSimulator.h" ++#include <chrono> + + using namespace antlr4; + using namespace antlr4::atn; diff --git a/vcpkg/ports/antlr4/portfile.cmake b/vcpkg/ports/antlr4/portfile.cmake new file mode 100644 index 0000000..e0aa97f --- /dev/null +++ b/vcpkg/ports/antlr4/portfile.cmake @@ -0,0 +1,36 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO antlr/antlr4
+ HEAD_REF dev
+ REF "${VERSION}"
+ SHA512 afd8ecab637a0e70cddf98f63c918eab2b907f87207624e20e80a79f885d6502d4ab734a602b1707969d61944410828b689ec2f8b09c15314fe991024cde1613 + PATCHES
+ set-export-macro-define-as-private.patch
+ add-include-chrono.patch # https://github.com/antlr/antlr4/pull/4738
+)
+
+set(RUNTIME_PATH "${SOURCE_PATH}/runtime/Cpp")
+
+message(INFO "Configure at '${RUNTIME_PATH}'")
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${RUNTIME_PATH}"
+ OPTIONS
+ -DANTLR_BUILD_STATIC=${BUILD_STATIC}
+ -DANTLR_BUILD_SHARED=${BUILD_SHARED}
+ -DANTLR4_INSTALL=ON
+ -DANTLR_BUILD_CPP_TESTS=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-generator CONFIG_PATH lib/cmake/antlr4-generator DO_NOT_DELETE_PARENT_CONFIG_PATH)
+vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-runtime CONFIG_PATH lib/cmake/antlr4-runtime)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_copy_pdbs()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/antlr4/set-export-macro-define-as-private.patch b/vcpkg/ports/antlr4/set-export-macro-define-as-private.patch new file mode 100644 index 0000000..c8c774f --- /dev/null +++ b/vcpkg/ports/antlr4/set-export-macro-define-as-private.patch @@ -0,0 +1,13 @@ +diff --git a/runtime/Cpp/runtime/CMakeLists.txt b/runtime/Cpp/runtime/CMakeLists.txt +index 86fdab9..97486fb 100644 +--- a/runtime/Cpp/runtime/CMakeLists.txt ++++ b/runtime/Cpp/runtime/CMakeLists.txt +@@ -120,7 +120,7 @@ set(static_lib_suffix "") + if (WIN32) + set(static_lib_suffix "-static") + if (TARGET antlr4_shared) +- target_compile_definitions(antlr4_shared PUBLIC ANTLR4CPP_EXPORTS) ++ target_compile_definitions(antlr4_shared PRIVATE ANTLR4CPP_EXPORTS) + endif() + if (TARGET antlr4_static) + target_compile_definitions(antlr4_static PUBLIC ANTLR4CPP_STATIC) diff --git a/vcpkg/ports/antlr4/vcpkg.json b/vcpkg/ports/antlr4/vcpkg.json new file mode 100644 index 0000000..f93a9f3 --- /dev/null +++ b/vcpkg/ports/antlr4/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "antlr4", + "version": "4.13.2", + "port-version": 1, + "description": "ANother Tool for Language Recognition", + "homepage": "https://www.antlr.org", + "license": "BSD-3-Clause", + "supports": "!uwp", + "dependencies": [ + { + "name": "libuuid", + "platform": "!uwp & !windows & !osx" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |