Git Product home page Git Product logo

xmake-docs's Introduction

Support this project

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. 🙏

Technical support

You can also consider sponsoring us to get extra technical support services via the Github sponsor program. If you do, you can get access to the xmake-io/technical-support repository, which has the following bennefits:

  • Handling Issues with higher priority
  • One-to-one technical consulting service
  • Review your xmake.lua and provide suggestions for improvement

Introduction

What is Xmake?

  1. Xmake is a cross-platform build utility based on the Lua scripting language.
  2. Xmake is very lightweight and has no dependencies outside of the standard library.
  3. Uses the xmake.lua file to maintain project builds with a simple and readable syntax.

Xmake can be used to directly build source code (like with Make or Ninja), or it can generate project source files like CMake or Meson. It also has a built-in package management system to help users integrate C/C++ dependencies.

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

Although less precise, one can still understand Xmake in the following way:

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

If you want to know more, please refer to: the Documentation, GitHub or Gitee. You are also welcome to join our community.

The official Xmake repository can be found at xmake-io/xmake-repo.

Installation

With cURL

curl -fsSL https://xmake.io/shget.text | bash

With Wget

wget https://xmake.io/shget.text -O - | bash

With PowerShell

Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content

Other installation methods

If you don't want to use the above scripts to install Xmake, visit the Installation Guide for other installation methods (building from source, package managers, etc.).

Simple Project Description

target("console")
    set_kind("binary")
    add_files("src/*.c")

Creates a new target console of kind binary, and adds all the files ending in .c in the src directory.

Package dependences

add_requires("tbox 1.6.*", "zlib", "libpng ~1.6")

Adds a requirement of tbox v1.6, zlib (any version), and libpng v1.6.

The official xmake package repository exists at: xmake-repo

Commandline interface reference

The below assumes you are currently in the project's root directory.

Build a project

$ xmake

Run target

$ xmake run console

Debug target

$ xmake run -d console

Configure platform

$ xmake f -p [windows|linux|macosx|android|iphoneos ..] -a [x86|arm64 ..] -m [debug|release]
$ xmake

Menu configuration

$ xmake f --menu

Supported platforms

  • Windows (x86, x64)
  • macOS (i386, x86_64, arm64)
  • Linux (i386, x86_64, cross-toolchains ..)
  • *BSD (i386, x86_64)
  • Android (x86, x86_64, armeabi, armeabi-v7a, arm64-v8a)
  • iOS (armv7, armv7s, arm64, i386, x86_64)
  • WatchOS (armv7k, i386)
  • AppleTVOS (armv7, arm64, i386, x86_64)
  • MSYS (i386, x86_64)
  • MinGW (i386, x86_64, arm, arm64)
  • Cygwin (i386, x86_64)
  • Wasm (wasm32)
  • Cross (cross-toolchains ..)

Supported toolchains

IDE-Tied

  • Xcode
  • MSVC (Microsoft Visual C compiler)
  • Android NDK

Languages

  • Zig
  • Go(lang)
  • Swift
  • Nim
  • Rust
  • GCC (GNU Compiler Collection)
  • Clang
  • TinyCC
  • icc (Intel C Compiler)
  • icpc (Intel C++ Compiler)
  • icx (Intel LLVM C/C++ Compiler)
  • Clang-CL (Clang Compatability with MSVC)
  • DPC++ (Intel LLVM C++ Compiler using SYCL)
  • MinGW (GNU for Windows)
  • C51 (Keil C Compiler for the 8051)
  • GNU-RM (GNU Arm Embedded Toolchain)
  • ArmCC (Keil C Compiler for Keil MKD Version 5)
  • Circle (New C++20 compiler)
  • WASI (C/C++ WebAssembly Toolchain)
  • ArmClang (Version 6 of the Keil MDK)
  • SDCC (Small Device C Compiler)
  • GDC (GNU D Compiler)
  • LDC (LLVM D Compiler)
  • DMD (Dlang)
  • FPC (Free Pascal Programming Language Compiler)
  • GFortran (GNU Fortran Compiler)
  • Ifort (Intel Fortran Compiler)
  • CUDA (nvcc, nvc, nvc++, nvfortran)
  • Emscripten
  • LLVM
  • Icarus Verilog
  • Verilator (SystemVerilog simulator and lint system)

Assemblers

  • FASM
  • NASM
  • YASM
  • MASM32 (Microsoft Macro Assembler 32-bit SDK)

