### xmake Getting Started Source: https://context7_llms Information on how to get started with xmake, including installation and updates. ```APIDOC xmake getting started: - xmake from beginner to expert 1: Installation and Update (zh/posts/quickstart-1-installation.md) ``` -------------------------------- ### xmake.lua Project Configuration Source: https://xmake.io/guide/quick-start Example of a minimal xmake.lua file for a C++ binary project, defining build modes and source files. ```lua add_rules("mode.debug", "mode.release") target("hello") set_kind("binary") add_files("src/*.cpp") ``` -------------------------------- ### LLDB Debugger Session Example Source: https://xmake.io/guide/quick-start Demonstrates a typical debugging session using LLDB, including setting breakpoints and running the program. ```sh [lldb]$target create "build/hello" Current executable set to 'build/hello' (x86_64). [lldb]$b main Breakpoint 1: where = hello`main, address = 0x0000000100000f50 [lldb]$r Process 7509 launched: '/private/tmp/hello/build/hello' (x86_64) Process 7509 stopped * thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100000f50 hello`main hello`main: -> 0x100000f50 <+0>: pushq %rbp 0x100000f51 <+1>: movq %rsp, %rbp 0x100000f54 <+4>: leaq 0x2b(%rip), %rdi ; "hello world!" 0x100000f5b <+11>: callq 0x100000f64 ; symbol stub for: puts [lldb]$ ``` -------------------------------- ### Install Xmake via Ubuntu PPA Source: https://xmake.io/guide/quick-start Installs Xmake on Ubuntu systems by adding the official Xmake PPA repository. This ensures you get the latest updates. ```sh sudo add-apt-repository ppa:xmake-io/xmake sudo apt update sudo apt install xmake ``` -------------------------------- ### Build and Install xmake (Linux) Source: https://xmake.io/guide/quick-start Builds and installs xmake on Linux systems. It configures the build, compiles the project using parallel jobs, and installs it locally. ```sh ./configure make -j4 ./scripts/get.sh __local__ __install_only__ source ~/.xmake/profile ``` -------------------------------- ### Xmake Bundle Packages Source: https://xmake.io/guide/quick-start Provides a list of Xmake bundle packages, which are single executable files that do not require installation. These are useful for distribution or environments where installation is not feasible. ```text xmake-bundle-v2.9.8.arm64.exe xmake-bundle-v2.9.8.cosmocc xmake-bundle-v2.9.8.linux.x86_64 xmake-bundle-v2.9.8.macos.arm64 xmake-bundle-v2.9.8.macos.x86_64 xmake-bundle-v2.9.8.win32.exe xmake-bundle-v2.9.8.win64.exe ``` -------------------------------- ### Install Xmake on Gentoo Source: https://xmake.io/guide/quick-start Installs Xmake on Gentoo Linux by adding the GURU repository and then emerging the dev-util/xmake package. Follow the provided link for GURU setup. ```sh sudo emerge -a --autounmask dev-util/xmake ``` -------------------------------- ### Install Xmake using PowerShell Source: https://xmake.io/guide/quick-start Installs Xmake on Windows using a PowerShell script. This command downloads the script and executes it to set up Xmake. ```powershell Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content ``` -------------------------------- ### Install Xmake via Scoop (Windows) Source: https://xmake.io/guide/quick-start Installs Xmake on Windows using the Scoop package manager. Ensure Scoop is installed and configured before running this command. ```sh scoop install xmake ``` -------------------------------- ### Build an xmake Project Source: https://xmake.io/guide/quick-start Compiles the project configured in the current directory using xmake. ```sh $ cd hello $ xmake ``` -------------------------------- ### Create a New xmake Project Source: https://xmake.io/guide/quick-start Generates the basic file structure and configuration for a new C++ project using xmake. ```sh $ xmake create hello ``` -------------------------------- ### Install Xmake using curl or wget Source: https://xmake.io/guide/quick-start Installs Xmake using a shell script downloaded via curl or wget. This method is suitable for Linux, macOS, and other Unix-like systems. It fetches the installation script and executes it. ```sh curl -fsSL https://xmake.io/shget.text | bash ``` ```sh wget https://xmake.io/shget.text -O - | bash ``` -------------------------------- ### xmake Installation and Uninstallation with Make Source: https://xmake.io/posts/quickstart-1-installation Provides commands for compiling and installing xmake using the make utility. It includes options for specifying an installation prefix and for uninstalling the tool. ```bash make build; sudo make install ``` ```bash sudo make install prefix=/usr/local ``` ```bash sudo make uninstall ``` -------------------------------- ### Install Xmake via Winget (Windows) Source: https://xmake.io/guide/quick-start Installs Xmake on Windows using the Winget package manager. This is a convenient way to install Xmake if Winget is available. ```sh winget install xmake ``` -------------------------------- ### Install specific Xmake version or branch Source: https://xmake.io/guide/quick-start Installs a specific version or development branch of Xmake. Append the version number or branch name to the installation command. ```sh curl -fsSL https://xmake.io/shget.text | bash -s dev ``` ```sh curl -fsSL https://xmake.io/shget.text | bash -s v2.7.7 ``` ```powershell Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content v2.7.7 ``` -------------------------------- ### Run an xmake Project Source: https://xmake.io/guide/quick-start Executes the compiled program generated by xmake. ```sh $ xmake run ``` -------------------------------- ### Install xmake from Source (Recursive Clone) Source: https://xmake.io/posts/quickstart-1-installation Installs xmake by cloning the repository recursively to include submodules, then running the local installation script. This is useful for development or when the latest changes are needed. ```shell $ git clone --recursive https://github.com/xmake-io/xmake.git $ cd ./xmake $ ./scripts/get.sh __local__ $ source ~/.xmake/profile ``` -------------------------------- ### Install Xmake on Other Linux (Run Script) Source: https://xmake.io/guide/quick-start Installs Xmake on Linux systems by downloading and running a `.run` installer script. This is an alternative if your distribution's package manager doesn't have Xmake. ```sh sudo chmod 777 ./xmake-x.x.x.gz.run ./xmake-x.x.x.gz.run ``` -------------------------------- ### Build and Install xmake (Windows) Source: https://xmake.io/guide/quick-start Builds xmake on Windows systems. This command is executed from the core directory of the cloned repository. ```sh cd ./core xmake ``` -------------------------------- ### Update xmake from Git Source Source: https://xmake.io/guide/quick-start Updates xmake by pulling from a specified Git repository and branch, including mirrors like Gitee. ```sh xmake update github:xmake-io/xmake#master ``` ```sh xmake update gitee:tboox/xmake#dev ``` -------------------------------- ### Clone xmake Source Code (Mirrors) Source: https://xmake.io/guide/quick-start Provides alternative Git clone commands for slower connections, using mirror sources from Gitee or GitLab. ```sh git clone --recursive https://gitee.com/tboox/xmake.git ``` ```sh git clone --recursive https://gitlab.com/tboox/xmake.git ``` -------------------------------- ### Install xmake Master Version via Wget Source: https://xmake.io/posts/quickstart-1-installation Installs the master version of xmake using a one-click installation script fetched via wget. This is an alternative to curl for downloading scripts. ```bash Bash <(wget https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh -O -) ``` -------------------------------- ### Install xmake from Source (Update Submodules) Source: https://xmake.io/posts/quickstart-1-installation Installs xmake from source when submodules were not initially cloned recursively. It first updates the submodules and then runs the local installation script. ```shell $ git clone https://github.com/xmake-io/xmake.git $ cd ./xmake $ git submodule update --init $ ./scripts/get.sh __local__ ``` -------------------------------- ### Installing Header Files Source: https://xmake.io/zh/posts/project-desciption-examples Configures header file installation, specifying which headers to include and where to place them in the build directory, including pattern matching and exclusion rules. ```lua target("tbox") set_kind("static") add_files("src/*.c") add_headers("../(tbox/**.h)|**/impl/**.h") set_headerdir("$(buildir)/inc") ``` -------------------------------- ### Run xmake Project in Debug Mode Source: https://xmake.io/guide/quick-start Executes the project with a debugger attached, allowing for step-by-step execution and inspection. ```sh $ xmake run -d hello ``` -------------------------------- ### xrepo Install with Mirror Proxy Source: https://xmake.io/zh/guide/package-management/network-optimization Demonstrates installing a package using `xrepo` which leverages configured mirror proxy rules. The example shows how a GitHub URL is automatically redirected to a fastgit mirror for downloading the package archive. ```shell $ xrepo install libpng > curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip ``` -------------------------------- ### Install Application Source: https://xmake.io/zh/examples/other-languages/objc Illustrates how to install an application to a device or system directory using xmake. This includes installing iOS IPAs to devices and macOS apps to the Applications directory. ```sh $ xmake install $ xmake l utils.ipa.install test.app $ xmake l utils.ipa.install test.ipa ``` -------------------------------- ### Install xmake Master Version via Curl Source: https://xmake.io/posts/quickstart-1-installation Installs the master version of xmake using a one-click installation script fetched via curl. This method is common for Linux and macOS environments. ```bash Bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh) ``` -------------------------------- ### Install Application to Device or System Source: https://xmake.io/examples/other-languages/objc Installs the built application. For iOS, it deploys the .ipa to a connected device. For macOS, it installs the .app to the Applications directory. ```sh $ xmake install ``` -------------------------------- ### Install xmake via Scoop (Windows) Source: https://xmake.io/posts/quickstart-1-installation Installs xmake on Windows using the Scoop package manager. This is a convenient way to manage installations and updates for command-line tools. ```shell Scoop install xmake ``` -------------------------------- ### Install xmake Master Version via PowerShell Source: https://xmake.io/posts/quickstart-1-installation Installs the master version of xmake using a PowerShell script. This is the recommended method for Windows users who prefer script-based installation. ```powershell Invoke-Expression (Invoke-Webrequest 'https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.ps1' -UseBasicParsing).Content ``` -------------------------------- ### xmake Build and Install Android Application Source: https://xmake.io/examples/cpp/qt Details the process of building a Qt application for Android using xmake, generating an APK, and installing it onto a device. It includes commands for project creation, configuration, building, and installation. ```sh $ xmake create -t quickapp_qt -l c++ appdemo $ cd appdemo $ xmake f -p android --ndk=~/Downloads/android-ndk-r19c/ --android_sdk=~/Library/Android/sdk/ -c $ xmake [0%]: compiling.qt.qrc src/qml.qrc [ 50%]: cache compiling.release src/main.cpp [100%]: linking.release libappdemo.so [100%]: generating.qt.app appdemo.apk $ xmake install installing appdemo ... installing build/android/release/appdemo.apk .. success install ok!👌 ``` -------------------------------- ### xmake: C++ Modules Package Meta-Info Example Source: https://xmake.io/zh/posts/xmake-update-v2.7.6 Provides an example of the meta-info file stored within a package's installation directory, detailing its structure and content as per the specified format. ```bash $ cat ./build/.packages/f/foo/latest/4e0143c97b65425b855ad5fd03038b6a/modules/foo/foo.mpp.meta-info {"_VENDOR_extension":{"xmake":{"name":"foo","file":"foo.mpp"}},"definitions":{},"include_paths":{}} ``` -------------------------------- ### Basic C++ Example Source: https://context7_llms A fundamental example of building a C++ project using Xmake. The linked page provides a basic setup for a C++ application. ```APIDOC Topic: Basic C++ Example Description: A simple example demonstrating how to build a C++ project with Xmake. This typically involves: - A C++ source file (e.g., main.cpp). - An xmake.lua file to define the target (e.g., an executable). Example xmake.lua: target("my_app") set_kind("binary") add_files("src/*.cpp") Refer to the specific example documentation for code snippets. ``` -------------------------------- ### Update xmake Lua Scripts Only Source: https://xmake.io/guide/quick-start Updates only the xmake Lua scripts, bypassing binary updates. This is a faster way to get script-level changes. ```sh xmake update -s dev ``` -------------------------------- ### Build and Run Qt Quick App with xmake Source: https://xmake.io/zh/examples/cpp/qt Shows the typical xmake build process for a Qt application, including automatic detection of Qt SDK and linking. It then demonstrates how to run the compiled application. ```sh $ xmake checking for the architecture ... x86_64 checking for the Xcode directory ... /Applications/Xcode.app checking for the SDK version of Xcode ... 10.15 checking for the Qt SDK directory ... /Users/ruki/Qt5.13.2/5.13.2/clang_64 checking for the Qt SDK version ... 5.13.2 [ 0%]: cache compiling.release src/main.cpp [ 49%]: compiling.qt.qrc src/qml.qrc [100%]: linking.release test build ok! $ xmake run ``` -------------------------------- ### Install Xmake on macOS using Homebrew Source: https://xmake.io/guide/quick-start Installs Xmake on macOS using the Homebrew package manager. This is the recommended method for macOS users. ```sh brew install xmake ``` -------------------------------- ### xmake Create Command Help Source: https://xmake.io/zh/examples/cpp/basic Displays help information for the `xmake create` command, detailing its usage and supported project templates. ```sh xmake create --help ``` -------------------------------- ### Install Xmake on Termux (Android) Source: https://xmake.io/guide/quick-start Installs Xmake on Android devices using the Termux package manager. This allows you to use Xmake in the Termux environment. ```sh pkg install xmake ``` -------------------------------- ### xmake Build and Run Example Source: https://xmake.io/examples/cpp/qt Demonstrates the typical workflow of building and running a Qt project with xmake. It shows the output of the build process and the command to execute the application. ```sh $ xmake checking for the architecture ... x86_64 checking for the Xcode directory ... /Applications/Xcode.app checking for the SDK version of Xcode ... 10.15 checking for the Qt SDK directory ... /Users/ruki/Qt5.13.2/5.13.2/clang_64 checking for the Qt SDK version ... 5.13.2 [0%]: cache compiling.release src/main.cpp [49%]: compiling.qt.qrc src/qml.qrc [100%]: linking.release test Build ok! $ xmake run ``` -------------------------------- ### xmake Create Command Help Source: https://xmake.io/examples/cpp/basic Displays the help information for the 'xmake create' command, providing details on its usage and supported project templates for quickly starting new projects. ```sh xmake create --help ``` -------------------------------- ### Install Xmake on FreeBSD Source: https://xmake.io/guide/quick-start Installs Xmake on FreeBSD using the pkg package manager. The package name is specifically 'xmake-io' due to potential naming conflicts. ```sh pkg install xmake-io ``` -------------------------------- ### Install Xmake on Linux distributions Source: https://xmake.io/guide/quick-start Installs Xmake on various Linux distributions using their native package managers. This includes Archlinux, Alpine, Ubuntu, Debian, and Fedora. ```sh sudo pacman -Sy xmake ``` ```sh sudo apk add xmake ``` ```sh sudo apt install xmake ``` ```sh sudo apt install xmake ``` ```sh sudo dnf install xmake ``` -------------------------------- ### Install Xmake on MSYS/MinGW Source: https://xmake.io/guide/quick-start Installs Xmake on MSYS or MinGW environments using the pacman package manager. This command adds Xmake to your system's package list. ```sh pacman -Sy mingw-w64-x86_64-xmake ``` ```sh pacman -Sy mingw-w64-i686-xmake ``` -------------------------------- ### Update xmake to Specific Version Source: https://xmake.io/guide/quick-start Updates the xmake installation to a specified version. This command is useful for managing different xmake releases. ```sh xmake update 2.7.1 ``` -------------------------------- ### Uninstall xmake Source: https://xmake.io/guide/quick-start Uninstalls the xmake build system from the current environment. ```sh xmake update --uninstall ``` -------------------------------- ### xmake Command Examples Source: https://xmake.io/zh/posts/project-desciption-examples Provides examples of common xmake commands used for configuring build modes, switching library kinds, and initiating the build process. ```bash $ xmake f --kind=static; xmake $ xmake f --kind=shared; xmake $ xmake f -m debug; xmake $ xmake f -m release; xmake $ xmake f -p iphoneos -a arm64; xmake ``` -------------------------------- ### Configure xmake Debugger Source: https://xmake.io/guide/quick-start Specifies the debugger to be used by xmake for running and debugging projects. ```sh $ xmake f --debugger=gdb ``` -------------------------------- ### Create Qt Projects with xmake Source: https://xmake.io/examples/cpp/qt Demonstrates how to create various types of Qt projects using the xmake command-line tool. These commands set up the basic structure for Qt console, static, shared, quick, and widget applications. ```sh $ xmake create -t qt.console test $ xmake create -t qt.static test $ xmake create -t qt.shared test $ xmake create -t qt.quickapp test $ xmake create -t qt.widgetapp test ``` -------------------------------- ### Configure xmake for Debug Build Source: https://xmake.io/guide/quick-start Sets the build mode to 'debug' for the xmake project before compiling. ```sh $ xmake config -m debug $ xmake ``` -------------------------------- ### Create Qt QuickApp Project with xmake Source: https://xmake.io/zh/posts/quickstart-2-create-and-build-project Shows how to create a Qt QuickApp project using `xmake create` by specifying the C++ language and the `qt.quickapp` template. ```bash $ xmake create -l c++ -t qt.quickapp test create test ... [+]: xmake.lua [+]: src/interface.c [+]: src/main.qml [+]: src/interface.h [+]: src/test.c [+]: src/main.cpp [+]: src/qml.qrc [+]: .gitignore create ok! ``` -------------------------------- ### Get clang Compiler Version Source: https://xmake.io/zh/guide/extras/environment-variables This command queries the installed version of the clang compiler. It's a standard way to verify the compiler setup and compatibility. ```shell /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version ``` -------------------------------- ### Example Build Process with Third-Party Packages Source: https://xmake.io/zh/api/description/global-interfaces Demonstrates the build process after defining dependencies from third-party managers. It shows the xmake command and the output indicating package installation. ```sh xmake # Example Output: # checking for the architecture ... x86_64 # checking for the Xcode directory ... /Applications/Xcode.app # checking for the SDK version of Xcode ... 10.14 # note: try installing these packages (pass -y to skip confirm)? # -> conan::zlib/1.2.11 (debug) # -> conan::openssl/1.1.1g # please input: y (y/n) # # => installing conan::zlib/1.2.11 .. ok # => installing conan::openssl/1.1.1g .. ok # # [ 0%]: cache compiling.release src/main.c # [100%]: linking.release test ``` -------------------------------- ### Basic xmake.lua Configuration Source: https://xmake.io/zh/posts/quickstart-2-create-and-build-project An example of a simple `xmake.lua` file that defines a binary target named 'test', specifies source files to include, and enables debug and release build modes. ```lua add_rules("mode.debug", "mode.release") target("test") set_kind("binary") add_files("src/*.cpp") ``` -------------------------------- ### Create xmake Project Source: https://xmake.io/posts/how-to-build-a-simple-project Initiates a new console project using the `xmake create` command, setting up the basic directory structure and configuration files for a new project named 'hello'. ```bash $ xmake create -P ./hello create hello ... create ok!👌 ``` -------------------------------- ### Create Qt Projects with xmake Source: https://xmake.io/zh/examples/cpp/qt Demonstrates creating various types of Qt projects (console, static, shared, quickapp, widgetapp) using the xmake build system. These commands set up the basic project structure for different Qt application types. ```sh $ xmake create -t qt.console test $ xmake create -t qt.static test $ xmake create -t qt.shared test $ xmake create -t qt.quickapp test $ xmake create -t qt.widgetapp test ``` -------------------------------- ### Get clang Compiler Version Source: https://xmake.io/guide/extras/environment-variables This command queries the installed version of the clang compiler. It's a standard way to verify the compiler setup and compatibility. ```shell /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version ``` -------------------------------- ### Initialize Git Submodules Source: https://xmake.io/guide/quick-start Updates and initializes Git submodules if `--recursive` was omitted during the initial clone. Essential for ensuring all project dependencies are present. ```sh git submodule update --init ``` -------------------------------- ### Create a New Project with xmake Source: https://xmake.io/zh/posts/quickstart-2-create-and-build-project Demonstrates the `xmake create` command to generate a default C++ project structure, including the `xmake.lua` build script, source files, and a `.gitignore` file. ```bash $ xmake create test create test ... [+]: xmake.lua [+]: src/main.cpp [+]: .gitignore create ok! ``` -------------------------------- ### Clone xmake Source Code (Git) Source: https://xmake.io/guide/quick-start Clones the xmake repository recursively to include all submodules. This is the primary method for obtaining the latest source code. ```sh git clone --recursive https://github.com/xmake-io/xmake.git cd ./xmake ``` -------------------------------- ### Run XMake Plugin from Command Line Source: https://xmake.io/guide/extensions/plugin-development Demonstrates how to execute a registered XMake plugin from the command line. This example runs the 'hello' plugin. ```sh xmake hello ``` -------------------------------- ### Update xmake to Development Branch Source: https://xmake.io/guide/quick-start Updates xmake to the latest version from the 'master' or 'dev' branches. This allows users to access the newest features and fixes. ```sh xmake update master ``` ```sh xmake update dev ``` -------------------------------- ### Get Package Installation Directory Source: https://xmake.io/api/scripts/package-instance Retrieves the installation directory for a package. This function can also be used to get a subdirectory within the installation path. If the specified directory tree does not exist, it will be created. ```lua -- returns the installation directory package:installdir() -- returns the subdirectory include inside the installation directory package:installdir("include") -- returns the subdirectory include/files package:installdir("include", "files") ``` -------------------------------- ### Example xmake.lua for C++ Project Source: https://xmake.io/zh/guide/basic-commands/create-project Provides a basic xmake.lua configuration file for a C++ binary project. It sets up build modes and defines the target with source files. ```lua add_rules("mode.debug", "mode.release") target("hello") set_kind("binary") add_files("src/*.cpp") ``` -------------------------------- ### Install Xmake using Homebrew on macOS Source: https://xmake.io/posts/how-to-install-xmake This guide explains how to install Xmake on macOS using the Homebrew package manager. It first ensures Homebrew is installed and then proceeds to install Xmake. ```bash # Ensure Homebrew is installed ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Install Xmake sudo brew install xmake ``` -------------------------------- ### Create Rust Project with xmake Source: https://xmake.io/zh/posts/quickstart-2-create-and-build-project Demonstrates creating a project for the Rust language using `xmake create -l rust`, and then building it with the standard `xmake` command. ```bash $ xmake create -l rust test create test ... [+]: xmake.lua [+]: src/main.rs [+]: .gitignore create ok! $ xmake checking for the architecture ... x86_64 checking for the Xcode directory ... /Applications/Xcode.app checking for the SDK version of Xcode ... 10.15 [ 0%]: linking.release test ``` -------------------------------- ### Install xmake via Homebrew (macOS) Source: https://xmake.io/posts/quickstart-1-installation Installs xmake on macOS using the Homebrew package manager. This command assumes Homebrew is already installed. ```shell $ ruby ​​-e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew install xmake ``` -------------------------------- ### Example Compiler Command with Local Packages Source: https://xmake.io/posts/xmake-update-v2.5.5 A sample compiler command line generated by xmake, showing how linked libraries and directories from local packages are passed to the linker. ```console "/usr/bin/xcrun -sdk macosx clang++" -o build/macosx/x86_64/release/bar build/.objs/bar/macosx/x86_64/release/src/main.cpp.o -arch x86_64 -mmacosx-version -min=10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -stdlib=libc++ -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/f/foo/macosx/x86_64/release/lib -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/s/sub/macosx/x86_64/release/lib -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/a/add/macosx/x86_64/release/lib -Wl,-x -lfoo -lsub -ladd -lz ``` -------------------------------- ### xmake create Command Help Source: https://xmake.io/posts/quickstart-2-create-and-build-project Displays the help information for the 'xmake create' command, outlining available options for project creation such as language and template selection. ```APIDOC Usage: $xmake create [options] [target] Create a new project. Options: -l LANGUAGE, --language=LANGUAGE The project language (default: c++) - c++ - go - dlang - cuda - rust - swift - objc - c - objc++ -t TEMPLATE, --template=TEMPLATE Select the project template id or name of the given language. (default: console) - console: c++, go, dlang, cuda, rust, swift, objc, c, objc++ - qt.console: c++ - qt.quickapp: c++ - qt.quickapp_static: c++ - qt.shared: c++ - qt.static: c++ - qt.widgetapp: c++ - qt.widgetapp_static: c++ - shared: c++, dlang, cuda, c - static: c++, go, dlang, cuda, rust, c - tbox.console: c++, c - tbox.shared: c++, c - tbox.static: c++, c Target Create the given target. Uses the project name as target if not exists. ``` -------------------------------- ### Basic Binary Target Configuration Source: https://xmake.io/zh/posts/project-desciption-examples Defines a simple binary target named 'demo' and adds all C files from the 'src/' directory. This is a fundamental configuration for executable programs. ```lua target("demo") set_kind("binary") add_files("src/*.c") ``` -------------------------------- ### VS Code Quick Pick List Example Source: https://xmake.io/zh/posts/xmake-vscode Demonstrates how to create and display a list of options to the user in VS Code using the QuickPick API. This is useful for selecting platforms, configurations, or other user-defined choices. ```javascript let items: vscode.QuickPickItem[] = []; items.push({label: "linux", description: "The Linux Platform"}); items.push({label: "macosx", description: "The MacOS Platform"}); items.push({label: "windows", description: "The Windows Platform"}); items.push({label: "android", description: "The Android Platform"}); items.push({label: "iphoneos", description: "The iPhoneOS Platform"}); items.push({label: "watchos", description: "The WatchOS Platform"}); items.push({label: "mingw", description: "The MingW Platform"}); items.push({label: "cross", description: "The Cross Platform"}); const chosen: vscode.QuickPickItem|undefined = await vscode.window.showQuickPick(items); if (chosen) { // Update status bar button text with the chosen label platButton.text = chosen.label; } ```