antlr4_9.runtime.cpp: fix build

This commit is contained in:
Aaron Jheng
2025-10-14 14:46:42 +08:00
parent 6fd49fba4e
commit 50433c5c8f
2 changed files with 22 additions and 0 deletions
@@ -0,0 +1,20 @@
diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt
index e549f113f..c84f591c2 100644
--- a/runtime/Cpp/CMakeLists.txt
+++ b/runtime/Cpp/CMakeLists.txt
@@ -28,15 +28,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(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -194,9 +194,11 @@ in
extraCppBuildInputs = [ utf8cpp ] ++ lib.optional stdenv.hostPlatform.isLinux libuuid;
extraCppCmakeFlags = [
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-I${lib.getDev utf8cpp}/include/utf8cpp")
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
];
extraPatches = [
./utf8cpp.patch
./4.9.runtime.cpp.cmake.patch
];
}).antlr;