Supported languages

  • C and C++
  • Objective-C and Objective-C++
  • Swift
  • Assembly
  • Golang
  • Rust
  • Dlang
  • Fortran
  • Cuda
  • Zig
  • Vala
  • Pascal
  • Nim
  • Verilog
  • FASM
  • NASM
  • YASM
  • MASM32

Features

Xmake exhibits:

  • Simple yet flexible configuration grammar.
  • Quick, dependency-free installation.
  • Easy compilation for most all supported platforms.
  • Supports cross-compilation with intelligent analysis of cross toolchain information.
  • Extremely fast parallel compilation support.
  • Supports C++ modules (new in C++20).
  • Supports cross-platform C/C++ dependencies with built-in package manager.
  • Multi-language compilation support including mixed-language projects.
  • Rich plug-in support with various project generators (ex. Visual Studio/Makefiles/CMake/compile_commands.json)
  • REPL interactive execution support
  • Incremental compilation support with automatic analysis of header files
  • Built-in toolchain management
  • A large number of expansion modules
  • Remote compilation support
  • Distributed compilation support
  • Local and remote build cache support

Supported Project Types

Xmake supports the below types of projects:

  • Static libraries
  • Shared libraries
  • Console/CLI applications
  • CUDA programs
  • Qt applications
  • WDK drivers (umdf/kmdf/wdm)
  • WinSDK applications
  • MFC applications
  • Darwin applications (with metal support)
  • Frameworks and bundles (in Darwin)
  • SWIG modules (Lua, Python, ...)
  • LuaRocks modules
  • Protobuf programs
  • Lex/Yacc programs
  • Linux kernel modules

Package management

Download and build

Xmake can automatically fetch and install dependencies!

Supported package repositories

  • Official package repository xmake-repo (tbox >1.6.1)
  • Official package manager Xrepo
  • User-built repositories
  • Conan (conan::openssl/1.1.1g)
  • Conda (conda::libpng 1.3.67)
  • Vcpkg (vcpkg:ffmpeg)
  • Homebrew/Linuxbrew (brew::pcre2/libpcre2-8)
  • Pacman on archlinux/msys2 (pacman::libcurl)
  • Apt on ubuntu/debian (apt::zlib1g-dev)
  • Clib (clib::clibs/[email protected])
  • Dub (dub::log 0.4.3)
  • Portage on Gentoo/Linux (portage::libhandy)
  • Nimble for nimlang (nimble::zip >1.3)
  • Cargo for rust (cargo::base64 0.13.0)

Package management features

  • The official repository provides nearly 500+ packages with simple compilation on all supported platforms
  • Full platform package support, support for cross-compiled dependent packages
  • Support package virtual environment using xrepo env shell
  • Precompiled package acceleration for Windows (NT)
  • Support self-built package repositories and private repository deployment
  • Third-party package repository support for repositories such as: vcpkg, conan, conda, etc.
  • Supports automatic pulling of remote toolchains
  • Supports dependency version locking

Processing architecture

Below is a diagram showing roughly the architecture of Xmake, and thus how it functions.

Distributed Compilation

  • Cross-platform support.
  • Support for MSVC, Clang, GCC and other cross-compilation toolchains.
  • Support for building for Android, Linux, Windows NT, and Darwin hosts.
  • No dependencies other than the compilation toolchain.
  • Support for build server load balancing scheduling.
  • Support for real time compressed transfer of large files (lz4).
  • Almost zero configuration cost, no shared filesystem required, for convenience and security.

For more details see: #274

Remote Compilation

For more details see: #622

Local/Remote Build Cache

For more details see: #622

Benchmark

Xmake's speed on is par with Ninja! The test project: xmake-core

Multi-task parallel compilation

buildsystem Termux (8core/-j12) buildsystem MacOS (8core/-j12)
xmake 24.890s xmake 12.264s
ninja 25.682s ninja 11.327s
cmake(gen+make) 5.416s+28.473s cmake(gen+make) 1.203s+14.030s
cmake(gen+ninja) 4.458s+24.842s cmake(gen+ninja) 0.988s+11.644s

Single task compilation

buildsystem Termux (-j1) buildsystem MacOS (-j1)
xmake 1m57.707s xmake 39.937s
ninja 1m52.845s ninja 38.995s
cmake(gen+make) 5.416s+2m10.539s cmake(gen+make) 1.203s+41.737s
cmake(gen+ninja) 4.458s+1m54.868s cmake(gen+ninja) 0.988s+38.022s

More Examples

Debug and release profiles

add_rules("mode.debug", "mode.release")

