From 8ee65f821acf1853024e36722fe3cdcaa7b16b29 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Tue, 14 Oct 2025 14:43:46 +0800 Subject: [PATCH] antlr4_11.runtime.cpp: fix build --- .../antlr/4.11.runtime.cpp.cmake.patch | 20 +++++++++++++++++++ pkgs/development/tools/parsing/antlr/4.nix | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch diff --git a/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch b/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch new file mode 100644 index 000000000000..6c40a1bf9633 --- /dev/null +++ b/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch @@ -0,0 +1,20 @@ +diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt +index df621b11d..c20b92170 100644 +--- a/runtime/Cpp/CMakeLists.txt ++++ b/runtime/Cpp/CMakeLists.txt +@@ -39,15 +39,10 @@ project(LIBANTLR4) + if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR + CMAKE_VERSION VERSION_GREATER "3.0.0") + CMAKE_POLICY(SET CMP0026 NEW) +- CMAKE_POLICY(SET CMP0054 OLD) +- CMAKE_POLICY(SET CMP0045 OLD) +- CMAKE_POLICY(SET CMP0042 OLD) + endif() + + if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR + CMAKE_VERSION VERSION_GREATER "3.3.0") +- CMAKE_POLICY(SET CMP0059 OLD) +- CMAKE_POLICY(SET CMP0054 OLD) + endif() + + if(APPLE) diff --git a/pkgs/development/tools/parsing/antlr/4.nix b/pkgs/development/tools/parsing/antlr/4.nix index a3519c641534..6398c8eed341 100644 --- a/pkgs/development/tools/parsing/antlr/4.nix +++ b/pkgs/development/tools/parsing/antlr/4.nix @@ -172,6 +172,9 @@ in # not available in a sandboxed build. (lib.cmakeBool "ANTLR_BUILD_CPP_TESTS" false) ]; + extraPatches = [ + ./4.11.runtime.cpp.cmake.patch + ]; }).antlr; antlr4_10 =