<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Xmake v2.7.6 發布,新增 Verilog 和 C++ Modules 分發支持

      Xmake 是一個基于 Lua 的輕量級跨平臺構建工具。

      它非常的輕量,沒有任何依賴,因為它內置了 Lua 運行時。

      它使用 xmake.lua 維護項目構建,相比 makefile/CMakeLists.txt,配置語法更加簡潔直觀,對新手非常友好,短時間內就能快速入門,能夠讓用戶把更多的精力集中在實際的項目開發上。

      我們能夠使用它像 Make/Ninja 那樣可以直接編譯項目,也可以像 CMake/Meson 那樣生成工程文件,另外它還有內置的包管理系統來幫助用戶解決 C/C++ 依賴庫的集成使用問題。

      目前,Xmake 主要用于 C/C++ 項目的構建,但是同時也支持其他 native 語言的構建,可以實現跟 C/C++ 進行混合編譯,同時編譯速度也是非常的快,可以跟 Ninja 持平。

      Xmake = Build backend + Project Generator + Package Manager + [Remote|Distributed] Build + Cache
      

      盡管不是很準確,但我們還是可以把 Xmake 按下面的方式來理解:

      Xmake ≈ Make/Ninja + CMake/Meson + Vcpkg/Conan + distcc + ccache/sccache
      

      新特性介紹

      Verilog 仿真程序支持

      iVerilog 仿真器

      通過 add_requires("iverilog") 配置,我們能夠自動拉取 iverilog 工具鏈包,然后使用 set_toolchains("@iverilog") 自動綁定工具鏈來編譯工程。

      add_requires("iverilog")
      target("hello")
          add_rules("iverilog.binary")
          set_toolchains("@iverilog")
          add_files("src/*.v")
      
      設置抽象配置
      add_requires("iverilog")
      target("hello")
          add_rules("iverilog.binary")
          set_toolchains("@iverilog")
          add_files("src/*.v")
          add_defines("TEST")
          add_includedirs("inc")
          set_languages("v1800-2009")
      

      我們可以通過 set_languages("v1800-2009") 來設置切換 Verilog 的語言標準。

      目前支持的一些取值和映射關系如下:

      ["v1364-1995"] = "-g1995"
      ["v1364-2001"] = "-g2001"
      ["v1364-2005"] = "-g2005"
      ["v1800-2005"] = "-g2005-sv"
      ["v1800-2009"] = "-g2009"
      ["v1800-2012"] = "-g2012"
      
      設置自定義 flags
      add_requires("iverilog")
      target("hello")
          add_rules("iverilog.binary")
          set_toolchains("@iverilog")
          add_files("src/*.v")
          add_values("iverilogs.flags", "-DTEST")
      
      構建工程
      $ xmake
      checking for iverilog ... iverilog
      checking for vvp ... vvp
      [ 50%]: linking.iverilog hello.vvp
      [100%]: build ok!
      
      運行程序
      $ xmake run
      hello world!
      LXT2 info: dumpfile hello.vcd opened for output.
      src/main.v:6: $finish called at 0 (1s)
      

      更多完整例子:iVerilog Examples

      Verilator 仿真器

      通過 add_requires("verilator") 配置,我們能夠自動拉取 verilator 工具鏈包,然后使用 set_toolchains("@verilator") 自動綁定到工具鏈來編譯工程。

      add_requires("verilator")
      target("hello")
          add_rules("verilator.binary")
          set_toolchains("@verilator")
          add_files("src/*.v")
          add_files("src/*.cpp")
      

      verilator 工程,我們需要一個額外的 sim_main.cpp 文件參與編譯,作為程序的入口代碼。

      #include "hello.h"
      #include "verilated.h"
      
      int main(int argc, char** argv) {
          VerilatedContext* contextp = new VerilatedContext;
          contextp->commandArgs(argc, argv);
          hello* top = new hello{contextp};
          while (!contextp->gotFinish()) { top->eval(); }
          delete top;
          delete contextp;
          return 0;
      }
      
      設置抽象配置
      add_requires("verilator")
      target("hello")
          add_rules("verilator.binary")
          set_toolchains("@verilator")
          add_files("src/*.v")
          add_defines("TEST")
          add_includedirs("inc")
          set_languages("v1800-2009")
      

      我們可以通過 set_languages("v1800-2009") 來設置切換 Verilog 的語言標準。

      目前支持的一些取值和映射關系如下:

      -- Verilog
      ["v1364-1995"] = "+1364-1995ext+v",
      ["v1364-2001"] = "+1364-2001ext+v",
      ["v1364-2005"] = "+1364-2005ext+v",
      -- SystemVerilog
      ["v1800-2005"] = "+1800-2005ext+v",
      ["v1800-2009"] = "+1800-2009ext+v",
      ["v1800-2012"] = "+1800-2012ext+v",
      ["v1800-2017"] = "+1800-2017ext+v",
      
      設置自定義 flags
      add_requires("verilator")
      target("hello")
          add_rules("verilator.binary")
          set_toolchains("@verilator")
          add_files("src/*.v")
          add_files("src/*.cpp")
          add_values("verilator.flags", "--trace", "--timing")
      
      構建工程
      $ xmake
      [  0%]: compiling.verilog src/main.v
      [ 15%]: cache compiling.release /Users/ruki/.xmake/packages/v/verilator/2023.1.10/cd2268409c1d44799288c7759b3cbd56/share/verilator/include/verilated.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello___024root__Slow.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello___024root__DepSet_h9053a130__0__Slow.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello.cpp
      [ 15%]: cache compiling.release /Users/ruki/.xmake/packages/v/verilator/2023.1.10/cd2268409c1d44799288c7759b3cbd56/share/verilator/include/verilated_threads.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello__Syms.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello___024root__DepSet_h07139e86__0.cpp
      [ 15%]: cache compiling.release src/sim_main.cpp
      [ 15%]: cache compiling.release build/.gens/hello/macosx/x86_64/release/rules/verilator/hello___024root__DepSet_h9053a130__0.cpp
      [ 84%]: linking.release hello
      [100%]: build ok!
      
      運行程序
      $ xmake run
      ruki-2:hello ruki$ xmake run
      hello world!
      - src/main.v:4: Verilog $finish
      

      更多完整例子:Verilator

      支持 C++ Module 分發

      非常感謝 Arthapz 在新版本中繼續幫忙改進了 xmake 對 C++ Modules 的支持。

      現在,我們可以將 C++ Modules 做成包進行分發,然后在其他項目中進行快速集成和復用。

      它是基于 p2473r1 中對模塊分發的設計草案做的一個原型實現。

      制作分發 C++ Modules 包

      我們先使用 xmake.lua 維護模塊的構建,并通過指定 {install = true},來告訴 xmake 哪些模塊文件需要安裝對外分發。

      add_rules("mode.release", "mode.debug")
      set_languages("c++20")
      
      target("foo")
          set_kind("static")
          add_files("*.cpp")
          add_files("*.mpp", { install = true })
      

      然后,我們把它做成包,可以提交到 xmake-repo 倉庫,當然也可以直接做成本地包,或者私有倉庫包。

      這里,為了方便測試驗證,我們僅僅通過 set_sourcedir 將它做成本地包。

      package("foo")
          set_sourcedir(path.join(os.scriptdir(), "src"))
          on_install(function(package)
              import("package.tools.xmake").install(package, {})
          end)
      

      集成 C++ Modules 包

      然后,我們通過 add_requires("foo") 的包集成接口,對 C++ Modules 包進行快速集成使用。

      由于 foo 的模塊包,我們放在私有倉庫中定義,所以我們通過 add_repositories("my-repo my-repo") 引入自己的包倉庫。

      如果,包已經提交到 xmake-repo 官方倉庫,就不需要額外配置它。

      add_rules("mode.release", "mode.debug")
      set_languages("c++20")
      
      add_repositories("my-repo my-repo")
      add_requires("foo", "bar")
      
      target("packages")
          set_kind("binary")
          add_files("src/*.cpp")
          add_packages("foo", "bar")
          set_policy("build.c++.modules", true)
      

      集成好包后,我們就可以執行 xmake 命令,一鍵下載、編譯、集成 C++ Modules 包來使用。

      $ xmake
      checking for platform ... linux
      checking for architecture ... x86_64
      note: install or modify (m) these packages (pass -y to skip confirm)?
      in my-repo:
        -> foo latest
        -> bar latest
      please input: y (y/n/m)
      
        => install bar latest .. ok
        => install foo latest .. ok
      [  0%]: generating.module.deps src/main.cpp
      [  0%]: generating.module.deps /mnt/xmake/tests/projects/c++/modules/packages/build/.packages/b/bar/latest/4e0143c97b65425b855ad5fd03038b6a/modules/bar/bar.mpp
      [  0%]: generating.module.deps /mnt/xmake/tests/projects/c++/modules/packages/build/.packages/f/foo/latest/4e0143c97b65425b855ad5fd03038b6a/modules/foo/foo.mpp
      [ 14%]: compiling.module.release bar
      [ 14%]: compiling.module.release foo
      [ 57%]: compiling.release src/main.cpp
      [ 71%]: linking.release packages
      [100%]: build ok!
      

      注:每個包安裝后,會在包路徑下,存儲維護模塊的 meta-info 文件,這是 p2473r1.pdf 中約定的一種格式規范,也許它不是最終的標準,但這并不影響我們現在去使用模塊的分發。

      $ cat ./build/.packages/f/foo/latest/4e0143c97b65425b855ad5fd03038b6a/modules/foo/foo.mpp.meta-info
      {"_VENDOR_extension":{"xmake":{"name":"foo","file":"foo.mpp"}},"definitions":{},"include_paths":{}}
      

      完整的例子工程見:C++ Modules 包分發例子工程

      支持 C++23 Std Modules

      Arthapz 也幫忙改進了對 C++23 Std Modules 的支持。

      目前三個編譯器對它的支持進展:

      Msvc

      最新 Visual Studio 17.5 preview 已經支持,并且非標準的 ifc std modules 將被廢棄。

      對于標準的 C++23 std modules,我們是這么引入的。

      import std;
      

      而對于 ifc std modules,我們需要這么寫:

      import std.core;
      

      它不是 C++23 標準,僅僅 msvc 提供,對其他編譯器并不兼容,以后新版本 msvc 中也會逐步廢棄。
      因此新版本 Xmake 將僅僅 C++23 std modules,不再支持廢棄的 ifc std modules。

      Clang

      目前最新的 clang 似乎也還沒完全支持 C++23 std modules,當前還是 draft patch 狀態,#D135507

      但是,Xmake 也對它進行了支持,如果大家想要嘗鮮,可以自行合入這個 patch,然后使用 xmake 來測試。

      另外,低版本的 clang 也有對非標準的 std modules 做了實驗性支持。

      我們還是可以在低版本 clang 中嘗試性使用 xmake 來構建 std modules,盡管它可能還只是個玩具(會遇到很多問題)。

      相關討論見:#3255

      Gcc

      目前還不支持。

      Xrepo 自動補全支持

      之前,我們僅僅支持 xmake 命令的不全,新版本中,我們還支持了 xrepo install 命令的不全,
      可以自動搜索 xmake-repo 倉庫的包,來不全我們的安裝命令。

      非常感謝 @glcraft 的貢獻。

      $ xrepo install libp
      libpaper          libpfm            libpng            libpqxx           libpthread-stubs
      libpcap           libplist          libpq             libpsl
      

      更新內容

      新特性

      • #3228: C++ modules 的安裝發布,以及從包中導入 C++ modules 支持
      • #3257: 增加對 iverilog 和 verilator 的支持
      • 支持 xp 和 vc6.0
      • #3214: xrepo install 的自動補全支持

      改進

      • #3255: 改進 clang libc++ 模塊支持
      • 支持使用 mingw 編譯 xmake
      • 改進 xmake 在 win xp 上的兼容性
      • 如果外部依賴被啟用,切換 json 模塊到純 lua 實現,移除對 lua-cjson 的依賴

      Bugs 修復

      • #3229: 修復 vs2015 下找不到 rc.exe 問題
      • #3271: 修復支持帶有空格的宏定義
      • #3273: 修復 nim 鏈接錯誤
      • #3286: 修復 compile_commands 對 clangd 的支持
      posted @ 2023-01-27 18:32  waruqi  Views(427)  Comments(0)    收藏  舉報
      主站蜘蛛池模板: 四虎成人精品永久网站| 亚洲狼人久久伊人久久伊| 国产超碰无码最新上传| 亚洲成人av综合一区| 亚洲av永久无码精品水牛影视| 色婷婷日日躁夜夜躁| 精品国产一区二区三区av色诱| 亚洲国产区男人本色vr| 日本高清中文字幕免费一区二区| 一本本月无码-| 日韩人妻少妇一区二区三区 | 国产精品午夜福利视频| 午夜国产小视频| 欧美综合婷婷欧美综合五月 | 天天澡日日澡狠狠欧美老妇| 4hu44四虎www在线影院麻豆 | 一日本道伊人久久综合影| 国产精品中文字幕av| 亚洲区综合区小说区激情区| 久青草国产在视频在线观看 | 日日麻批免费40分钟无码| 亚洲国产精品线观看不卡| 日日噜噜夜夜狠狠视频| 香港三级韩国三级日本三级| 女人张开腿无遮无挡视频| 亚洲精品无amm毛片| 色欲综合久久中文字幕网| 精品久久久中文字幕人妻| 在线 欧美 中文 亚洲 精品| 国产偷拍自拍视频在线观看| 人妻中文字幕精品一页| 玩弄放荡人妻少妇系列| 国产精成人品日日拍夜夜| 久操热在线视频免费观看| 国产一区二区三区怡红院| 亚洲色大成网站WWW永久麻豆| 人妻一区二区三区人妻黄色| 日本欧美一区二区免费视频| 成人亚洲综合av天堂| 日本极品少妇videossexhd| 亚洲香蕉av一区二区蜜桃|