target("console")
    set_kind("binary")
    add_files("src/*.c")
    if is_mode("debug") then
        add_defines("DEBUG")
    end

Custom scripts

target("test")
    set_kind("binary")
    add_files("src/*.c")
    after_build(function (target)
        print("hello: %s", target:name())
        os.exec("echo %s", target:targetfile())
    end)

Automatic integration of dependent packages

Download and use packages in xmake-repo or third-party repositories:

add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8")
add_requires("conan::openssl/1.1.1g", {alias = "openssl", optional = true, debug = true})
target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl")

In addition, we can also use the xrepo command to quickly install dependencies.

Qt QuickApp Program

target("test")
    add_rules("qt.quickapp")
    add_files("src/*.cpp")
    add_files("src/qml.qrc")

Cuda Program

target("test")
    set_kind("binary")
    add_files("src/*.cu")
    add_cugencodes("native")
    add_cugencodes("compute_35")

WDK/UMDF Driver Program

target("echo")
    add_rules("wdk.driver", "wdk.env.umdf")
    add_files("driver/*.c")
    add_files("driver/*.inx")
    add_includedirs("exe")

target("app")
    add_rules("wdk.binary", "wdk.env.umdf")
    add_files("exe/*.cpp")

For more WDK driver examples (UMDF/KMDF/WDM), please visit WDK Program Examples

Darwin Applications

target("test")
    add_rules("xcode.application")
    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
    add_files("src/Info.plist")

Framework and Bundle Program (Darwin)

target("test")
    add_rules("xcode.framework") -- or xcode.bundle
    add_files("src/*.m")
    add_files("src/Info.plist")

OpenMP Program

add_requires("libomp", {optional = true})
target("loop")
    set_kind("binary")
    add_files("src/*.cpp")
    add_rules("c++.openmp")
    add_packages("libomp")

Zig Program

target("test")
    set_kind("binary")
    add_files("src/main.zig")

Automatically fetch remote toolchain

fetch a special version of LLVM

Require the Clang version packaged with LLM-10 to compile a project.

add_requires("llvm 10.x", {alias = "llvm-10"})
target("test")
    set_kind("binary")
    add_files("src/*.c")
    set_toolchains("llvm@llvm-10")

Fetch a cross-compilation toolchain

We can also pull a specified cross-compilation toolchain in to compile the project.

add_requires("muslcc")
target("test")
    set_kind("binary")
    add_files("src/*.c")
    set_toolchains("@muslcc")

Fetch toolchain and packages

We can also use the specified muslcc cross-compilation toolchain to compile and integrate all dependent packages.

add_requires("muslcc")
add_requires("zlib", "libogg", {system = false})

set_toolchains("@muslcc")

target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_packages("zlib", "libogg")

Plugins

Generate IDE project file plugin(makefile, vs2002 - vs2022 .. )

$ xmake project -k vsxmake -m "debug,release" # New vsproj generator (Recommended)
$ xmake project -k vs -m "debug,release"
$ xmake project -k cmake
$ xmake project -k ninja
$ xmake project -k compile_commands

Run a custom lua script plugin

$ xmake l ./test.lua
$ xmake l -c "print('hello xmake!')"
$ xmake l lib.detect.find_tool gcc
$ xmake l
> print("hello xmake!")
> {1, 2, 3}
< {
    1,
    2,
    3
  }

To see a list of bultin plugs, please visit Builtin plugins.

Please download and install other plugins from the plugins repository xmake-plugins.

IDE/Editor Integration

Xmake Gradle Plugin (JNI)

We can use the xmake-gradle plugin to compile JNI libraries via gradle.

plugins {
  id 'org.tboox.gradle-xmake-plugin' version '1.1.5'
}

android {
    externalNativeBuild {
        xmake {
            path "jni/xmake.lua"
        }
    }
}

The xmakeBuild task will be injected into the assemble task automatically if the gradle-xmake-plugin has been applied.

$ ./gradlew app:assembleDebug
> Task :nativelib:xmakeConfigureForArm64
> Task :nativelib:xmakeBuildForArm64
>> xmake build
[ 50%]: cache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
> Task :nativelib:xmakeConfigureForArmv7
> Task :nativelib:xmakeBuildForArmv7
>> xmake build
[ 50%]: cache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
> Task :nativelib:preBuild
> Task :nativelib:assemble
> Task :app:assembleDebug

CI Integration

GitHub Action

The github-action-setup-xmake plugin for GitHub Actions can allow you to use Xmake with minimal efforts if you use GitHub Actions for your CI pipeline.

