<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ruki</title>
    <description>The latest articles on DEV Community by ruki (@waruqi).</description>
    <link>https://dev.to/waruqi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F443349%2F761150e1-c3d7-43a6-84db-79b9703f5a5a.jpeg</url>
      <title>DEV Community: ruki</title>
      <link>https://dev.to/waruqi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/waruqi"/>
    <language>en</language>
    <item>
      <title>Xmake v2.7.3 Released, Package Components and C++ Modules Incremental Build Support</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Wed, 09 Nov 2022 06:53:07 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v273-released-package-components-and-c-modules-incremental-build-support-93n</link>
      <guid>https://dev.to/waruqi/xmake-v273-released-package-components-and-c-modules-incremental-build-support-93n</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Xmake&lt;/a&gt; is a lightweight cross-platform build utility based on Lua.&lt;/p&gt;

&lt;p&gt;It is very lightweight and has no dependencies because it has a built-in Lua runtime.&lt;/p&gt;

&lt;p&gt;It uses xmake.lua to maintain project builds and its configuration syntax is very simple and readable.&lt;/p&gt;

&lt;p&gt;We can use it to build project directly like Make/Ninja, or generate project files like CMake/Meson, and it also has a built-in package management system to help users solve the integrated use of C/C++ dependent libraries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Xmake = Build backend + Project Generator + Package Manager + [Remote|Distributed] Build + Cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although not very precise, we can still understand Xmake in the following way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Xmake ~= Make/Ninja + CMake/Meson + Vcpkg/Conan + distcc + ccache/sccache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dmrgkarp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://xmake.io/assets/img/index/package.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dmrgkarp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://xmake.io/assets/img/index/package.gif" width="880" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction of new features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Package component support
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Introduction
&lt;/h4&gt;

&lt;p&gt;This new feature is intended to enable the integration of specific sub-libraries from a C/C++ package, and is generally used for library component integration in larger packages.&lt;/p&gt;

&lt;p&gt;This is because such packages provide a number of sub-libraries, not all of which are required by the user, and linking them all may be problematic.&lt;/p&gt;

&lt;p&gt;Although, previous versions were able to support the feature of sublibrary selection, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml~foo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;graphics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml~bar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;network&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml~foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml~bar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is done by custom configuration of each package, but there are some problems with this approach.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;sfml~foo&lt;/code&gt; and &lt;code&gt;sfml~bar&lt;/code&gt; will be installed repeatedly as two separate packages, taking up double the disk space&lt;/li&gt;
&lt;li&gt;some common code will be compiled repeatedly, which will affect the efficiency of the installation&lt;/li&gt;
&lt;li&gt;if a target depends on both &lt;code&gt;sfml~foo&lt;/code&gt; and &lt;code&gt;sfml~bar&lt;/code&gt;, there will be link conflicts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The impact of double-compilation and disk usage can be very high for very large package integrations such as boost, and can even lead to more than N times the disk usage if there are a large number of sub-library combinations.&lt;/p&gt;

&lt;p&gt;To solve this problem, Xmake has added a package component mode, which offers some of the following benefits.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;fast integration of any number of components in just one compile, greatly improving installation efficiency and reducing disk footprint&lt;/li&gt;
&lt;li&gt;component abstraction, across compilers and platforms, so users don't need to worry about configuring link order dependencies between each sub library&lt;/li&gt;
&lt;li&gt;easier to use&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more background details see: &lt;a href="https://github.com/xmake-io/xmake/issues/2636"&gt;#2636&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Use package components
&lt;/h4&gt;

&lt;p&gt;For the user, using package components is very convenient because the user is not required to maintain the package, as long as the package is used, it is configured with the relevant set of components and we can quickly integrate and use it, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;components&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;components&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  View package components
&lt;/h4&gt;

&lt;p&gt;So how do we know what components are provided by a given package? We can check by executing the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xrepo info sfml
The package info of project:
    require&lt;span class="o"&gt;(&lt;/span&gt;sfml&lt;span class="o"&gt;)&lt;/span&gt;:
      -&amp;gt; description: Simple and Fast Multimedia Library
      -&amp;gt; version: 2.5.1
      ...
      -&amp;gt; components:
         -&amp;gt; system:
         -&amp;gt; graphics: system, window
         -&amp;gt; window: system
         -&amp;gt; audio: system
         -&amp;gt; network: system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Package component configuration
&lt;/h4&gt;

&lt;p&gt;If you are a package maintainer and want to add component support to a package, then you need to configure the package components via the following two interfaces.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add_components: adds a list of package components&lt;/li&gt;
&lt;li&gt;on_component: Configures each package component&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Link configuration for package components
&lt;/h5&gt;

&lt;p&gt;In most cases, a package component only needs to be configured with some of its own sub-link information, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"audio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"window"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;on_component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shared"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;"-s"&lt;/span&gt;
        &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"links"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sfml-graphics"&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;is_plat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"windows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mingw"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shared"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
            &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"links"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"freetype"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"syslinks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"opengl32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"gdi32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"user32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"advapi32"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;on_component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"window"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shared"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;"-s"&lt;/span&gt;
        &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"links"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sfml-window"&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;is_plat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"windows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mingw"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shared"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
            &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"syslinks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"opengl32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"gdi32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"user32"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"advapi32"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is an incomplete package configuration, I have only extracted a part of the configuration related to the package components.&lt;/p&gt;

&lt;p&gt;A full example of the configuration and use of package components can be found at: &lt;a href="https://github.com/xmake-io/xmake/blob/master/tests/projects/package/components/xmake.lua"&gt;components example&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Configure compilation information for components
&lt;/h5&gt;

&lt;p&gt;We can configure not only the linking information for each component, but also the compilation information for includedirs, defines etc. We can also configure each component individually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;on_component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"defines"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TEST"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Configure component dependencies
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"audio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"window"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_components&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;on_component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"deps"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"window"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above configuration tells the package that our graphics component will have additional dependencies on the &lt;code&gt;window&lt;/code&gt; and &lt;code&gt;system&lt;/code&gt; components.&lt;/p&gt;

&lt;p&gt;So, on the user side, our use of the graphics component can be done from the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;components&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"window"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simplified to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sfml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;components&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"graphics"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because, as soon as we turn on the graphics component, it will also automatically enable the dependent window and system components and automatically ensure that the links are in the right order.&lt;/p&gt;

&lt;p&gt;Alternatively, we can configure component dependencies with &lt;code&gt;add_components("graphics", {deps = {"window", "system"}})&lt;/code&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Find components from the system library
&lt;/h5&gt;

&lt;p&gt;We know that configuring &lt;code&gt;add_extsources&lt;/code&gt; in the package configuration can improve package discovery on the system, for example by finding libraries from system package managers such as apt/pacman.&lt;/p&gt;

&lt;p&gt;Of course, we can also make it possible for each component to prioritise finding them from the system repositories via the &lt;code&gt;extsources&lt;/code&gt; configuration as well.&lt;/p&gt;

&lt;p&gt;For example, the sfml package, which is actually also componentized in homebrew, can be made to find each component from the system repository without having to install them in source each time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; /usr/local/opt/sfml/lib/pkgconfig
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 317 10 19 17:52 sfml-all.pc
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 534 10 19 17:52 sfml-audio.pc
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 609 10 19 17:52 sfml-graphics.pc
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 327 10 19 17:52 sfml-network.pc
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 302 10 19 17:52 sfml-system.pc
&lt;span class="nt"&gt;-r--r--r--&lt;/span&gt; 1 ruki admin 562 10 19 17:52 sfml-window.pc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;We just need, for each component, to configure its extsources: the&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`lua&lt;br&gt;
if is_plat("macosx") then&lt;br&gt;
    add_extsources("brew::sfml/sfml-all")&lt;br&gt;
end&lt;/p&gt;

&lt;p&gt;on_component("graphics", function (package, component)&lt;br&gt;
    -- ...&lt;br&gt;
    component:add("extsources", "brew::sfml/sfml-graphics")&lt;br&gt;
end)&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Default Global Component Configuration
&lt;/h5&gt;

&lt;p&gt;In addition to configuring specific components by specifying component names, if we do not specify a component name, the default is to globally configure all components.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;lua&lt;br&gt;
package("sfml")&lt;br&gt;
    on_component(function (package, component)&lt;br&gt;
        -- configure all components&lt;br&gt;
    end)&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Of course, we could also specify the configuration of the graphics component and the rest of the components would be configured via the default global configuration interface in the following way.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`lua&lt;br&gt;
package("sfml")&lt;br&gt;
    add_components("graphics")&lt;br&gt;
    add_components("audio", "network", "window")&lt;br&gt;
    add_components("system")&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;on_component("graphics", function (package, component)
    -- configure graphics
end)

on_component(function (package, component)
    -- component audio, network, window, system
end)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  C++ module build improvements
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Incremental build support
&lt;/h4&gt;

&lt;p&gt;I thought that Xmake already had good support for C++ modules, but then I realised that its incremental builds don't work properly yet.&lt;/p&gt;

&lt;p&gt;So this version of Xmake also does a good job of supporting incremental builds of C++ modules, although the support process still took a lot of effort.&lt;/p&gt;

&lt;p&gt;My analysis shows that the format of the include dependency information (&lt;code&gt;*.d&lt;/code&gt;) generated with modules varies considerably between the compilers.&lt;/p&gt;

