当前位置: 首页 > java >正文

在msys2里面编译antlr4的过程记录

简单记录一下如何在msys2里面的mingw64里面编译antlr4 runtime

第一步:下载压缩包
https://github.com/antlr/antlr4/releases第二步:解压缩第三步:打开msys64 mingw64控制台第四步:cd d:\xxx\xxx 打开cpp运行时目录第五步:mkdir build   ,cd build第六步:这玩意需要联网下载一个谷歌的什么测试的东西,设置好联网代理export http_proxy=代理地址
export https_proxy=代理地址第七步:cmake .. -G "MSYS Makefiles" \-DCMAKE_INSTALL_PREFIX=/mingw64 \-DBUILD_SHARED_LIBS=OFF \-DCMAKE_BUILD_TYPE=Release
-- Building without demo. To enable demo build use: -DWITH_DEMO=True
CMake Warning (dev) at D:/msys64/mingw64/share/cmake/Modules/FetchContent.cmake:1373 (message):The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 isnot set.  The policy's OLD behavior will be used.  When using a URLdownload, the timestamps of extracted files should preferably be that ofthe time of extraction, otherwise code that depends on the extractedcontents might not be rebuilt if the URL changes.  The OLD behaviorpreserves the timestamps from the archive instead, but this is usually notwhat you want.  Update your project to the NEW behavior or specify theDOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid thisrobustness issue.
Call Stack (most recent call first):runtime/CMakeLists.txt:71 (FetchContent_Declare)
This warning is for project developers.  Use -Wno-dev to suppress it.CMake Deprecation Warning at build/_deps/googletest-src/CMakeLists.txt:4 (cmake_minimum_required):Compatibility with CMake < 3.10 will be removed from a future version ofCMake.Update the VERSION argument <min> value.  Or, use the <min>...<max> syntaxto tell CMake that the project requires at least <min> but has been updatedto work with policies introduced by <max> or earlier.CMake Deprecation Warning at build/_deps/googletest-src/googlemock/CMakeLists.txt:45 (cmake_minimum_required):Compatibility with CMake < 3.10 will be removed from a future version ofCMake.Update the VERSION argument <min> value.  Or, use the <min>...<max> syntaxto tell CMake that the project requires at least <min> but has been updatedto work with policies introduced by <max> or earlier.CMake Deprecation Warning at build/_deps/googletest-src/googletest/CMakeLists.txt:56 (cmake_minimum_required):Compatibility with CMake < 3.10 will be removed from a future version ofCMake.Update the VERSION argument <min> value.  Or, use the <min>...<max> syntaxto tell CMake that the project requires at least <min> but has been updatedto work with policies introduced by <max> or earlier.-- Found Python: D:/msys64/mingw64/bin/python3.12.exe (found version "3.12.9") found components: Interpreter
-- Configuring done (12.1s)
-- Generating done (0.4s)
-- Build files have been written to: D:/xxxxx/libs/antlr4_312/build

   出来done就可以make了

  make -j 8

[ 97%] Building CXX object runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathTokenElement.cpp.obj
[ 97%] Building CXX object runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathWildcardAnywhereElement.cpp.obj
[ 98%] Building CXX object runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathWildcardElement.cpp.obj
[ 99%] Linking CXX shared library libantlr4-runtime.dll
[ 99%] Linking CXX static library libantlr4-runtime-static.a
[ 99%] Built target antlr4_shared
[ 99%] Built target antlr4_static
[ 99%] Building CXX object runtime/CMakeFiles/antlr4_tests.dir/tests/Utf8Test.cpp.obj
[100%] Linking CXX executable antlr4_tests.exe
[100%] Built target antlr4_tests

  这就编译出来了。

 make install就可以了

http://www.xdnf.cn/news/216.html

相关文章:

  • C言雅韵集:野指针
  • 初创企业机器学习训练:云服务器配置对效率、成本与可扩展性的影响
  • 解决6栈6层码头集装箱堆栈翻箱最优解问题
  • Android12 ServiceManager::addService源码解读
  • js reduce累加器
  • #去除知乎中“盐选”付费故事
  • @JsonView + 单一 DTO:如何实现多场景 JSON 字段动态渲染
  • 大语言模型智能体:安全挑战与应对之道
  • echarts饼图中心呈现一张图片,并且能动态旋转的效果react组件
  • 天梯赛数据结构合集
  • 51单片机实验三:数码管动态显示
  • Oracle 19c新特性:OCP认证考试与职业跃迁的关键?
  • 如何选择适合您的过程控制器?
  • VSCODE插值表达式失效问题
  • 4.18学习总结
  • CNN与VGG16的关系:从基础到经典模型的通俗解析
  • 【前沿】成像“跨界”测量——扫焦光场成像
  • 【AI部署】腾讯云GPU -—SadTalker的AI数字人访问web服务—未来之窗超算中心
  • 2025mathorcup妈妈杯数学建模挑战赛C题:汽车风阻预测,详细思路,模型,代码更新中
  • 专精特新政策推动,B端UI设计如何赋能中小企业创新发展?
  • 使用VHDL语言实现TXT文件的读写操作
  • 【LeetCode】大厂面试算法真题回忆(61)--组装新的数组
  • 7.Rust+Axum:打造高效 RESTful API 的最佳实践
  • FastGPT安装前,系统环境准备工作?
  • AI Agent系列(十) -Data Agent(数据分析智能体)开源资源汇总
  • Qt QTimer 详解与使用指南
  • PHP最新好看UI个人引导页网页源码
  • Flash存储器(二):SPI NAND Flash与SPI NOR Flash
  • 基于linux 设置无线网卡Monitor模式 sniffer抓包
  • 经济指标学习(二)