uses: xmake-io/github-action-setup-xmake@v1
with:
  xmake-version: latest

Who is using Xmake?

The list of people and projects who are using Xmake is available here.

If you are using Xmake, you are welcome to submit your information to the above list through a PR, so that other users and the developers can gauge interest. Ihis also let users to use xmake more confidently and give us motivation to continue to maintain it.

This will help the Xmake project and it's community grow stronger and expand!

Contacts

Thanks

This project exists thanks to all the people who have contributed:

  • TitanSnow: Provide the xmake logo and install scripts
  • uael: Provide the semantic versioning library sv
  • OpportunityLiu: Improve cuda, tests and ci
  • xq144: Improve xrepo env shell, and contribute a lot of packages to the xmake-repo repository.
  • enderger: Helped smooth out the edges on the English translation of the README

xmake-docs's People

Contributors

a2va avatar chen-qingyu avatar chenxuuu avatar davidxiaozhi avatar domain avatar dozingfiretruck avatar duohappy avatar fasiondog avatar fwqaaq avatar inclyc avatar jingkaimori avatar joker2770 avatar lingr7 avatar maxwellgengyf avatar meidozuki avatar mwik avatar nuc1eon avatar opportunityliu avatar ouyangpaste avatar perikiyoxd avatar pucklaj avatar rinkaa avatar rtoslab avatar star-hengxing avatar sunrisepeak avatar wanzzhehe avatar waruqi avatar xfgryujk avatar xq114 avatar zijiaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xmake-docs's Issues

Improve consistency and English

Xmake Version

025fbe9

Operating System Version and Architecture

macOS Ventura 13.2

Describe Bug

Not a bug, but improve the consistency and grammar of some of the documentation. I understand English is not the author's first language, and am submitting this issue to attach a PR to.

Expected Behavior

A clear reading experience, not:

we need not write any make-like file (xmake.lua, makefile.am, cmakelist.txt, etc.) and also build it directly.

Project Configuration

Not applicable

Additional Information and Error Logs

Not applicable

xmake introduction confusing

Xmake Version

4.7.3

Operating System Version and Architecture

All

Describe Bug

in the introduction it says

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

because xmake uses lua and in lua syntax ~= means ”is not”, this makes this line pretty confusing and I think we should remove the ~

Expected Behavior

not confusing

Project Configuration

No response

Additional Information and Error Logs

No response

Document the properties of the instances

你在什么场景下需要该功能?

https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html

类似cmake,xmake提供的target、option、package等也有很多getset接口。有一个表可以看哪些property可以去执行get、set会很方便。

描述可能的解决方案

在API Manual (Script Scope)里面加一节property;或者在每个instance介绍里面加一张表介绍可设置的property

描述你认为的候选方案

No response

其他信息

No response

xmake windows通过powershell安装报错

Xmake 版本

xmake v2.7.6+master.eda07a2a7

操作系统版本和架构

22H2(22631.1265)

描述问题

当通过win11默认终端(powershell5.2)安装xmake时,即执行

Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content