&lt;p&gt;The gcc format is the most complex, but I got it to support it anyway.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
build/.objs/dependence/linux/x86_64/release/src/foo.mpp.o: src/foo.mpp\&lt;br&gt;
build/.objs/dependence/linux/x86_64/release/src/foo.mpp.o gcm.cache/foo.gcm: bar.c++m cat.c++m\&lt;br&gt;
foo.c++m: gcm.cache/foo.gcm\&lt;br&gt;
.PHONY: foo.c++m\&lt;br&gt;
gcm.cache/foo.gcm:| build/.objs/dependence/linux/x86_64/release/src/foo.mpp.o\&lt;br&gt;
CXX_IMPORTS += bar.c++m cat.c++m\&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;clang has the best format compatibility and supports it without any special changes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
build//hello.pcm: /usr/lib/llvm-15/lib/clang/15.0.2/include/module.modulemap src/hello.mpp\&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The msvc format is more extensible and easier to parse and support: the&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
{&lt;br&gt;
    "Version": "1.2",&lt;br&gt;
    "Data": {&lt;br&gt;
        "Source": "c:\users\ruki\desktop\user_headerunit\src\main.cpp",&lt;br&gt;
        "ProvidedModule": "",&lt;br&gt;
        "Includes": [],&lt;br&gt;
        "ImportedModules": [&lt;br&gt;
            {&lt;br&gt;
                "Name": "hello",&lt;br&gt;
                "BMI": "c:\users\ruki\desktop\user_headerunit\src\hello.ifc"&lt;br&gt;
            }&lt;br&gt;
        ],&lt;br&gt;
        "ImportedHeaderUnits": [&lt;br&gt;
            {&lt;br&gt;
                "Header": "c:\users\ruki\desktop\user_headerunit\src\header.hpp",&lt;br&gt;
                "BMI": "c:\users\ruki\desktop\user_headerunit\src\header.hpp.ifc"&lt;br&gt;
            }&lt;br&gt;
        ]&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Circular Dependency Detection Support
&lt;/h4&gt;

&lt;p&gt;As there are dependencies between modules, it is not possible to compile if there are circular dependencies between several modules.&lt;/p&gt;

&lt;p&gt;However, in previous versions Xmake was unable to detect this, and when a circular dependency was encountered, the compilation would get stuck without any message, which was very unfriendly to the user.&lt;/p&gt;

&lt;p&gt;In this new version, we have improved this situation by adding the detection of cyclic dependencies for modules, and the following error message will appear when compiling to make it easier for the user to locate the problem.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
$ xmake&lt;br&gt;
[ 0%]: generating.cxx.module.deps Foo.mpp&lt;br&gt;
[ 0%]: generating.cxx.module.deps Foo2.mpp&lt;br&gt;
[ 0%]: generating.cxx.module.deps Foo3.mpp&lt;br&gt;
[ 0%]: generating.cxx.module.deps main.cpp&lt;br&gt;
error: circular modules dependency(Foo2, Foo, Foo3, Foo2) detected!&lt;br&gt;
  -&amp;gt; module(Foo2) in Foo2.mpp&lt;br&gt;
  -&amp;gt; module(Foo) in Foo.mpp&lt;br&gt;
  -&amp;gt; module(Foo3) in Foo3.mpp&lt;br&gt;
  -&amp;gt; module(Foo2) in Foo2.mpp&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  A more LSP friendly syntax format
&lt;/h3&gt;

&lt;p&gt;Our default convention of domain configuration syntax, although very clean, is not very friendly to auto-formatted indentation and IDEs, and if you format your configuration, the indentation is completely misplaced.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;lua&lt;br&gt;
target("foo")&lt;br&gt;
    set_kind("binary")&lt;br&gt;
    add_files("src/*.cpp")&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also, if some global configuration is configured between two targets, it does not automatically end the current target scope and the user needs to explicitly call &lt;code&gt;&lt;/code&gt;target_end()`.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;target_end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;add_defines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ROOT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although, as we mentioned above, you can use the &lt;code&gt;do end&lt;/code&gt; mode to solve the auto-indentation problem, the problem of needing &lt;code&gt;target_end()&lt;/code&gt; still exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="n"&gt;target_end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;add_defines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ROOT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore, in this new version, we provide a better optional domain configuration syntax to solve the auto-indentation, target domain isolation problem, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;add_defines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ROOT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The foo and bar fields are completely isolated, so we can configure other settings between them without affecting them, plus it's very LSP friendly and won't cause indentation confusion, even with one-click formatting.&lt;/p&gt;

&lt;p&gt;Note: This is only an optional extension syntax, the existing configuration syntax is still fully supported and the user can choose the right one according to their needs preferences.&lt;/p&gt;

&lt;h3&gt;
  
  
  Add flags to specific compilers
&lt;/h3&gt;

&lt;p&gt;Values configured using interfaces such as &lt;code&gt;add_cflags&lt;/code&gt;, &lt;code&gt;add_cxxflags&lt;/code&gt;, etc. are usually compiler specific, although Xmake does provide automatic detection and mapping mechanisms.&lt;br&gt;
Even if a flags is set that is not supported by the current compiler, Xmake can automatically ignore it, but there will still be a warning.&lt;/p&gt;

&lt;p&gt;In this new version, we have improved the interface for adding all flags to avoid additional warnings by specifying flags only for specific compilers, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_cxxflags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"clang::-stdlib=libc++"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_cxxflags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gcc::-stdlib=libc++"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_cxxflags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-stdlib=libc++"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"clang"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;add_cxxflags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-stdlib=libc++"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gcc"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Not just compile flags, but also for link flags such as add_ldflags, which also work.&lt;/p&gt;

&lt;h3&gt;
  
  
  renderdoc debugger support
&lt;/h3&gt;

&lt;p&gt;Thanks to &lt;a href="https://github.com/SirLynix"&gt;@SirLynix&lt;/a&gt; for contributing this great feature which allows Xmake to load renderdoc directly to debug some graphics renderers.&lt;/p&gt;

&lt;p&gt;It's very simple to use, we first make sure renderdoc is installed, then configure the debugger to renderdoc and load the debug run as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;--debugger&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;renderdoc
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake run &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The concrete usage effect is as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BeCcTUrt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://tboox.org/static/img/xmake/renderdoc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BeCcTUrt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://tboox.org/static/img/xmake/renderdoc.gif" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  New C++ exception interface configuration
&lt;/h3&gt;

&lt;p&gt;Xmake has added a new &lt;code&gt;set_exceptions&lt;/code&gt; abstraction configuration interface, which allows us to configure C++/Objc exceptions to be enabled and disabled.&lt;/p&gt;

&lt;p&gt;Normally, if we configure them via the add_cxxflags interface, it would be cumbersome for the compiler to handle them separately, depending on the platform.&lt;/p&gt;

&lt;p&gt;For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;on_config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;has_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cl"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxflags"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"/EHsc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;force&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"defines"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"_HAS_EXCEPTIONS=1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;force&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;elseif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;has_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"clang"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;has_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"clang-cl"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxflags"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-fexceptions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;force&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxflags"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-fcxx-exceptions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;force&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And with this interface, we can abstract to configure them in a compiler-independent way.&lt;/p&gt;

&lt;p&gt;Enabling C++ exceptions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_exceptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable C++ exceptions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_exceptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no-cxx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also configure to turn on objc exceptions at the same time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_exceptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"objc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or disable them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_exceptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no-cxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"no-objc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Xmake automatically adapts the flags internally to the different compilers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Support for ispc compilation rules
&lt;/h3&gt;

&lt;p&gt;Xmake has added support for built-in rules for the ipsc compiler, thanks to &lt;a href="https://github.com/star-hengxing"&gt;@star-hengxing&lt;/a&gt;, which is used in the following way.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"utils.ispc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;header_extension&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"_ispc.h"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;set_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ispc.flags"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"--target=host"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.ispc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Support for msvc's armasm compiler
&lt;/h3&gt;

&lt;p&gt;Previous versions of Xmake added initial support for Windows ARM, but did not yet have good support for asm compilation, so in this version we have continued to improve Windows ARM support.&lt;/p&gt;

&lt;p&gt;Support for msvc's &lt;code&gt;armasm.exe&lt;/code&gt; and &lt;code&gt;armasm64.exe&lt;/code&gt; is now available.&lt;/p&gt;

&lt;p&gt;In addition, we have also improved package cross-compilation support for the Windows ARM platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  New gnu-rm build rules
&lt;/h3&gt;

&lt;p&gt;Xmake has also added a new rule and example project for building embedded projects using the gnu-rm toolchain, thanks to &lt;a href="https://github.com/JacobPeng"&gt;@JacobPeng&lt;/a&gt; for this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gnu-rm"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_toolchains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@gnu-rm"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_plat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cross"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_arch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"armv7"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gnu-rm.static"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/foo/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_deps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gnu-rm.binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"src/*.S"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.ld"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_includedirs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/lib/cmsis"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the full project see: &lt;a href="https://github.com/xmake-io/xmake/blob/master/tests/projects/embed/gnu-rm/hello/xmake.lua"&gt;Embed GNU-RM Example&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add OpenBSD system support
&lt;/h3&gt;

&lt;p&gt;In previous versions, Xmake only supported FreeBSD, and OpenBSD had a number of differences that prevented Xmake from compiling and installing on it.&lt;/p&gt;

&lt;p&gt;The new version now fully supports running Xmake on OpenBSD.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changelog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A new optional configuration syntax. It is LSP friendly, automatically calls target_end() to achieve scope isolation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2944"&gt;#2944&lt;/a&gt;: Add &lt;code&gt;gnu-rm.binary&lt;/code&gt; and &lt;code&gt;gnu-rm.static&lt;/code&gt; rules and tests for embed project&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2636"&gt;#2636&lt;/a&gt;: Support package components&lt;/li&gt;
&lt;li&gt;Support armasm/armasm64 for msvc&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/3023"&gt;#3023&lt;/a&gt;: Add support for debugging with renderdoc&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/3022"&gt;#3022&lt;/a&gt;: Add flags for specific compilers and linkers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/3025"&gt;#3025&lt;/a&gt;: C++ exception enabled/disabled switch method&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/3017"&gt;#3017&lt;/a&gt;: Support ispc compiler&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Changes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2925"&gt;#2925&lt;/a&gt;: Improve doxygen plugin&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2948"&gt;#2948&lt;/a&gt;: Support OpenBSD&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;xmake g --insecure-ssl=y&lt;/code&gt; option to disable ssl certificate when downloading packages&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/2971"&gt;#2971&lt;/a&gt;: Stabilize vs and vsxmake project generation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/3000"&gt;#3000&lt;/a&gt;: Incremental compilation support for modules&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/3016"&gt;#3016&lt;/a&gt;: Improve clang/msvc to better support std modules&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bugs fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2949"&gt;#2949&lt;/a&gt;: Fix vs group&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2952"&gt;#2952&lt;/a&gt;: Fix armlink for long args&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/2954"&gt;#2954&lt;/a&gt;: Fix c++ module partitions path issue&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/3033"&gt;#3033&lt;/a&gt;: Detect circular modules dependency&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>xmake v2.5.3 Released, Support to build Linux bpf program and integrate Conda packages</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Thu, 08 Apr 2021 12:45:05 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-5-3-released-support-to-build-linux-bpf-program-and-integrate-conda-packages-40jn</link>
      <guid>https://dev.to/waruqi/xmake-v2-5-3-released-support-to-build-linux-bpf-program-and-integrate-conda-packages-40jn</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;xmake&lt;/a&gt; is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, it is very friendly to novices, and you can get started quickly in a short time, allowing users to focus more on actual project development.&lt;/p&gt;

&lt;p&gt;In version 2.5.3, we have been able to build linux and android bpf programs.&lt;/p&gt;

&lt;p&gt;Although bpf has certain requirements for the compilation toolchain, such as the newer llvm/clang and android ndk toolchains, xmake can automatically pull a specific version of llvm/ndk for compilation, and it can also automatically pull libbpf dependencies. Library.&lt;/p&gt;

&lt;p&gt;In addition, in the new version we have added support for the integration of C/C++ packages from Conda.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  New feature introduction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Build a Linux Bpf program
&lt;/h3&gt;

&lt;p&gt;In the new version, we started to support the compilation of bpf programs, as well as linux and android platforms, and can automatically pull the llvm and android ndk toolchains.&lt;/p&gt;

&lt;p&gt;For more details, please see: &lt;a href="https://github.com/xmake-io/xmake/issues/1274"&gt;#1274&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The build configuration is as follows, it's very simple.&lt;/p&gt;

&lt;p&gt;If we do not need to build the android version, we can remove some configuration about android.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"platform.linux.bpf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"linux-tools"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;bpftool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libbpf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;is_plat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"android"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ndk &amp;gt;=22.x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_toolchains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@ndk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;sdkver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"23"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"llvm &amp;gt;=10.x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_toolchains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@llvm"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"linux-headers"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"minimal"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"linux-tools"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"linux-headers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"libbpf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_license&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GPL-2.0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Through the above configuration, we can probably see that we have integrated and configured specific versions of llvm and NDK toolchains,&lt;br&gt;
as well as packages such as libbpf, linux-headers, linux-tools, etc..&lt;/p&gt;

&lt;p&gt;xmake will automatically pull them, and then use the corresponding toolchain to integrate and compile these dependent packages, and finally generate the bpf program.&lt;/p&gt;

&lt;p&gt;The linux-tools package mainly uses the libtool program inside to generate the bpf skeleton header file, and xmake will automatically run this tool to generate it.&lt;/p&gt;
&lt;h4&gt;
  
  
  Compile linux bpf program
&lt;/h4&gt;

&lt;p&gt;We only need to execute the xmake command to complete the compilation, even if you have not installed llvm/clang.&lt;/p&gt;

&lt;p&gt;Of course, if you have already installed them, if it's version is matched, xmake will also be used first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also use &lt;code&gt;xmake -v&lt;/code&gt; to compile and view the complete and detailed compilation commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;20%]: compiling.bpf src/minimal.bpf.c
/usr/bin/ccache /usr/bin/clang &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-Qunused-arguments&lt;/span&gt; &lt;span class="nt"&gt;-m64&lt;/span&gt; &lt;span class="nt"&gt;-fvisibility&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hidden &lt;span class="nt"&gt;-O3&lt;/span&gt; &lt;span class="nt"&gt;-Ibuild&lt;/span&gt;/.gens/minimal/linux/x86_64/release/rules/bpf &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/ .xmake/packages/l/linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake /packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include/libelf &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake /l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/l/linux-headers/5.9.16/8e3a440cbe1f42249aef3d89f1528ecb/include &lt;span class="nt"&gt;-DNDEBUG&lt;/span&gt; &lt;span class="nt"&gt;-target&lt;/span&gt; bpf &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; build/.gens/.gens /linux/x86_64/release/rules/bpf/minimal.bpf.o src/minimal.bpf.c
llvm-strip &lt;span class="nt"&gt;-g&lt;/span&gt; build/.gens/minimal/linux/x86_64/release/rules/bpf/minimal.bpf.o
bpftool gen skeleton build/.gens/minimal/linux/x86_64/release/rules/bpf/minimal.bpf.o
&lt;span class="o"&gt;[&lt;/span&gt;40%]: ccache compiling.release src/minimal.c
/usr/bin/ccache /usr/bin/clang &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-Qunused-arguments&lt;/span&gt; &lt;span class="nt"&gt;-m64&lt;/span&gt; &lt;span class="nt"&gt;-fvisibility&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hidden &lt;span class="nt"&gt;-O3&lt;/span&gt; &lt;span class="nt"&gt;-Ibuild&lt;/span&gt;/.gens/minimal/linux/x86_64/release/rules/bpf &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/ .xmake/packages/l/linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake /packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include/libelf &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake /l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/include &lt;span class="nt"&gt;-isystem&lt;/span&gt; /home/ruki/.xmake/packages/l/linux-headers/5.9.16/8e3a440cbe1f42249aef3d89f1528ecb/include &lt;span class="nt"&gt;-DNDEBUG&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; build/.objs/minimal/linux/x86_64/ release/src/minimal.co src/minimal.c
&lt;span class="o"&gt;[&lt;/span&gt;60%]: linking.release minimal
/usr/bin/clang++ &lt;span class="nt"&gt;-o&lt;/span&gt; build/linux/x86_64/release/minimal build/.objs/minimal/linux/x86_64/release/src/minimal.co &lt;span class="nt"&gt;-m64&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt;/home/ruki/.xmake/packages/l /linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/lib64 &lt;span class="nt"&gt;-L&lt;/span&gt;/home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/lib &lt;span class="nt"&gt;-L&lt;/span&gt;/home/ruki/.xmake/packages/l/libelf /0.8.13/ced4fdd8151a475dafc5f51e2a031997/lib &lt;span class="nt"&gt;-L&lt;/span&gt;/home/ruki/.xmake/packages/l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/lib &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-lbpf&lt;/span&gt; &lt;span class="nt"&gt;-lz&lt;/span&gt; &lt;span class="nt"&gt;-lelf&lt;/span&gt; &lt;span class="nt"&gt;-lcap&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;100%]: build ok!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Compile Android bpf program
&lt;/h4&gt;

&lt;p&gt;If we compile the Android version, we only need to switch to the android platform, which is also very convenient&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;xmake will automatically download the ndk tool chain and the corresponding android version libbpf and other libraries to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="nt"&gt;-c&lt;/span&gt;
checking &lt;span class="k"&gt;for &lt;/span&gt;architecture ... armeabi-v7a
checking &lt;span class="k"&gt;for &lt;/span&gt;Android SDK directory ... no
checking &lt;span class="k"&gt;for &lt;/span&gt;NDK directory ... no
note: try installing these packages &lt;span class="o"&gt;(&lt;/span&gt;pass &lt;span class="nt"&gt;-y&lt;/span&gt; to skip confirm&lt;span class="o"&gt;)&lt;/span&gt;?
&lt;span class="k"&gt;in &lt;/span&gt;local-repo:
  -&amp;gt; libcap 2.27 &lt;span class="o"&gt;[&lt;/span&gt;linux, x86_64, from:linux-tools]
  -&amp;gt; libelf 0.8.13 &lt;span class="o"&gt;[&lt;/span&gt;linux, x86_64, from:linux-tools]
  -&amp;gt; zlib 1.2.11 &lt;span class="o"&gt;[&lt;/span&gt;linux, x86_64, from:linux-tools]
  -&amp;gt; linux-tools 5.9.16 &lt;span class="o"&gt;[&lt;/span&gt;bpftool:y]
  -&amp;gt; ndk 22.0
  -&amp;gt; libelf#1 0.8.13 &lt;span class="o"&gt;[&lt;/span&gt;toolchains:@ndk, from:libbpf]
  -&amp;gt; zlib#1 1.2.11 &lt;span class="o"&gt;[&lt;/span&gt;toolchains:@ndk, from:libbpf]
  -&amp;gt; libbpf v0.3 &lt;span class="o"&gt;[&lt;/span&gt;toolchains:@ndk]
please input: y &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;

  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;libcap 2.27 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;zlib 1.2.11 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;libelf 0.8.13 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;ndk 22.0 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;linux-tools 5.9.16 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;libelf#1 0.8.13 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;zlib#1 1.2.11 .. ok
  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;libbpf v0.3 .. ok
ruki@010689392c4d:/mnt/bpf_minimal&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;span class="o"&gt;[&lt;/span&gt;20%]: compiling.bpf src/minimal.bpf.c
&lt;span class="o"&gt;[&lt;/span&gt;40%]: ccache compiling.release src/minimal.c
&lt;span class="o"&gt;[&lt;/span&gt;60%]: linking.release minimal
&lt;span class="o"&gt;[&lt;/span&gt;100%]: build ok!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, if you have manually downloaded the corresponding version of the ndk toolchain, we can also specify it to use it instead of automatically pulling it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="nt"&gt;--ndk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx/android-ndk-r22
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, if you download it yourself, remember to download at least the version above ndk r22, because clang in the lower version of ndk does not support the compilation and generation of bpf programs.&lt;/p&gt;

&lt;p&gt;Finally, here is a complete bpf scaffolding project based on xmake, you can refer to: &lt;a href="https://github.com/hack0z/libbpf-bootstrap"&gt;https://github.com/hack0z/libbpf-bootstrap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, there is also a minimal bpf example program: &lt;a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/bpf/minimal"&gt;https://github.com/xmake-io/xmake/tree/master/tests/projects/bpf/minimal&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrate and use Conda package
&lt;/h3&gt;

&lt;p&gt;Conda is a very powerful third-party package manager that supports binary package pull in various languages. Here we only use the C/C++ package inside.&lt;/p&gt;

&lt;p&gt;Its integrated usage is similar to conan/vcpkg, except that the package namespace is changed to &lt;code&gt;conda::&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conda::libpng 1.6.37"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conda::openssl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"testco"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"conda::openssl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Although we support many third-party package managers, such as conan/conda/vcpkg/brew, etc., xmake also has its own package repository management.&lt;/p&gt;

&lt;p&gt;There are currently nearly 300 commonly used packages that support different platforms, some of which are The package also supports android/ios/mingw and even cross-compilation environment.&lt;/p&gt;

&lt;p&gt;Therefore, if the official &lt;a href="https://github.com/xmake-io/xmake-repo"&gt;xmake-repo&lt;/a&gt; repository already provides the required package, you can use it directly without specifying the package namespace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get host cpu information
&lt;/h3&gt;

&lt;p&gt;In the current version, we have added a new &lt;code&gt;core.base.cpu&lt;/code&gt; module and &lt;code&gt;os.cpuinfo&lt;/code&gt; interface to obtain various information about the cpu, such as: cpu family/model, microarchitecture, core number, features and other information.&lt;/p&gt;

&lt;p&gt;This is usually very useful in projects that pursue performance. These projects usually need to be optimized according to the CPU's memory model and extended instruction set. At the same time, if you want to cross-platform, you need to specify the corresponding code according to the current cpu information, (for example, after intel haswell) One set, one set after amd zen, the older ones default to no optimization). This information is also used in many high-performance computing libraries.&lt;/p&gt;

&lt;p&gt;Therefore, through this module interface, you can obtain the current host cpu information and feature support when compiling and configuring, so as to enable relevant optimized compilation.&lt;/p&gt;

&lt;p&gt;We can quickly obtain all information through &lt;code&gt;os.cpuinfo()&lt;/code&gt;, or specify &lt;code&gt;os.cpuinfo("march")&lt;/code&gt; to obtain specific information, such as march, which is microarchitecture&lt;/p&gt;

&lt;p&gt;We can also use the &lt;code&gt;xmake l&lt;/code&gt; command to quickly view the obtained results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake l os.cpuinfo
&lt;span class="o"&gt;{&lt;/span&gt;
  features &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfsh ds acpi mmx fxsr sse sse2 ss htt tm pbe sse3 pclmulqdq dtes64 mon dscpl vmx tse64 mon dscpl vmx tse tm2 s
sse4_1 sse4_2 x2apic movbe popcnt aes pcid xsave osxsave seglim64 tsctmr avx1_0 rdrand f16c"&lt;/span&gt;,
  vendor &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"GenuineIntel"&lt;/span&gt;,
  model_name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz"&lt;/span&gt;,
  family &lt;span class="o"&gt;=&lt;/span&gt; 6,
  march &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Kaby Lake"&lt;/span&gt;,
  model &lt;span class="o"&gt;=&lt;/span&gt; 142,
  ncpu &lt;span class="o"&gt;=&lt;/span&gt; 8
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;xmake l os.cpuinfo march
&lt;span class="s2"&gt;"Kaby Lake"&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;xmake l os.cpuinfo ncpu
8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to determine the support of extended features such as &lt;code&gt;sse&lt;/code&gt;, you need to import the &lt;code&gt;core.base.cpu&lt;/code&gt; module to get it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;on_load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"core.base.cpu"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;ncpu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cpuinfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ncpu"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;ncpu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_feature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sse"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
            &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"defines"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"HAS_SSE"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Added cmake import file rules
&lt;/h3&gt;

&lt;p&gt;If we are developing a library program, after executing &lt;code&gt;xmake install&lt;/code&gt; to install to the system, only the library file is installed, and there is no import file information such as .cmake/.pc, so the cmake project wants to be integrated and used through find_package, usually by looking for Not in our library.&lt;/p&gt;

&lt;p&gt;In order to allow the third-party cmake project to find it normally and use the integration, then we can use the &lt;code&gt;utils.install.cmake_importfiles&lt;/code&gt; rule to export the .cmake file when installing the target target library file for the library import and search of other cmake projects .&lt;/p&gt;

&lt;p&gt;We only need to apply this rule to the specified target library target through the &lt;code&gt;add_rules&lt;/code&gt; interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"utils.install.cmake_importfiles"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After configuration, the &lt;code&gt;xmake install&lt;/code&gt; installation command can automatically export the .cmake import file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Added pkgconfig import file rules
&lt;/h3&gt;

&lt;p&gt;Similar to the &lt;code&gt;cmake_importfiles&lt;/code&gt; above, but we can also install the pkgconfig/.pc import file through the &lt;code&gt;utils.install.pkgconfig_importfiles&lt;/code&gt; rule, which is very useful for library detection by tools such as autotools.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"utils.install.pkgconfig_importfiles"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Added Git related built-in configuration variables
&lt;/h3&gt;

&lt;p&gt;xmake has always provided the automatic generation feature of config.h, which can be configured through the &lt;a href="https://xmake.io/#/manual/project_target?id=targetadd_configfiles"&gt;add_configfiles&lt;/a&gt; interface, and it also supports the replacement of template variables. You can define some variables yourself.&lt;/p&gt;

&lt;p&gt;However, xmake also provides some commonly used built-in variable substitutions, such as version information, platform architecture, etc. For details, see: &lt;a href="https://xmake.io/#/manual/project_target?id=targetadd_configfiles"&gt;https://xmake.io/#/manual/project_target?id=targetadd_configfiles&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The template configuration is very simple, just need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_configfiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/config.h.in"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The config.h file can be automatically generated according to config.h.in.&lt;/p&gt;

&lt;p&gt;But the new feature we are going to talk about here is the newly provided Git-related built-in variables to allow users to quickly and conveniently compile the project or the latest tag/branch/commit information of the current git project.&lt;/p&gt;

&lt;p&gt;This is very useful for troubleshooting and locating problems in the later stage.&lt;/p&gt;

&lt;p&gt;We can use commit to pinpoint the problem library based on which commit submission caused the problem. In this way, we can checkout but the corresponding version to troubleshoot the problem.&lt;/p&gt;

&lt;p&gt;We only need to configure and define the following variables in config.h.in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define GIT_COMMIT "${GIT_COMMIT}"
#define GIT_COMMIT_LONG "${GIT_COMMIT_LONG}"
#define GIT_COMMIT_DATE "${GIT_COMMIT_DATE}"
#define GIT_BRANCH "${GIT_BRANCH}"
#define GIT_TAG "${GIT_TAG}"
#define GIT_TAG_LONG "${GIT_TAG_LONG}"
#define GIT_CUSTOM "${GIT_TAG}-${GIT_COMMIT}"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execute xmake to compile, it will automatically generate the following config.h file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define GIT_COMMIT "8c42b2c2"
#define GIT_COMMIT_LONG "8c42b2c251793861eb85ffdf7e7c2307b129c7ae"
#define GIT_COMMIT_DATE "20210121225744"
#define GIT_BRANCH "dev"
#define GIT_TAG "v1.6.6"
#define GIT_TAG_LONG "v1.6.6-0-g8c42b2c2"
#define GIT_CUSTOM "v1.6.6-8c42b2c2"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can use them in the program by means of macro definitions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Android NDK r22 support and remote pull
&lt;/h3&gt;

&lt;p&gt;The Android NDK has made very big structural changes since r22, removing some obsolete directories, such as the top-level sysroot directory and platforms directory,&lt;br&gt;
causing the previous detection method of xmake to fail.&lt;/p&gt;

&lt;p&gt;Therefore, in the new version, we have made improvements to xmake to better support the full version of the NDK toolchain, including the new version above r22.&lt;/p&gt;

&lt;p&gt;At the same time, the official repository of xmae-repo has also added the inclusion of ndk packages, enabling xmake to pull the ndk tool chain remotely for use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ndk &amp;gt;=22.x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_toolchains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@ndk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;sdkver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"23"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Changelog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1259"&gt;#1259&lt;/a&gt;: Support &lt;code&gt;add_files("*.def")&lt;/code&gt; to export symbols for windows/dll&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1267"&gt;#1267&lt;/a&gt;: add &lt;code&gt;find_package("nvtx")&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1274"&gt;#1274&lt;/a&gt;: add &lt;code&gt;platform.linux.bpf&lt;/code&gt; rule to build linux/bpf program&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1280"&gt;#1280&lt;/a&gt;: Support fetchonly package to improve find_package&lt;/li&gt;
&lt;li&gt;Support to fetch remote ndk toolchain package&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1268"&gt;#1268&lt;/a&gt;: Add &lt;code&gt;utils.install.pkgconfig_importfiles&lt;/code&gt; rule to install &lt;code&gt;*.pc&lt;/code&gt; import file&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1268"&gt;#1268&lt;/a&gt;: Add &lt;code&gt;utils.install.cmake_importfiles&lt;/code&gt; rule to install &lt;code&gt;*.cmake&lt;/code&gt; import files&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake-repo/pull/348"&gt;#348&lt;/a&gt;: Add &lt;code&gt;platform.longpaths&lt;/code&gt; policy to support git longpaths&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1314"&gt;#1314&lt;/a&gt;: Support to install and use conda packages&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1120"&gt;#1120&lt;/a&gt;: Add &lt;code&gt;core.base.cpu&lt;/code&gt; module and improve &lt;code&gt;os.cpuinfo()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1325"&gt;#1325&lt;/a&gt;: Add builtin git variables for &lt;code&gt;add_configfiles&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Change
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1275"&gt;#1275&lt;/a&gt;: Support conditionnal targets for vsxmake plugin&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/1290"&gt;#1290&lt;/a&gt;: Improve android ndk to support &amp;gt;= r22&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1311"&gt;#1311&lt;/a&gt;: Add packages lib folder to PATH for vsxmake project&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bugs fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1266"&gt;#1266&lt;/a&gt;: Fix relative repo path in &lt;code&gt;add_repositories&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1288"&gt;#1288&lt;/a&gt;: Fix vsxmake generator with option configs&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>xmake v2.5.2 released, Support pull remote cross toolchain and package integration</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Mon, 01 Mar 2021 00:03:59 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-5-2-released-support-pull-remote-cross-toolchain-and-package-integration-eml</link>
      <guid>https://dev.to/waruqi/xmake-v2-5-2-released-support-pull-remote-cross-toolchain-and-package-integration-eml</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;xmake&lt;/a&gt; is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more concise and intuitive, it is very friendly to novices, and you can get started quickly in a short time, allowing users to focus more on actual project development.&lt;/p&gt;

&lt;p&gt;In version 2.5.2, we added a heavyweight new feature: &lt;code&gt;Pull remote cross-compilation toolchain automatically&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Those who have done cross-compilation and have experience in C/C++ project migration should know that it is very troublesome to toss various cross-compilation toolchains&lt;br&gt;
and transplant and compile projects. You need to download the corresponding toolchain yourself.&lt;/p&gt;

&lt;p&gt;And it is easy to make mistakes in configuring the toolchain and the compilation environment to cause compilation failure.&lt;/p&gt;

&lt;p&gt;Now, xmake can already support the automatic download of the toolchain required by the project, and then use the corresponding toolchain to directly compile the project.&lt;br&gt;
The user does not need to care about how to configure the toolchain. In any case, just execute the &lt;code&gt;xmake&lt;/code&gt; command to complete the compilation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_2w4XC77--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://tboox.org/static/img/xmake/muslcc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_2w4XC77--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://tboox.org/static/img/xmake/muslcc.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even for the integration of C/C++ dependent packages, you can automatically switch to the corresponding toolchain to compile, install, and integrate.&lt;br&gt;
Everything is fully automated and does not require users to worry about it.&lt;/p&gt;

&lt;p&gt;In addition to the cross-compilation toolchain, we can also automatically pull toolchains, such as specific versions of llvm, llvm-mingw, zig&lt;br&gt;
and other toolchains to participate in the compilation of C/C++/Zig projects.&lt;/p&gt;

&lt;p&gt;Even cmake does not support the automatic pull of the toolchain. At most, it can only cooperate with third-party package management such as vcpkg/conan to integrate C/C++ dependent packages.&lt;br&gt;
In addition, even for C/C++ dependent packages, xmake has its own native The built-in package management tool has no dependencies at all.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  New feature introduction
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Automatically pull the remote cross-compilation toolchain
&lt;/h3&gt;

&lt;p&gt;Starting from version 2.5.2, we can pull the specified toolchain to integrate the compilation project, and we also support switching the dependent package to the corresponding remote toolchain to participate in the compilation and integration.&lt;/p&gt;

&lt;p&gt;For related example codes, see: &lt;a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/package"&gt;Toolchain/Packages Examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Related issue &lt;a href="https://github.com/xmake-io/xmake/issues/1217"&gt;#1217&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, we have included the following toolchain packages in the &lt;a href="https://github.com/xmake-io/xmake-repo"&gt;xmake-repo&lt;/a&gt; repository, allowing xmake to pull and integrate remotely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;llvm&lt;/li&gt;
&lt;li&gt;llvm-mingw&lt;/li&gt;
&lt;li&gt;gnu-rm&lt;/li&gt;
&lt;li&gt;muslcc&lt;/li&gt;
&lt;li&gt;zig&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although there are not many toolchain packages currently supported, but the overall architecture has been opened up, we only need to include more toolchains in the later stage, such as: gcc, tinyc, vs-buildtools and other toolchains.&lt;/p&gt;

&lt;p&gt;Since the xmake package supports semantic versions, if the project relies on a specific version of the gcc/clang compiler, users should not bother to install it. xmake will automatically detect whether the gcc/clang version of the current system meets the requirements.&lt;/p&gt;

&lt;p&gt;If the version is not satisfied, xmake will pull it remotely, automatically install and integrate a specific version of gcc/clang, and then compile the project.&lt;/p&gt;
&lt;h4&gt;
  
  
  Pull the specified version of llvm toolchain
&lt;/h4&gt;

&lt;p&gt;We use clang in llvm-10 to compile the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"llvm 10.x"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"llvm-10"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c)
    set_toolchains("&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="s2"&gt;")
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Among them, the first half of &lt;code&gt;llvm@llvm-10&lt;/code&gt; is the toolchain name, which is &lt;code&gt;toolchain("llvm")&lt;/code&gt;, and the following name is the name of the toolchain package that needs to be associated, which is &lt;code&gt;package("llvm")&lt;/code&gt; , But if an alias is set, the alias will be used first: &lt;code&gt;llvm-10&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In addition, we will add the gcc toolchain package to xmake-repo in the future, so that users can freely switch to gcc-10, gcc-11 and other specific versions of gcc compilers without the need for users to manually install them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pull the cross-compilation toolchain
&lt;/h3&gt;

&lt;p&gt;We can also pull the specified cross-compilation toolchain to compile the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"muslcc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c)
    set_toolchains("&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;muslcc&lt;/span&gt;&lt;span class="s2"&gt;")
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;muslcc is a cross-compilation toolchain provided by &lt;a href="https://musl.cc"&gt;https://musl.cc&lt;/a&gt;. By default, xmake will automatically integrate and compile the &lt;code&gt;x86_64-linux-musl-&lt;/code&gt; target platform.&lt;/p&gt;

&lt;p&gt;Of course, we can also use &lt;code&gt;xmake f -a arm64&lt;/code&gt; to switch to the &lt;code&gt;aarch64-linux-musl-&lt;/code&gt; target platform for cross-compilation.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pull the toolchain and integrate the dependency packages
&lt;/h4&gt;

&lt;p&gt;We can also use the specified muslcc cross-compilation toolchain to c&lt;/p&gt;

</description>
      <category>cpp</category>
    </item>
    <item>
      <title>xmake v2.5.1 released, Support for Apple Silicon and more powerful package management</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Thu, 21 Jan 2021 10:26:05 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-5-1-released-support-for-apple-silicon-and-more-powerful-package-management-75e</link>
      <guid>https://dev.to/waruqi/xmake-v2-5-1-released-support-for-apple-silicon-and-more-powerful-package-management-75e</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;xmake&lt;/a&gt; is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, very friendly to novices, can get started quickly in a short time, allowing users to focus more on the actual project development.&lt;/p&gt;

&lt;p&gt;This is the first version of xmake this year and the first version that is fully adapted to support Apple Silicon (macOS ARM) devices.&lt;/p&gt;

&lt;p&gt;In this version, we mainly improved the integrated support for C/C++ dependent packages, which is more stable, and can be more flexible to achieve customized configuration compilation.&lt;/p&gt;

&lt;p&gt;In addition, we also focused on improving the vs/vsxmake two vs project generator plugins, fixing many details, and also supporting the sub-project &lt;code&gt;group&lt;/code&gt;, and now it is possible to generate a project structure similar to the following figure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LNzIfUpS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://xmake.io/assets/img/manual/set_group.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LNzIfUpS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://xmake.io/assets/img/manual/set_group.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;About Zig, because it has fixed a lot of problems that I have reported before in v0.7.1. Now xmake can already support the compilation of zig projects.&lt;/p&gt;

&lt;p&gt;At the same time, we have newly developed a &lt;a href="https://github.com/xmake-io/luarocks-build-xmake"&gt;luarocks-build-xmake&lt;/a&gt; plugin to replace luarocks' built-in build system with xmake.&lt;/p&gt;

&lt;p&gt;Finally, in this version, we continue to improve the &lt;code&gt;xmake f --menu&lt;/code&gt; graphical configuration menu, which fully supports mouse operation and scrolling support, and also supports utf8.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  New feature introduction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add add_requireconfs to improve package configuration
&lt;/h3&gt;

&lt;p&gt;Despite the previous version, we can define and configure dependent packages by &lt;code&gt;add_requires("libpng", {configs = {shared = true}})&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;However, if the user project has a huge project and many dependent packages, and each package requires different compilation configuration parameters, the configuration will still be very cumbersome and has limitations, such as the inability to rewrite the internal sub-dependent package configuration.&lt;/p&gt;

&lt;p&gt;Therefore, we have added &lt;code&gt;add_requireconfs&lt;/code&gt; to configure the configuration of each package and its sub-dependencies more flexibly and conveniently. Below we focus on several usages:&lt;/p&gt;

&lt;h5&gt;
  
  
  Set the configuration of the specified package
&lt;/h5&gt;

&lt;p&gt;This is the basic usage. For example, we have declared a package through &lt;code&gt;add_requires("zlib")&lt;/code&gt;, and want to expand the configuration of this zlib later and change it to dynamic library compilation. You can configure it in the following way.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is equivalent to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Set general default configuration
&lt;/h5&gt;

&lt;p&gt;The above usage, we still don't see any practical use, but if we rely on more we can see the effect, such as the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pcre"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libcurl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is it very cumbersome, if we use &lt;code&gt;add_requireconfs&lt;/code&gt; to set the default configuration, it can be greatly simplified to the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pcre"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libcurl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the above configuration, we use pattern matching through &lt;code&gt;add_requireconfs("*", {configs = {shared = true}})&lt;/code&gt; to set all dependent packages to compile and install dynamic libraries by default.&lt;/p&gt;

&lt;p&gt;However, we used &lt;code&gt;add_requires("libcurl", {configs = {shared = false}})&lt;/code&gt; to configure libcurl to compile and install static libraries.&lt;/p&gt;

&lt;p&gt;The final configuration result is: zlib/pcre/libpng/libwebp is a shared library, and libcurl is a static library.&lt;/p&gt;

&lt;p&gt;Through pattern matching, we can put some common configurations of each package into the unified &lt;code&gt;add_requireconfs&lt;/code&gt; to pre-configure, which greatly simplifies the definition of each &lt;code&gt;add_requires&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;!&amp;gt; By default, for the same configuration, xmake will give priority to the configuration in add_requires instead of add_requireconfs.&lt;/p&gt;

&lt;p&gt;If the version is set in &lt;code&gt;add_requires("zlib 1.2.11")&lt;/code&gt;, the configuration of add_requires will be used first, and the version configuration in add_requireconfs will be completely ignored. Of course, we can also completely override the version specified in &lt;code&gt;add_requires&lt;/code&gt; through override .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib 1.2.11"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;override&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1.2.10"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Rewrite package dependency configuration
&lt;/h5&gt;

&lt;p&gt;In fact, the biggest use of &lt;code&gt;add_requireconfs&lt;/code&gt; is to allow users to rewrite the configuration of specific dependent packages of the installation package.&lt;/p&gt;

&lt;p&gt;What does it mean? For example, our project integrates the package libpng and uses a dynamic library version, but the zlib library that libpng depends on is actually a static library version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if we want to change the zlib package that libpng depends on to be compiled as a dynamic library, how should we configure it? This requires &lt;code&gt;add_requireconfs&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng.zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Through the writing method of &lt;code&gt;libpng.zlib&lt;/code&gt; dependency path, specify an internal dependency and rewrite the internal dependency configuration.&lt;/p&gt;

&lt;p&gt;If the dependency path is deep, such as the dependency chain of &lt;code&gt;foo -&amp;gt; bar -&amp;gt; xyz&lt;/code&gt;, we can write: &lt;code&gt;foo.bar.xyz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can also rewrite the internal zlib library version that libpng depends on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libpng.zlib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1.2.10"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Pattern matching for cascading dependencies
&lt;/h5&gt;

&lt;p&gt;If a package has a lot of dependencies, and the dependency level is also very deep, what to do, for example, the package libwebp, its dependencies are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;libwebp
  - libpng
    - zlib
    - cmake
  - libjpeg
  - libtiff
    - zlib
  - giflib
  - cmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I want to rewrite all the dependent libraries in libwebp to add specific configuration, then the configuration one by one will be very cumbersome. At this time, the recursive dependency pattern matching of &lt;code&gt;add_requireconfs()&lt;/code&gt; is needed to support.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp.**|cmake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cxflags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"-DTEST"&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above configuration, we added &lt;code&gt;-DTEST&lt;/code&gt; to compile all the library dependencies in libwebp, but the cmake dependency is a build tool dependency, and we can exclude it by way of &lt;code&gt;|xxx&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The pattern matching here is very similar to &lt;code&gt;add_files()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We are giving a few examples. For example, this time we only rewrite the single-level dependency configuration under libwebp to enable the debugging library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requireconfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"libwebp.*|cmake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;debug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Graphical configuration supports mouse and scroll operations
&lt;/h3&gt;

&lt;p&gt;We upgraded the tui component library used by xmake: &lt;a href="https://github.com/tboox/ltui"&gt;LTUI&lt;/a&gt;, added support for the mouse, and scrolling support for some components, we can go to the graphical configuration, More flexible and convenient configuration of compilation options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6ahdf71U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://tboox.org/static/img/ltui/choicebox_scrollbar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6ahdf71U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://tboox.org/static/img/ltui/choicebox_scrollbar.png" width="650px"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  stdin redirect support
&lt;/h3&gt;

&lt;p&gt;In the previous version, the process execution interface such as os.execv/os.runv provided by xmake only supports stdout/stderr output redirection, but does not support stdin input redirection, so in this version, we also do it Supported.&lt;/p&gt;

&lt;p&gt;The usage is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"arg1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"arg2"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/tmp/a"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we execute the process, we can use the /tmp/a file as the redirected input. Of course, we can also pass &lt;code&gt;{stdout = "/tmp/out"}&lt;/code&gt; as the redirected output.&lt;/p&gt;

&lt;h3&gt;
  
  
  vs project grouping support
&lt;/h3&gt;

&lt;p&gt;We have added a new interface &lt;code&gt;set_group&lt;/code&gt; to support grouping of each target. This interface is currently only used for vs/vsxmake project generation. The subproject directory tree within the vs project is displayed in groups according to the specified structure, but it may also be Other modules increase grouping support.&lt;/p&gt;

&lt;p&gt;For example, for the following grouping configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"group1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"group1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test3"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"group1/group2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test4"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"group3/group4"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test5"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test6"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effect of the generated VS project directory structure is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LNzIfUpS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://xmake.io/assets/img/manual/set_group.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LNzIfUpS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://xmake.io/assets/img/manual/set_group.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Among them, &lt;code&gt;set_group("group1/group2")&lt;/code&gt; can set the target to the secondary group.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatically update vs project
&lt;/h3&gt;

&lt;p&gt;If you feel that it is cumbersome to generate and update the VS project through the &lt;code&gt;xmake project -k vsxmake&lt;/code&gt; command every time, we can now configure the &lt;code&gt;plugin.vsxmake.autoupdate&lt;/code&gt; rule in xmake.lua to achieve automatic update.&lt;/p&gt;

&lt;p&gt;Users can automatically update the VS project if there are changes to the file list or xmake.lua after each execution of the build in the VS project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"plugin.vsxmake.autoupdate"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Improve vs/vsxmake project plugin
&lt;/h3&gt;

&lt;p&gt;In addition to the group support and automatic updates mentioned above, in this version, we also fixed a lot of VS project-related issues, such as: intellisense prompt improvement, path truncation problem repair, full support for remote dependency packages&lt;/p&gt;

&lt;h3&gt;
  
  
  Improve windows registry support
&lt;/h3&gt;

&lt;p&gt;xmake improves the internal winos module and adds some interfaces to access the registry more conveniently and obtain the registry configuration on windows.&lt;/p&gt;

&lt;h4&gt;
  
  
  winos.registry_keys
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Get the list of registry builds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Support through pattern matching, traverse to obtain the registry key path list, &lt;code&gt;*&lt;/code&gt; is single-level path matching, &lt;code&gt;**&lt;/code&gt; is recursive path matching.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;keypaths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HKEY_LOCAL_MACHINE\\SOFTWARE\\*\\Windows NT\\*\\CurrentVersion\\AeDebug"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;keypath&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keypaths&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keypath&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="s2"&gt;";Debugger"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  winos.registry_values
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Get a list of registry value names&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Support to obtain the value name list of the specified key path through pattern matching, and the string after the &lt;code&gt;;&lt;/code&gt; is the specified key name pattern matching string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;valuepaths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HKEY_LOCAL_MACHINE\\SOFTWARE\\xx\\AeDebug;Debug*"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;valuepath&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;valuepaths&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;valuepath&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  winos.registry_query
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Get the registry value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Get the value under the specified registry path, if the value name is not specified, then get the default value of the key path&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;winos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;registry_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug;Debugger"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Support for building Zig project
&lt;/h3&gt;

&lt;p&gt;In the last version, xmake has experimentally supported zig, but there were also many pitfalls during the period, especially when building on windows/macos encountered many problems.&lt;/p&gt;

&lt;p&gt;Then in the latest zig 0.7.1, most of the problems I encountered have been fixed, and now xmake can already support zig project compilation.&lt;/p&gt;

&lt;p&gt;We can quickly create a Zig empty project with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake create &lt;span class="nt"&gt;-l&lt;/span&gt; zig console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The content of xmake.lua is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"console"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.zig"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the configuration method is actually no different from C/C++. Because Zig and C have good binary compatibility, we can also use &lt;code&gt;add_requires&lt;/code&gt; to add remote dependency support for C/C++ packages to the zig project.&lt;/p&gt;

&lt;p&gt;Then execute xmake to complete the compilation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then continue to run the run command, you can directly execute the zig program and output the running result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake run
Hello world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also easily implement the mixed compilation support of C and Zig, just add the corresponding C code file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"console"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.zig"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For complete code examples, see: &lt;a href="https://github.com/xmake-io/xmake/blob/dev/tests/projects/zig/console_c_call_zig/xmake.lua"&gt;Zig with C&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Luarocks plugin
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://luarocks.org/"&gt;luarocks&lt;/a&gt; is a package management tool of lua, which provides the installation and integration of various lua modules, but it uses a built-in construction mechanism to build lua c modules.&lt;/p&gt;

&lt;p&gt;For example, in its rockspec file, the builtin build type is used to describe the construction of common lua c modules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;build&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"builtin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;modules&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"module.hello"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;sources&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"src/test.c"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;copy_directories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a problem for small modules, but if the c code structure of the module is more complicated, its built-in construction rules still have many limitations and are not flexible. In addition, switching msvc / mingw tool chain and parameter configuration etc. Neither is flexible enough.&lt;/p&gt;

&lt;p&gt;Therefore, xmake provides &lt;a href="https://github.com/xmake-io/luarocks-build-xmake"&gt;luarocks=build-xmake&lt;/a&gt; plugin to use xmake to replace the built-in build system of luarocks. The replacement method is also very simple. You only need to buildin Change the build type to xmake and add the luarocks-build-xmake dependency.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;dependencies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"lua &amp;gt;= 5.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"luarocks-build-xmake"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;build&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"xmake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;modules&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"module.hello"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;sources&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"src/test.c"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;copy_directories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this is still very cumbersome. It is still necessary to describe the rules based on the source file list in the modules in the rockspec file, and then luarocks-build-xmake will automatically generate xmake.lua according to the configuration to complete the build.&lt;/p&gt;

&lt;p&gt;But since xmake is used, your own lua module can be maintained with xmake.lua, so the build configuration is more flexible, so we only need the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;dependencies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"lua &amp;gt;= 5.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"luarocks-build-xmake"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;build&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"xmake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;copy_directories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You only need to set the current switch to xmake compilation, and use the xmake.lua rules file built into the lua module project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Support for deploying Qt programs on windows
&lt;/h3&gt;

&lt;p&gt;Thank you very much for the contribution of @SirLynix, xmake can already support the deployment and installation of Qt applications on windows.&lt;/p&gt;

&lt;p&gt;We only need to maintain a Qt program normally, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"demo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"qt.quickapp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_headerfiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.h"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/qml.qrc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we only need to execute the following compile and install commands, and xmake will automatically call the windeployqt.exe program to install and deploy our Qt application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; d:&lt;span class="se"&gt;\i&lt;/span&gt;nstalldir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Related patches: &lt;a href="https://github.com/xmake-io/xmake/pull/1145"&gt;#1145&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, in the previous version, xmake has also supported the deployment and packaging of Qt programs for macOS and android versions. Each time only normal compilation commands are required, the QT .app/.apk installation package can be generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="nt"&gt;--ndk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx/android-ndk-r20b &lt;span class="nt"&gt;--sdk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Some bug fixes
&lt;/h3&gt;

&lt;p&gt;We have also fixed many problems reported by users. Here we introduce some more important bug fixes, such as:&lt;/p&gt;

&lt;p&gt;We fixed the problem of empty double quotes in &lt;code&gt;add_defines("TEST=\"hello world\"")&lt;/code&gt;, which caused errors in previous compilation.&lt;/p&gt;

&lt;p&gt;In addition, we improved the search and support of the vstudio environment, and solved the problem of compilation failure caused by Chinese in the user's home directory and environment variables.&lt;/p&gt;

&lt;p&gt;We have also improved the llvm toolchain to solve the problem of the lack of isysroot configuration when using the llvm tool chain under macOS if xcode is not installed, and the occasional failure of the header file dependency compilation under msvc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changelog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1035"&gt;#1035&lt;/a&gt;: The graphics configuration menu fully supports mouse events, and support scroll bar&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1098"&gt;#1098&lt;/a&gt;: Support stdin for os.execv&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1079"&gt;#1079&lt;/a&gt;: Add autoupdate plugin rule for vsxmake, &lt;code&gt;add_rules("plugin.vsxmake.autoupdate")&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;xmake f --vs_runtime=MT&lt;/code&gt; and &lt;code&gt;set_runtimes("MT")&lt;/code&gt; to set vs runtime for targets and packages&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1032"&gt;#1032&lt;/a&gt;: Support to enum registry keys and values&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1026"&gt;#1026&lt;/a&gt;: Support group for vs/vsxmake project&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1178"&gt;#1178&lt;/a&gt;: Add &lt;code&gt;add_requireconfs()&lt;/code&gt; api to rewrite configs of depend packages&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1043"&gt;#1043&lt;/a&gt;: Add &lt;code&gt;luarocks.module&lt;/code&gt; rule for luarocks-build-xmake&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1190"&gt;#1190&lt;/a&gt;: Support for Apple Silicon (macOS ARM)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/1145"&gt;#1145&lt;/a&gt;: Support Qt deploy for Windows, thanks @SirLynix&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Change
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1072"&gt;#1072&lt;/a&gt;: Fix and improve to parse cl deps&lt;/li&gt;
&lt;li&gt;Support utf8 for ui modules and &lt;code&gt;xmake f --menu&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Improve to support zig on macOS&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1135"&gt;#1135&lt;/a&gt;: Improve multi-toolchain and multi-platforms for targets&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1153"&gt;#1153&lt;/a&gt;: Improve llvm toolchain to support sysroot on macOS&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1071"&gt;#1071&lt;/a&gt;: Improve to generate vs/vsxmake project to support for remote packages&lt;/li&gt;
&lt;li&gt;Improve vs/vsxmake project plugin to support global &lt;code&gt;set_arch()&lt;/code&gt; setting&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1164"&gt;#1164&lt;/a&gt;: Improve to launch console programs for vsxmake project&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1179"&gt;#1179&lt;/a&gt;: Improve llvm toolchain and add isysroot&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bugs fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1091"&gt;#1091&lt;/a&gt;: Fix incorrect ordering of inherited library dependencies&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1105"&gt;#1105&lt;/a&gt;: Fix c++ language intellisense for vsxmake&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1132"&gt;#1132&lt;/a&gt;: Fix TrimEnd bug for vsxmake&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1142"&gt;#1142&lt;/a&gt;: Fix git not found when installing packages&lt;/li&gt;
&lt;li&gt;Fix macos.version bug for macOS Big Sur&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/1084"&gt;#1084&lt;/a&gt;: Fix &lt;code&gt;add_defines()&lt;/code&gt; bug (contain spaces)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/1195"&gt;#1195&lt;/a&gt;: Fix unicode problem for vs and improve find_vstudio/os.exec&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>A modern C/C++ package manager</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Wed, 25 Nov 2020 10:48:37 +0000</pubDate>
      <link>https://dev.to/waruqi/a-modern-c-c-package-manager-4ln1</link>
      <guid>https://dev.to/waruqi/a-modern-c-c-package-manager-4ln1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;xrepo is a cross-platform C/C++ package manager based on &lt;a href="https://github.com/xmake-io/xmake" rel="noopener noreferrer"&gt;Xmake&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is based on the runtime provided by xmake, but it is a complete and independent package management program. Compared with package managers such as vcpkg/homebrew, xrepo can provide C/C++ packages for more platforms and architectures at the same time.&lt;/p&gt;

&lt;p&gt;And it also supports multi-version semantic selection. In addition, it is also a decentralized distributed repository. It not only provides the official &lt;a href="https://github.com/xmake-io/xmake-repo" rel="noopener noreferrer"&gt;xmake-repo&lt;/a&gt; repository, It also supports users to build multiple private repositorys.&lt;/p&gt;

&lt;p&gt;At the same time, xrepo also supports installing packages from third-party package managers such as vcpkg/homebrew/conan, and provides unified and consistent library link information to facilitate integration and docking with third-party projects.&lt;/p&gt;

&lt;p&gt;If you want to know more, please refer to: &lt;a href="https://xrepo.xmake.io/#/getting_started" rel="noopener noreferrer"&gt;Documents&lt;/a&gt;, &lt;a href="https://github.com/xmake-io/xrepo" rel="noopener noreferrer"&gt;Github&lt;/a&gt; and &lt;a href="https://gitee.com/tboox/xrepo" rel="noopener noreferrer"&gt;Gitee&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxrepo.xmake.io%2Fassets%2Fimg%2Fxrepo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxrepo.xmake.io%2Fassets%2Fimg%2Fxrepo.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;We only need install xmake to use the xrepo command. About the installation of xmake, we can see: &lt;a href="https://xmake.io/#/guide/installation" rel="noopener noreferrer"&gt;Xmake Installation Document&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported platforms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows (x86, x64)&lt;/li&gt;
&lt;li&gt;macOS (i386, x86_64, arm64)&lt;/li&gt;
&lt;li&gt;Linux (i386, x86_64, cross-toolchains ..)&lt;/li&gt;
&lt;li&gt;*BSD (i386, x86_64)&lt;/li&gt;
&lt;li&gt;Android (x86, x86_64, armeabi, armeabi-v7a, arm64-v8a)&lt;/li&gt;
&lt;li&gt;iOS (armv7, armv7s, arm64, i386, x86_64)&lt;/li&gt;
&lt;li&gt;MSYS (i386, x86_64)&lt;/li&gt;
&lt;li&gt;MinGW (i386, x86_64, arm, arm64)&lt;/li&gt;
&lt;li&gt;Cross Toolchains&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Supported package repositories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Official package repository &lt;a href="https://github.com/xmake-io/xmake-repo" rel="noopener noreferrer"&gt;xmake-repo&lt;/a&gt; (tbox &amp;gt;1.6.1)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/#/package/remote_package?id=using-self-built-private-package-repository" rel="noopener noreferrer"&gt;User-built repositories&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Conan (conan::openssl/1.1.1g)&lt;/li&gt;
&lt;li&gt;Vcpkg (vcpkg:ffmpeg)&lt;/li&gt;
&lt;li&gt;Homebrew/Linuxbrew (brew::pcre2/libpcre2-8)&lt;/li&gt;
&lt;li&gt;Pacman on archlinux/msys2 (pacman::libcurl)&lt;/li&gt;
&lt;li&gt;Clib (clib::clibs/&lt;a href="mailto:bytes@0.0.4"&gt;bytes@0.0.4&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Dub (dub::log 0.4.3)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Suppory distributed repository
&lt;/h2&gt;

&lt;p&gt;In addition to directly retrieving the installation package from the official repository: &lt;a href="https://github.com/xmake-io/xmake-repo" rel="noopener noreferrer"&gt;xmake-repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We can also add any number of self-built repositories, and even completely isolate the external network, and only maintain the installation and integration of private packages on the company's internal network.&lt;/p&gt;

&lt;p&gt;Just use the following command to add your own repository address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo add-repo myrepo https://github.com/mygroup/myrepo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Seamless integration with xmake project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tbox &amp;gt;1.6.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"libuv master"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"vcpkg::ffmpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"brew::pcre2/libpcre2-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conan::openssl/1.1.1g"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"openssl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;optional&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;debug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tbox"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"libuv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"vcpkg::ffmpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"brew::pcre2/libpcre2-8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"openssl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following is the overall architecture and compilation process integrated with xmake.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxmake.io%2Fassets%2Fimg%2Findex%2Fpackage_arch.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxmake.io%2Fassets%2Fimg%2Findex%2Fpackage_arch.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation package
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Basic usage
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;zlib tbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install the specified version package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"zlib 1.2.x"&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"zlib &amp;gt;=1.2.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install the specified platform package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; iphoneos &lt;span class="nt"&gt;-a&lt;/span&gt; arm64 zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--ndk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx] zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; mingw &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--mingw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx] zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; cross &lt;span class="nt"&gt;--sdk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx/arm-linux-musleabi-cross zlib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install the debug package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; debug zlib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install the package with dynamic library
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-k&lt;/span&gt; shared zlib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install the specified configuration package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"vs_runtime=MD"&lt;/span&gt; zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"regex=true,thread=true"&lt;/span&gt; boost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install packages from third-party package manager
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;brew::zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;vcpkg::zlib
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;conan::zlib/1.2.11
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;pacman:libpng
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;install &lt;/span&gt;dub:log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Find the library information of the package
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo fetch pcre2
&lt;span class="go"&gt;{
  {
    linkdirs = {
      "/usr/local/Cellar/pcre2/10.33/lib"
    },
    links = {
      "pcre2-8"
    },
    defines = {
      "PCRE2_CODE_UNIT_WIDTH=8"
    },
    includedirs = "/usr/local/Cellar/pcre2/10.33/include"
  }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo fetch &lt;span class="nt"&gt;--ldflags&lt;/span&gt; openssl
&lt;span class="go"&gt;-L/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/lib -lcrypto -lssl
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo fetch &lt;span class="nt"&gt;--cflags&lt;/span&gt; openssl
&lt;span class="go"&gt;-I/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/include
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo fetch &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;iphoneos|android] &lt;span class="nt"&gt;--cflags&lt;/span&gt; &lt;span class="s2"&gt;"zlib 1.2.x"&lt;/span&gt;
&lt;span class="go"&gt;-I/Users/ruki/.xmake/packages/z/zlib/1.2.11/df72d410e7e14391b1a4375d868a240c/include
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo fetch &lt;span class="nt"&gt;--cflags&lt;/span&gt; &lt;span class="nt"&gt;--ldflags&lt;/span&gt; conan::zlib/1.2.11
&lt;span class="go"&gt;-I/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/include -L/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/lib -lz
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Export the installed packages
&lt;/h3&gt;

&lt;p&gt;xrepo can quickly export installed packages, including corresponding library files, header files, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /tmp/output zlib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Search supported packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo search zlib &lt;span class="s2"&gt;"pcr*"&lt;/span&gt;
&lt;span class="go"&gt;    zlib:
&lt;/span&gt;&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in &lt;/span&gt;xmake-repo&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;    pcr*:
&lt;/span&gt;&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pcre2: A Perl Compatible Regular Expressions Library &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in &lt;/span&gt;xmake-repo&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pcre: A Perl Compatible Regular Expressions Library &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in &lt;/span&gt;xmake-repo&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show package environment information
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;env&lt;/span&gt; &lt;span class="nt"&gt;--show&lt;/span&gt; luajit
&lt;span class="go"&gt;{
   OLDPWD = "/mnt/tbox",
   HOME = "/home/ruki",
   PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/bin:/tmp:/tmp/arm-linux-musleabi-cross/bin:~/.local/bin: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
   TERM = "xterm",
   PWD = "/mnt/xmake",
   XMAKE_PROGRAM_DIR = "/mnt/xmake/xmake",
   HOSTNAME = "e6edd61ff1ab",
   LD_LIBRARY_PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/lib",
   SHLVL = "1",
   _ = "/mnt/xmake/scripts/xrepo.sh"
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Load package environment and run commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;env &lt;/span&gt;luajit
&lt;span class="go"&gt;LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
&lt;/span&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;env&lt;/span&gt; &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="s2"&gt;"luajit 2.x"&lt;/span&gt; luajit
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo &lt;span class="nb"&gt;env&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; iphoneos &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="s2"&gt;"zlib,libpng,luajit 2.x"&lt;/span&gt; cmake ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show the given package information
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xrepo info zlib
&lt;span class="go"&gt;The package info of project:
    require(zlib):
&lt;/span&gt;&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;version: 1.2.11
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;urls:
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;http://zlib.net/zlib-1.2.11.tar.gz
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;repo: xmake-repo https://gitee.com/tboox/xmake-repo.git master
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cachedir: /Users/ruki/.xmake/cache/packages/2010/z/zlib/1.2.11
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;installdir: /Users/ruki/.xmake/packages/z/zlib/1.2.11/d639b7d6e3244216b403b39df5101abf
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;searchdirs:
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;searchnames: zlib-1.2.11.tar.gz
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fetchinfo: 1.2.11, system
&lt;span class="gp"&gt;          -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;version: 1.2.11
&lt;span class="gp"&gt;          -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;links: z
&lt;span class="gp"&gt;          -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;linkdirs: /usr/local/Cellar/zlib/1.2.11/lib
&lt;span class="gp"&gt;          -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;includedirs: /usr/local/Cellar/zlib/1.2.11/include
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;platforms: iphoneos, mingw@windows, macosx, mingw@linux,macosx, android@linux,macosx, windows, linux
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;requires:
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;plat: macosx
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;arch&lt;/span&gt;: x86_64
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;configs:
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;debug: &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vs_runtime: MT
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;shared: &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;configs:
&lt;span class="gp"&gt;      -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;configs &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;builtin&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;debug: Enable debug symbols. &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;shared: Enable shared library. &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cflags: Set the C compiler flags.
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cxflags: Set the C/C++ compiler flags.
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cxxflags: Set the C++ compiler flags.
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;asflags: Set the assembler flags.
&lt;span class="gp"&gt;         -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vs_runtime: Set vs compiler runtime. &lt;span class="o"&gt;(&lt;/span&gt;default: MT&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;            -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;values: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"MT"&lt;/span&gt;,&lt;span class="s2"&gt;"MD"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cpp</category>
    </item>
    <item>
      <title>xmake v2.3.8 released, Add Intel C++/Fortran  Compiler Support
</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Sun, 18 Oct 2020 12:47:18 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-3-8-released-add-intel-c-fortran-compiler-support-hjj</link>
      <guid>https://dev.to/waruqi/xmake-v2-3-8-released-add-intel-c-fortran-compiler-support-hjj</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;xmake&lt;/a&gt; is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, very friendly to novices, can get started quickly in a short time, allowing users to focus more on the actual project development.&lt;/p&gt;

&lt;p&gt;In this new version, we have made full platform support for the Intel series of C++ and Fortran compilers, and improved the Wasm tool chain support added in the previous version, and also supported the Qt SDK for Wasm.&lt;/p&gt;

&lt;p&gt;In addition, we have also upgraded luajit to the latest v2.1 version. In terms of cross-platform, xmake has also made great improvements and added support for mips64 architecture.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Project source code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Official Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  New feature introduction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add Intel C++ Compiler support
&lt;/h3&gt;

&lt;p&gt;On this version, we have made full platform support for the Intel series of C++ compilers, including icl on windows and icc/icpc under linux/macOS.&lt;/p&gt;

&lt;p&gt;To enable the Intel C++ compiler, we only need to switch to the corresponding toolchain through the &lt;code&gt;--toolchain=icc&lt;/code&gt; parameter on the system where the Intel compiler is installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;--toolchain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;icc
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add Intel Fortran Compiler support
&lt;/h3&gt;

&lt;p&gt;In the previous version, xmake only supported the gfortran compiler. In this version, we also support the Intel Fortran compiler, which is ifort. We only need to switch to the corresponding ifort tool chain to use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;--toolchain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ifort
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add Wasm platform and Qt/Wasm support
&lt;/h3&gt;

&lt;p&gt;In the last version, we added the &lt;code&gt;--toolchain=emcc&lt;/code&gt; toolchain to support the compilation of wasm programs, but just specifying the toolchain does not adjust the extension of the target program well, for example, for &lt;code&gt;*.js&lt;/code&gt; and The file of &lt;code&gt;*.wasm&lt;/code&gt; is generated.&lt;/p&gt;

&lt;p&gt;In the new version, we continue to add the &lt;code&gt;xmake f -p wasm&lt;/code&gt; platform, the built-in emcc tool chain is enabled, and the surrounding configuration has been improved again based on it.&lt;/p&gt;

&lt;p&gt;As long as you switch to the wasm platform, xmake will generate &lt;code&gt;*.js&lt;/code&gt; and corresponding &lt;code&gt;*.wasm&lt;/code&gt; and other target files by default, and additionally generate &lt;code&gt;*.html&lt;/code&gt; pages that can load js to run the wasm program.&lt;/p&gt;

&lt;p&gt;In addition, we also support Qt SDK for Wasm, for example, we create a Qt QuickApp project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake create &lt;span class="nt"&gt;-t&lt;/span&gt; qt.quickapp_static quickapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we noticed that what we created is a Qt project that requires a static link. Because of the wasm version of the Qt library, we need to force a static link to the program to use it normally.&lt;/p&gt;

&lt;p&gt;The content of the generated project file xmake.lua is roughly as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"qt_add_static_plugins.lua"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"demo"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"qt.quickapp_static"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_headerfiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.h"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/qml.qrc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_frameworks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"QtQuickControls2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"QtQuickTemplates2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;qt_add_static_plugins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"QtQuick2Plugin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;linkdirs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qml/QtQuick.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;links&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qtquick2plugin"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;qt_add_static_plugins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"QtQuick2WindowPlugin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;linkdirs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qml/QtQuick/Window.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;links&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"windowplugin"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;qt_add_static_plugins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"QtQuickControls2Plugin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;linkdirs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qml/QtQuick/Controls.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;links&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qtquickcontrols2plugin"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;qt_add_static_plugins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"QtQuickTemplates2Plugin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;linkdirs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qml/QtQuick/Templates.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;links&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"qtquicktemplates2plugin"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above configuration, in addition to enabling the &lt;code&gt;qt.quickapp_static&lt;/code&gt; compilation rules, we also configure some necessary Qt plugins through &lt;code&gt;qt_add_static_plugins&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, we only need to switch to the wasm platform and make sure that the Qt SDK is set to complete the compilation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; wasm &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--qt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/Qt]
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the compilation is completed, xmake will generate demo.html and the corresponding demo.js/demo.wasm program in the build directory. We can open the demo.html page to run the Qt program we compiled. The display effect is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://practicaldev-herokuapp-com.freetls.fastly.net/static/img/xmake/xmake-qt-wasm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/static/img/xmake/xmake-qt-wasm.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a more detailed description of Qt/Wasm, see: &lt;a href="https://github.com/xmake-io/xmake/issues/956"&gt;Issue #956&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add Math/Float-point compilation optimization settings
&lt;/h3&gt;

&lt;p&gt;We have added a new &lt;code&gt;set_fpmodels()&lt;/code&gt; setting interface, which is used to set the floating-point compilation mode and the compilation abstraction settings for the optimization of mathematical calculations. It provides several commonly used levels such as fast, strict, except, precise, and some Set at the same time, some conflicts, the last setting takes effect.&lt;/p&gt;

&lt;p&gt;For the description of these levels, you can refer to the Microsoft document: &lt;a href="https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior%20?view=vs-2019"&gt;Specify floating-point behavior&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, for other compilers such as gcc/icc, xmake will map to different compilation flags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_fpmodels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"fast"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_fpmodels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"strict"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_fpmodels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"fast"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"except"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;set_fpmodels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"precise"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For details on this, see: &lt;a href="https://github.com/xmake-io/xmake/issues/981"&gt;Issue #981&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add OpenMP Support
&lt;/h3&gt;

&lt;p&gt;In order to enable the openmp feature more abstractly and simply, we can set it through the newly added &lt;code&gt;c.openmp&lt;/code&gt; and &lt;code&gt;c++.openmp&lt;/code&gt; rules. In addition, we need additional libomp libraries on linux and macOS, so we can pass ʻAdd_requires("libomp")` for quick reference and integration.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;lua&lt;br&gt;
add_requires("libomp", {optional = true})&lt;br&gt;
target("loop")&lt;br&gt;
    set_kind("binary")&lt;br&gt;
    add_files("src/*.cpp")&lt;br&gt;
    add_rules("c++.openmp")&lt;br&gt;
    add_packages("libomp")&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If it is c code, you need to enable ʻadd_rules("c.openmp")`. If it is c/c++ mixed compilation, then these two rules must be set.&lt;/p&gt;
&lt;h3&gt;
  
  
  Add c11/c17 support
&lt;/h3&gt;

&lt;p&gt;In the new version, xmake has also made improvements to &lt;code&gt;set_languages&lt;/code&gt;, adding new c11/c17 settings, and at the same time adapting and adapting &lt;code&gt;/std:c11&lt;/code&gt; and &lt;code&gt;/std:c17&lt;/code&gt; provided by the latest version of msvc. stand by.&lt;/p&gt;

&lt;p&gt;We only need simple settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;set_languages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"c17"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can enable the c17 standard to compile, even if the lower version of msvc and other compilers do not support it, xmake will automatically ignore the settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Mingw support
&lt;/h3&gt;

&lt;p&gt;Regarding this improvement, several aspects are involved. The first is the improvement of the automatic detection of the Mingw SDK root directory under Windows. In most cases, we do not need to configure the &lt;code&gt;--mingw=&lt;/code&gt; parameter to specify the path explicitly, and it can also It was automatically detected.&lt;/p&gt;

&lt;p&gt;For details on this, see: &lt;a href="https://github.com/xmake-io/xmake/issues/977"&gt;Issue #977&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, in addition to Msys2/Mingw as well as macOS, linux/Mingw, we additionally support &lt;a href="https://github.com/mstorsjo/llvm-mingw"&gt;llvm-mingw&lt;/a&gt; this SDK in the new version, so that we can use mingw to compile the program of arm/arm64 architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; mingw &lt;span class="nt"&gt;-a&lt;/span&gt; arm64
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In addition, in the automatic compilation and integration of remote dependency packages, there are now third-party libraries with cmakelists. Even on the mingw platform, xmake can be automatically compiled and integrated for direct use, which is very fast and convenient.&lt;/p&gt;

&lt;p&gt;Recently, in the &lt;a href="https://github.com/xmake-io/xmake-repo"&gt;xmake-repo&lt;/a&gt; official C/C++ package repository, we have also added a lot of new libraries that support the mingw platform, which can be used directly .&lt;/p&gt;

&lt;h3&gt;
  
  
  Better cross-platform operation
&lt;/h3&gt;

&lt;p&gt;We have added support for mips64-based Linux system operation, and improved the stability of xmake under arm/arm64. By incorporating the latest luajit v2.1, we have solved many problems left by luajit, such as the bad of lightuserdata under arm64. Pointer and other issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Add macOS Sierra for arm64 support
&lt;/h3&gt;

&lt;p&gt;xmake has also adapted the latest Xcode-beta, and added macOs for arm64 target program compilation support, just switch to the arm64 architecture compilation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake f &lt;span class="nt"&gt;-a&lt;/span&gt; arm64 &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--xcode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Applications/Xcode-beta.app/]
&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, the premise is to run under macOS and use the latest Xcode-beta version that supports the Developer Transition Kit (DTK).&lt;/p&gt;

&lt;h3&gt;
  
  
  Add more C/C++ libraries for the official repository
&lt;/h3&gt;

&lt;p&gt;In the official C/C++ repository of xmake &lt;a href="https://github.com/xmake-io/xmake-repo"&gt;xmake-repo&lt;/a&gt;, we have recently added dozens of commonly used C/C++ libraries, and also The libraries of the libx11 series are all included.&lt;/p&gt;

&lt;p&gt;Although the warehouse package maintenance workload is huge, the current development trend is also becoming more and more active. We have received more and more users' contributions and improved maintenance to the warehouse package.&lt;/p&gt;

&lt;p&gt;And, now our official warehouse can be quickly integrated: linux, macOS, windows, mingw, bsd, msys, iphoneos, android and other eight common platform libraries, to achieve true cross-platform C/C++ remote dependency library integration and use support.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://practicaldev-herokuapp-com.freetls.fastly.net/static/img/xmake/xmake-packages.png" class="article-body-image-wrapper"&gt;&lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/static/img/xmake/xmake-packages.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently we have included a list of some packages and supporting platforms, you can view from here: &lt;a href="https://github.com/xmake-io/xmake-repo/blob/master/PKGLIST.md"&gt;PKGLIST.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have been working hard to solve the problems of messy C/C++ library ecology and cumbersome integration and use, and provide quick and consistent automatic integration and compilation solutions. xmake not only supports the integration of third-party official warehouse packages such as vcpkg/conan/clib/homebrew, but also We are working hard to improve our self-built official warehouse to achieve a better integrated experience.&lt;/p&gt;

&lt;p&gt;for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tbox &amp;gt;1.6.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"libuv master"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"vcpkg::ffmpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"brew::pcre2/libpcre2-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conan::openssl/1.1.1g"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"openssl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;optional&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;debug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.c"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tbox"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"libuv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"vcpkg::ffmpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"brew::pcre2/libpcre2-8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"openssl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packages with namespaces such as &lt;code&gt;vcpkg::&lt;/code&gt;, &lt;code&gt;brew::&lt;/code&gt; and &lt;code&gt;conan::&lt;/code&gt; will automatically switch to the corresponding third-party package warehouse to download and integrate, and the default &lt;code&gt;tbox &amp;gt;1.6.1&lt;/code&gt; etc. Library, the package provided in the official xmake-repo repository will be used by default.&lt;/p&gt;

&lt;p&gt;The usage and integration methods are exactly the same, xmake will automatically download, compile, integrate and link.&lt;/p&gt;

&lt;p&gt;For more detailed instructions on the dependency integration of remote packages, we can look at the relevant documentation: &lt;a href="https://xmake.io/#/package/remote_package"&gt;Remote dependency library integration and use&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the same time, we also welcome more people to participate to help improve the construction of the C/C++ library ecology, and provide a concise and consistent library experience. I believe that C/C++ package management and library ecology are not worse than Rust/Go.&lt;/p&gt;

&lt;h3&gt;
  
  
  More release version installation support
&lt;/h3&gt;

&lt;p&gt;In the new version, we submitted xmake to the Ubuntu PPA source, so in addition to the existing script installation method, we can also quickly install xmake through apt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:xmake-io/xmake
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the same time, we also submitted the package to the Copr package management repository, so that we can also quickly install xmake through dnf in Fedora, RHEL, OpenSUSE, CentOS and other distributions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf copr &lt;span class="nb"&gt;enable &lt;/span&gt;waruqi/xmake
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Changelog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/955"&gt;#955&lt;/a&gt;: Add zig project templates&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/956"&gt;#956&lt;/a&gt;: Add wasm platform and support Qt/Wasm SDK&lt;/li&gt;
&lt;li&gt;Upgrade luajit vm and support for runing on mips64 device&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/972"&gt;#972&lt;/a&gt;: Add &lt;code&gt;depend.on_changed()&lt;/code&gt; api to simplify adding dependent files&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/981"&gt;#981&lt;/a&gt;: Add &lt;code&gt;set_fpmodels()&lt;/code&gt; for math optimization mode&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/980"&gt;#980&lt;/a&gt;: Support Intel C/C++ and Fortran Compiler&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/986"&gt;#986&lt;/a&gt;: Support for &lt;code&gt;c11&lt;/code&gt; and &lt;code&gt;c17&lt;/code&gt; for MSVC Version 16.8 and Above&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/979"&gt;#979&lt;/a&gt;: Add Abstraction for OpenMP. &lt;code&gt;add_rules("c++.openmp")&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Change
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/958"&gt;#958&lt;/a&gt;: Improve mingw platform to support llvm-mingw toolchain&lt;/li&gt;
&lt;li&gt;Improve &lt;code&gt;add_requires("zlib~xxx")&lt;/code&gt; to support for installing multi-packages at same time&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/977"&gt;#977&lt;/a&gt;: Improve find_mingw for windows&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/978"&gt;#978&lt;/a&gt;: Improve toolchain flags order&lt;/li&gt;
&lt;li&gt;Improve Xcode toolchain to support for macOS/arm64&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bugs fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/951"&gt;#951&lt;/a&gt;: Fix emcc support for windows&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/992"&gt;#992&lt;/a&gt;: Fix filelock bug&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>xmake v2.3.7 released, Add tinyc and emscripten toolchains</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Tue, 15 Sep 2020 13:46:34 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-3-7-released-add-tinyc-and-emscripten-toolchains-gec</link>
      <guid>https://dev.to/waruqi/xmake-v2-3-7-released-add-tinyc-and-emscripten-toolchains-gec</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;xmake&lt;/a&gt; is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, very friendly to novices, can get started quickly in a short time, allowing users to focus more on the actual project development.&lt;/p&gt;

&lt;p&gt;With the continuous iterative development of xmake in recent years, xmake has harvested 2.9K stars, 300+ forks, 30+ contributors on Github, and handled 900+ issues, 5400+ Commits, and active users are also growing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ogewgPRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://tboox.org/static/img/xmake/star-history.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ogewgPRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://tboox.org/static/img/xmake/star-history.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the xmake v2.3.7 version is released. In the new version, we mainly improved the stability and compatibility of xmake itself. Through two months of continuous iteration, we have fixed various user feedback problems, user experience and The stability has been greatly improved.&lt;/p&gt;

&lt;p&gt;In addition, we also added support for TinyC and Emscripten (WebAssembly) compilation tool chains in this version.&lt;/p&gt;

&lt;p&gt;Especially for the windows platform, we provide an additional xmake-tinyc installation package, which has a built-in tinyc compiler, so that users can completely escape the bloated vs environment, one-click installation, out of the box, only 5M installation package is needed Simple C programs can be developed, and a complete set of winapi header files are also included.&lt;/p&gt;

&lt;p&gt;Finally, we also improved the trybuild mode compilation. Through xmake, third-party projects maintained by autotools/cmake can be quickly compiled, and cross-compilation environments such as android/ios/mingw can be quickly connected to achieve rapid migration and compilation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake"&gt;Project source code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/"&gt;Official Document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  New feature introduction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  More diverse installation methods
&lt;/h3&gt;

&lt;p&gt;In the new version, we submitted the xmake installation package to windows winget and ubuntu ppa repositories, we can install xmake more conveniently and quickly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Winget installation
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;winget &lt;span class="nb"&gt;install &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Ubuntu PPA installation
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:xmake-io/xmake
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Of course, we also support many other installation methods. For detailed installation methods for other platforms, see: &lt;a href="https://xmake.io/#/guide/installation"&gt;Installation Document&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Richer toolchain support
&lt;/h3&gt;

&lt;p&gt;Currently we have supported a lot of toolchain environments, and in this version, we have added support for TinyC and Emscripten (WebAssembly) compilation toolchains. We can quickly switch to the corresponding toolchain to compile with the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;--toolchain&lt;/span&gt;&lt;span class="o"&gt;=[&lt;/span&gt;tinyc|emscripten]
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the new version, we also provide two additional installation packages, built-in and integrated TinyC compilation environment, the entire installation package only needs 5M, and also contains winsdk api.&lt;/p&gt;

&lt;p&gt;The installation package can be found in the github/releases directory of xmake.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake/releases/download/v2.3.7/xmake-tinyc-v2.3.7.win64.exe"&gt;xmake-tinyc-v2.3.7.win64.exe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake/releases/download/v2.3.7/xmake-tinyc-v2.3.7.win32.exe"&gt;xmake-tinyc-v2.3.7.win32.exe&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Through this installation package, we can completely get rid of the bloated vs development environment (several G) by compiling and developing C programs, realize one-click installation, and use it out of the box. It is very useful for us to brush leetcode and write some C test code. Yes, there is no need to install the entire vs for this particular installation.&lt;/p&gt;

&lt;p&gt;In addition, if we want to view all toolchains supported by xmake, we can execute the following command, and the compilation configuration of &lt;code&gt;xmake f -p cross --sdk=/xxx&lt;/code&gt; can support more general cross toolchains.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake show &lt;span class="nt"&gt;-l&lt;/span&gt; toolchains
xcode         Xcode IDE
vs            VisualStudio IDE
yasm          The Yasm Modular Assembler
clang         A C language family frontend &lt;span class="k"&gt;for &lt;/span&gt;LLVM
go            Go Programming Language Compiler
dlang         D Programming Language Compiler
gfortran      GNU Fortran Programming Language Compiler
zig           Zig Programming Language Compiler
sdcc          Small Device C Compiler
cuda          CUDA Toolkit
ndk           Android NDK
rust          Rust Programming Language Compiler
llvm          A collection of modular and reusable compiler and toolchain technologies
cross         Common cross compilation toolchain
nasm          NASM Assembler
gcc           GNU Compiler Collection
mingw         Minimalist GNU &lt;span class="k"&gt;for &lt;/span&gt;Windows
gnu-rm        GNU Arm Embedded Toolchain
envs          Environment variables toolchain
fasm          Flat Assembler
tinyc         Tiny C Compiler
emcc          A toolchain &lt;span class="k"&gt;for &lt;/span&gt;compiling to asm.js and WebAssembly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  TryBuild compilation mode improvement
&lt;/h3&gt;

&lt;p&gt;The so-called trybuild mode is a feature introduced by xmake that adapts to existing third-party build systems, because most existing third-party projects are maintained by third-party build systems such as autotools/cmake. If they are migrated to xmake The cost of migration is relatively high for configuration.&lt;/p&gt;

&lt;p&gt;Although the configuration of xmake is very easy to use, there is no need to change the build system for projects that have been stably maintained. xmake is mainly used for the construction and maintenance of some new projects.&lt;/p&gt;

&lt;p&gt;Based on this background, xmake adopts the trybuild compilation mode, which is the so-called trial compilation mode, which automatically detects the build system of third-party projects. If it detects that the project is maintained by autotools, it will automatically call &lt;code&gt;./configure; make&lt;/code&gt; to compile.&lt;/p&gt;

&lt;p&gt;If a project maintained by cmake is detected, cmake is automatically called to generate makefile/build.ninja to compile. For users who use xmake, the compilation can always be completed by just executing the command xmake, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;xmake
note: configure found, try building it or you can run &lt;span class="sb"&gt;`&lt;/span&gt;xmake f &lt;span class="nt"&gt;--trybuild&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; to &lt;span class="nb"&gt;set &lt;/span&gt;buildsystem &lt;span class="o"&gt;(&lt;/span&gt;pass &lt;span class="nt"&gt;-y&lt;/span&gt; or &lt;span class="nt"&gt;--confirm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y/n/d to skip confirm&lt;span class="o"&gt;)&lt;/span&gt;?
please input: y &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;
y
  ...
  CC src/pcre2grep-pcre2grep.o
  CC src/libpcre2_8_la-pcre2_auto_possess.lo
  CC src/libpcre2_8_la-pcre2_config.lo
  ...
build ok!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After xmake detects the autotools build system, it will prompt the user if you need to try to call autotools to compile. After typing y to confirm, you can directly complete the compilation. For cmake projects, you only need to execute the same &lt;code&gt;xmake&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;You don’t need to care about how autotools/cmake needs to be configured, used and compiled. After all, cmake needs to generate different build files for windows and linux platforms. The compilation methods are also different. One will call make and the other will call msbuild. Big.&lt;/p&gt;

&lt;p&gt;Not only that, xmake also docked with &lt;code&gt;xmake -r&lt;/code&gt; to directly recompile, docked with &lt;code&gt;xmake clean&lt;/code&gt; to achieve unified file cleaning, and docked with &lt;code&gt;xmake -v&lt;/code&gt; to achieve unified detailed compilation command viewing.&lt;/p&gt;

&lt;h4&gt;
  
  
  TryBuild's cross-compilation support
&lt;/h4&gt;

&lt;p&gt;If it's just the compilation of the current host platform, you might say, what's the matter, cmake also has &lt;code&gt;cmake --build .&lt;/code&gt; to compile directly, it is not too troublesome.&lt;/p&gt;

&lt;p&gt;So the question is, how to do cross compilation? If you have used autotools/cmake to cross-compile and generate mingw/android/ios target programs, can cmake and autotools still handle it simply and consistently?&lt;/p&gt;

&lt;p&gt;Autotools will not say much, anyway, I hate its cross-experience. Every time I cross-compile and transplant a code with an autotools project, it takes a long time. I often have to package various errors and study the transfer of various configuration parameters. Different platforms have different configurations.&lt;/p&gt;

&lt;p&gt;And cmake I don’t think it’s easy to use, for example, for the Android platform, I have to do it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;cmake &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-DCMAKE_TOOLCHAIN_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$NDK&lt;/span&gt;/build/cmake/android.toolchain.cmake &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-DANDROID_ABI&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$ABI&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-DANDROID_NATIVE_API_LEVEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$MINSDKVERSION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;$OTHER_ARGS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For the ios platform, I did not find a short-answer configuration method, but found a third-party ios toolchain configuration, which is very complicated: &lt;a href="https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake"&gt;https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For mingw, it is another way. I have been tossing about the environment for a long time, which is very tossing.&lt;/p&gt;

&lt;p&gt;Then if you use xmake to dock cmake to achieve cross-compilation, you only need to do this.&lt;/p&gt;

&lt;p&gt;Compile the android program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="nt"&gt;--trybuild&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cmake &lt;span class="nt"&gt;--ndk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Compile the ios program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; iphoneos &lt;span class="nt"&gt;--trybuild&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cmake
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Compile the mingw program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; mingw &lt;span class="nt"&gt;--trybuild&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cmake &lt;span class="nt"&gt;--mingw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/sdk/xxx
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When we only need to configure, enable cmake's try-compilation mode through &lt;code&gt;--trybuild=cmake&lt;/code&gt;, and then switch to the corresponding platform through &lt;code&gt;-p android/iphoneos/mingw&lt;/code&gt;, dock the corresponding SDK, and you can use the same method To quickly implement cross-compilation, even if this project is maintained by cmake.&lt;/p&gt;

&lt;p&gt;The user does not need to be concerned. If you use cmake to transfer the configuration of different toolchains, xmake will automatically handle it for you. You only need to execute xmake to compile, or execute &lt;code&gt;xmake -r&lt;/code&gt; to recompile, or view compilation details&lt;code&gt;xmake -v&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In addition, you can quickly switch the build architecture by &lt;code&gt;xmake f -p iphoneos -a arm64 --trybuild=cmake&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, we need to explain that although trybuild mode can greatly help users save compilation and configuration operations, if the conditions are run, we still hope that everyone can directly use xmake.lua to maintain their projects.&lt;/p&gt;

&lt;p&gt;In this way, there is no need to compile with trybuild, and xmake will support cross-compilation more perfectly, because internal xmake will directly compile the project without calling cmake, autotools and other tools, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; iphoneos
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; android &lt;span class="nt"&gt;--ndk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/xxx
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see, this time we omit the &lt;code&gt;--trybuild=cmake&lt;/code&gt; parameter, because we don’t need it, we compile directly. At this time, xmake is equivalent to independent make/ninja and does not rely on make at all, and the compilation speed is also Can be completely comparable to ninja.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improve the integration of remote dependency packages
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Cross compilation support
&lt;/h4&gt;

&lt;p&gt;xmake not only supports mingw/autotools cross-compilation support for trybuild, but also supports cross-compilation installation and integration for third parties maintained by cmake/autotools in remote package warehouses.&lt;/p&gt;

&lt;p&gt;E.g:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pcre2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.cpp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pcre2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then by switching to the iphoneos platform, you can quickly integrate and install the pcre2 package of the iphoneos platform, and then compile and link it, even if the pcre2 package is maintained by autotools/cmake.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; iphoneos
xmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Private network package warehouse
&lt;/h4&gt;

&lt;p&gt;In this version, we have also made some improvements to the integration of remote dependency packages. For example, you can switch to private network mode by configuring &lt;code&gt;xmake g --network=private&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is mainly used for some company's internal network through xmake's self-built package management warehouse to achieve closed C/C++ dependency package integration, and will not rely on packages from the official warehouse provided by xmake.&lt;/p&gt;

&lt;h4&gt;
  
  
  Recursively export installed packages
&lt;/h4&gt;

&lt;p&gt;xmake previously provided a command to export all third-party dependency packages installed by xmake.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;xmake require &lt;span class="nt"&gt;--export&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;However, the previous version corresponds to some packages that have dependencies. When exporting, only itself will be exported, and all its dependencies will not be exported. In this version, we have improved it and will also perform all corresponding dependent packages.了export.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improve support for Qt SDK environment
&lt;/h3&gt;

&lt;p&gt;In addition, this version also provides better support for the Qt SDK toolchain environment. For example, the Qt SDK toolchain installed by the apt command under the ubuntu system is also supported, while the previous version can only support downloading and installing from the Qt official website The Qt SDK environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changelog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/microsoft/winget-pkgs/pull/2941"&gt;#2941&lt;/a&gt;: Add support for winget&lt;/li&gt;
&lt;li&gt;Add xmake-tinyc installer without msvc compiler for windows&lt;/li&gt;
&lt;li&gt;Add tinyc compiler toolchain&lt;/li&gt;
&lt;li&gt;Add emcc compiler toolchain (emscripten) to compiling to asm.js and WebAssembly&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/947"&gt;#947&lt;/a&gt;: Add &lt;code&gt;xmake g --network=private&lt;/code&gt; to enable the private network&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Change
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/907"&gt;#907&lt;/a&gt;: Improve to the linker optimization for msvc&lt;/li&gt;
&lt;li&gt;Improve to detect qt sdk environment&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/pull/918"&gt;#918&lt;/a&gt;: Improve to support cuda11 toolchains&lt;/li&gt;
&lt;li&gt;Improve Qt support for ubuntu/apt&lt;/li&gt;
&lt;li&gt;Improve CMake project generator&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/931"&gt;#931&lt;/a&gt;: Support to export packages with all dependences&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/930"&gt;#930&lt;/a&gt;: Support to download package without version list directly &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/927"&gt;#927&lt;/a&gt;: Support to switch arm/thumb mode for android ndk&lt;/li&gt;
&lt;li&gt;Improve trybuild/cmake to support android/mingw/iphoneos/watchos toolchains&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bugs fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/903"&gt;#903&lt;/a&gt;: Fix install vcpkg packages fails&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/912"&gt;#912&lt;/a&gt;: Fix the custom toolchain&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/xmake-io/xmake/issues/914"&gt;#914&lt;/a&gt;: Fix bad light userdata pointer for lua on some aarch64 devices&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>xmake v2.3.6 released, Support fortran compilation and go dlang package dependences</title>
      <dc:creator>ruki</dc:creator>
      <pubDate>Thu, 30 Jul 2020 15:37:33 +0000</pubDate>
      <link>https://dev.to/waruqi/xmake-v2-3-6-released-support-fortran-compilation-and-go-dlang-package-dependences-1kjk</link>
      <guid>https://dev.to/waruqi/xmake-v2-3-6-released-support-fortran-compilation-and-go-dlang-package-dependences-1kjk</guid>
      <description>&lt;p&gt;This version focuses on some improvements to the support of other languages, such as fortran compilation support, experimental support for zig language, and third-party dependency package support and cross-compilation support for golang/dlang.&lt;/p&gt;

&lt;p&gt;Although, xmake focuses on c/c++ build support, other languages support xmake will also make some improvements from time to time. Its main purpose is not to replace their official build system, but only to support mixed compilation with c/c++ , To better serve c/c++ projects,&lt;br&gt;
After all, some c/c++ projects still occasionally call code interfaces of other languages, such as mixed calls with languages such as cuda, dlang, objc, swift, asm, etc., so xmake still provides some basic compilation support for them.&lt;/p&gt;

&lt;p&gt;In addition, regarding c/c++, we also support the header file dependency format of the new &lt;code&gt;/sourceDependencies xxx.json&lt;/code&gt; output in the vs preview version (this is more reliable and stable for multi-language header file dependency detection).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xmake-io/xmake" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xmake.io/#/home" rel="noopener noreferrer"&gt;Documents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxmake.io%2Fassets%2Fimg%2Findex%2Fxmake-basic-render.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fxmake.io%2Fassets%2Fimg%2Findex%2Fxmake-basic-render.gif"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction of New Features
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Fortran language compilation support
&lt;/h3&gt;

&lt;p&gt;Starting from this version, we have fully supported the use of the gfortran compiler to compile fortran projects, we can quickly create an empty project based on fortran by using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xmake create &lt;span class="nt"&gt;-l&lt;/span&gt; fortran &lt;span class="nt"&gt;-t&lt;/span&gt; console &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its xmake.lua content is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.f90"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More code examples can be viewed here: &lt;a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/fortran" rel="noopener noreferrer"&gt;Fortran Examples&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Zig language experimental support
&lt;/h3&gt;

&lt;p&gt;Note: At present, this language xmake is still in the experimental support stage, and it is not perfect. For example, it is not supported on windows, and dynamic library compilation under linux/macOS is not yet supported. Please evaluate and use it yourself.&lt;/p&gt;

&lt;p&gt;We can use the following configuration method to try and experience, at least the console and static library programs under linux/macOS can still run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.zig"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As for why windows does not support it, please refer to the issues I mentioned to zig earlier, &lt;a href="https://github.com/ziglang/zig/issues/5825" rel="noopener noreferrer"&gt;#5825&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The dynamic library does not support it because I have some pitfalls (the dynamic library generated by zig will automatically append &lt;code&gt;.0.0.0&lt;/code&gt;), see: &lt;a href="https://github.com/ziglang/zig/%20issues/5827" rel="noopener noreferrer"&gt;issue 5827&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, I lay down in other pits. I personally feel that there are a lot of pits, so I'm still in the experimental stage for the time being, and I will look at it later.&lt;/p&gt;

&lt;p&gt;For more examples, see: &lt;a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/zig" rel="noopener noreferrer"&gt;Zig Examples&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Go dependency package and cross compilation support
&lt;/h3&gt;

&lt;p&gt;The new version of xmake continues to make some improvements to the go build support, such as cross-compilation of go. For example, we can compile windows programs on macOS and linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xmake f &lt;span class="nt"&gt;-p&lt;/span&gt; windows &lt;span class="nt"&gt;-a&lt;/span&gt; x86
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In addition, the new version also initially supports the third-party dependency package management of go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;add_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mode.debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode.release"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"go::github.com/sirupsen/logrus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"logrus"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"go::golang.org/x/sys/internal/unsafeheader"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"unsafeheader"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;is_plat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"windows"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"go::golang.org/x/sys/windows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"syshost"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;add_requires&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"go::golang.org/x/sys/unix"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"syshost"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;set_kind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"binary"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src/*.go"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;add_packages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"logrus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"syshost"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"unsafeheader"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, there are still some imperfections. For example, all cascading dependency packages must be manually configured at present, which will be a bit more cumbersome and needs to be improved in the future.&lt;/p&gt;

&lt;p&gt;For more examples, see: &lt;a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/go" rel="noopener noreferrer"&gt;Go Examples&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dlang/Dub dependency package support
&lt;/h3&gt;

&lt;p&gt;xmake also supports dlang's dub package management, which can quickly integrate dlang's third-party dependency packages:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
lua
add_rules("mode.debug", "mode.release")

add_requires("dub::log 0.4.3", {alias = "log"})
add_requires("dub::dateparser", {alias = "dateparser"})
add_requires("dub::emsi_containers", {alias = "emsi_containers"})
add_requires("dub::stdx-allocator", {alias = "stdx-allocator"})
add_requires("dub::mir-core", {alias = "mir-core"})

target("test")
    set_kind("binary")
    add_files("src/*.d")
    add_packages("log", "dateparser", "emsi_containers", "stdx-allocator", "mir-cor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