时,发生错误:
_ `UCL{U_CB%O1WZ~~RU~W1
换用powershell7则正常:
KWNRTONOPNW91P167GD9SBG

无法解析的地方看起来像是一个三元表达式,而正好powershell7才提供三元表达式这个新特性:
image

期待的结果

所以我觉得,要么需要在官网注明需要用powershell7来执行,要么需要把这段三元表达式改写成powershell5兼容的语法。

工程配置

No response

附加信息和错误日志

No response

document the uninstallation on unix-like platforms

描述讨论详情

文档中没有找到在linux上怎么卸载xmake;这需要rm几个文件(xmake、xrepo),rm一个文件夹(xmake-script),复原.profile文件(删除xmake引入的一段),还比较复杂,需要一段说明

Fixed search bar position

Is your feature request related to a problem? Please describe.

Using the documentation page can be frustrating when searching for information multiple times due to the search bar being located at the top of the sidebar. As users scroll down to view all the results, the search bar becomes hidden and difficult to locate again, forcing them to scroll all the way up to the top of the sidebar. This causes inconvenience and hinders the user experience.

Furthermore, this problem is compounded by the fact that users may not even be aware of the search bar's existence in the first place. For example, when I first accessed the documentation page, I completely missed the search bar as it is not immediately apparent that it is located at the top of the sidebar. Since my intention was to scroll down to browse the site, I spent several days unaware of the search bar's existence.

Describe the solution you'd like

To improve the user experience, it would be beneficial to have the search bar remain fixed at the top of the page Additionally, it may be helpful to make the search bar more prominent and visible to ensure that users are aware of its existence, for example by adding a search bar icon.

Describe alternatives you've considered

not really any, fixing the search bar position should be straight forward

Additional context

The search bar I'm referring to if it wasn't clear.
image

Incorrect link in set_plat for set_arch

Xmake Version

4.7.3

Operating System Version and Architecture

All

Describe Bug

image

In the set_plat description, the link to "set_arch" goes to link "project_target?id=target_setarch" but it should be "project_target?id=targetset_arch"

Expected Behavior

Correct link

Project Configuration

No response

Additional Information and Error Logs

No response

Incorrect link in set_plat for set_toolchains

Xmake Version

4.7.3

Operating System Version and Architecture

All

Describe Bug

image

In the set_plat description, the link to "set_toolchains" goes to link "project_target?id=target_settoolchains" but it should be "project_target?id=targetset_toolchains"

Expected Behavior

Correct link

Project Configuration

No response

Additional Information and Error Logs

No response

emerge包管理器加入xmake

你在什么场景下需要该功能?

在Gentoo中安装xmake

描述可能的解决方案

糊了一份简单的ebuild,只在amd64做过测试

# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="A cross-platform build utility based on Lua"
HOMEPAGE="https://github.com/xmake-io/xmake"
SRC_URI="https://github.com/xmake-io/xmake/releases/download/v${PV}/${PN}-v${PV}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
S="${WORKDIR}"

DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""

src_compile() {
        emake build
}

src_install() {
        emake install DESTDIR="${D}" PREFIX="/usr"
}

描述你认为的候选方案

No response

其他信息

No response

add_packagedirs 链接错误

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

  • 文档中的 add_packagedirs 链接错误,点击未跳转到正确的页面。
  • 链接锚点是 targetadd_packagedirs,然而正确的锚点是 add_packagedirs。

QQ截图20190918164142

2019-09-18 16-41-52 的屏幕截图

期待的结果

点击后跳转到正确的页面。

错误信息

没有。

相关环境

浏览器。

其他信息

没有。

考虑将 包依赖管理 - 使用远程包 - 添加包到仓库 移动到 API手册(描述域)- 包依赖管理

Is your feature request related to a problem? Please describe.

首先,目前API手册中的包依赖管理部分仍然写着敬请期待,但实际上已经在别的地方写了
其次,目前的位置有些难找,而且这种涉及API内容最好集中在一起,方便查看

Describe the solution you'd like

移动这部分内容到API手册,并留下指向新位置链接

Describe alternatives you've considered

No response

Additional context

No response

中文文档错字

Xmake 版本

无关。

操作系统版本和架构

无关。

描述问题

xmake-docs/zh-cn/manual/conditions.md文件的is_plat接口介绍中有错字,原文如下:
如果指定的平台名不存在,就会自动切到cross平台进行交叉编译,但是缺可以通过is_plat("other")来判断自己的平台逻辑。

其次,英文文档和中文文档不一致,缺少相关内容。

期待的结果

”但是缺“应改为“但是却”,修改后如下:
如果指定的平台名不存在,就会自动切到cross平台进行交叉编译,但是却可以通过is_plat("other")来判断自己的平台逻辑。

工程配置

无关。

附加信息和错误日志

无关。

Missing new platforms in documentation

Xmake Version

v2.8.9+20240324

Operating System Version and Architecture

Windows 10 LTSC 21H2 v19044.2965

Describe Bug

imagen

    -p PLAT, --plat=PLAT                   Compile for the given platform. (default: auto)
                                               - android
                                               - appletvos
                                               - applexros
                                               - bsd
                                               - cross
                                               - cygwin
                                               - haiku
                                               - iphoneos
                                               - linux
                                               - macosx
                                               - mingw
                                               - msys
                                               - wasm
                                               - watchos
                                               - windows

Expected Behavior

Show the platforms available on the executable that are not described in the documentation.

Project Configuration

N/A

Additional Information and Error Logs

N/A

document for manual installation on windows and custom installation on unix

注:如果是问题报障或者特性请求,请选择报告缺陷特性请求模板,否则一律不回复。

描述讨论详情

目前官网只有install by powershell/bash的instruction,以及unix环境local installation的instruction,没有windows上手动安装的instruction;(xmake-installer.exe缺少自动补全功能,需要手动安装)

unix环境的安装缺少自定义文件夹的instruction;无法选择script/binary安装到哪个文件夹。

Translate document

Translating ..., help me please! Edit this page

  • Specification
  • Documentation
    • Conditions
    • Global Interfaces
    • Project Target (google translate)
    • Configuration Option (google translate)
    • Plugin and Task (google translate)
    • Extension Platforms (google translate)
    • Extension Languages (google translate)
    • Project Templates (google translate)
    • Builtin Variables (google translate)
    • Builtin Modules (google translate)
    • Extension Modules (google translate)

"Integrate CMake source library" - Provide Code for Example CMake Library

Is your feature request related to a problem? Please describe.

In package/local_3rd_source_library.md, there are instructions for wrapping a CMake-based library from a local directory as an xmake package and then integrating this within our main project.

Describe the solution you'd like

Would it be possible to upload this (and maybe other) example packages so that users can work from them and work out how to copy the structure for a real package? Alternatively, it may make sense to change the example to use a real library that is available online (e.g. how we use things like liblzma, libpng in other examples). Then I could clone this package and try the code with my xmake project myself.

Describe alternatives you've considered

No response

Additional context

The reason I ask is that the library I need to wrap is not so simple. It would help to see have the example foo package and its CMakeLists to see what xmake is doing behind the scenes, and then see what I need to change to ensure I wrap my dependency properly. I think this might be useful for others given that CMake is a very large ecosystem now, and part of the reason I am switching to xmake is because there are too many ways to do the same thing and it becomes as hard to maintain as the code itself.

Add document for rules embed in package

Is your feature request related to a problem? Please describe.

xmake-io/xmake#2374 describes how to embed rules in package, but current document about this part is missing.

Describe the solution you'd like

Fix format issues in existing document

Describe alternatives you've considered

No response

Additional context

No response

Arch Linux 下AUR辅助工具yaourt已经停止开发,可以更新文档为新的AUR管理器

!!! 注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将会直接标记为 Invalid。

描述问题

Arch Linux 下AUR辅助工具yaourt已经停止开发,此项目的仓库已经标注unmaintained。

期待的结果

更新文档为yay -S xmake 或其他AUR helper。

错误信息

不适用

相关环境

不适用

其他信息

不适用

能否考虑整理一下该REPO的目录结构?

有几个问题

  1. 有一些生成文件混进来了
  2. 不同语言的目录层级不同,英语在根目录下,汉语却在 zh cn 两个文件夹
  3. 单个文件太长,编辑困难,能否分成多个文件,在生成 html 时再进行合并

中文文档中可能有一处错字

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

在文档 https://xmake.io/#/zh-cn/manual/project_target?id=targetadd_files中

此接口使用方式跟add_installfiles接口几乎完全一样,都可以用来天剑安装文件,不过此接口仅用于安装头文件。 因此,使用上比add_installfiles简化了不少,默认不设置prefixdir,也会自动将头文件安装到对应的include子目录中。

期待的结果

可能应当为

此接口使用方式跟add_installfiles接口几乎完全一样,都可以用来添加安装文件,不过此接口仅用于安装头文件。 因此,使用上比add_installfiles简化了不少,默认不设置prefixdir,也会自动将头文件安装到对应的include子目录中。

从 Definitions 生成 API 的文档

你在什么场景下需要该功能?

我现在正在做 xmake 的 lua-ls 的 addon,给所有的 xmake.lua 中的 api 提供 definitions 文件

repo: https://github.com/LelouchHe/xmake-luals-addon

个人感觉如果 API 的文档能把 definitions 和此处的 doc 结合起来,会更好,这样让二者是同步的

描述可能的解决方案

有几个可能的实现:

  1. api 的类型定义可以从 definitions 中生成,而解释说明可以从 md 里来
    • 优点: 解释说明在 md 里写会比较好看
    • 缺点: 需要工具把二者整合
  2. 把解释说明也放在 definitions 文件里,而 api 的文档直接从里面生成 md 或 html
    • 优点: 文档和 definitions 可以完全同步
    • 缺点: 注释里写 md 虽然可以,但感觉不是很直接

描述你认为的候选方案

No response

其他信息

我本人不是特别熟悉 lua 的文档生成,不知道这样做是否可行?

目前 addon 的内容生成是先通过抓取 md 的内容,然后解析

但从抓取的结果来看,有很多信息丢失,或者格式不统一,导致需要很多手工修改,甚至直接从头开始写

这样的话,如果 api 进行变动,没有很好的办法同步更新 definition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.