Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/xmake.shPublic template

A script-only build utility like autotools

License

NotificationsYou must be signed in to change notification settings

xmake-io/xmake.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xmake.sh

github-cigithub-ciGithub All Releases
licenseRedditGitterTelegramQQDiscordDonate

A script-only build utility like autotools

Support this project

Support this project bybecoming 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 theGithub sponsor program,This gives you access to thexmake-io/technical-support repository, where you can get more information on consulting.

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

Introduction

Xmake.sh is a script-only build utility like autotools.

Advantages

  • No any dependencies
  • No installation, only one shell script file
  • Easy, similar configuration syntax to xmake
  • Compatible with autotools, same usage

Supported features

  • Generate makefile
  • Custom toolchains
  • Detect options, code snippets, dependencies, compiler features
  • Support builtin variables

In the future it will support

  • Generate build.ninja
  • Support more xmake features

New project

Copy./configure script file to your project root directory.

Write project configuration

We just writexmake.sh project file, like this:

#!/bin/shset_project"hello"set_version"1.0.1""%Y%m%d%H%M"option"debug""Enable debug compilation mode."falseoption"tests""Enable tests."trueoption"pthread"    add_links"pthread"    add_cincludes"pthread.h"    add_cfuncs"pthread_create"option_endoption"cxx_constexpr"    set_languages"c++11"    add_cxxsnippets"constexpr int k = 0;"option_endoption"lua"    add_cfuncs"lua_pushstring"    add_cincludes"lua.h""lualib.h""lauxlib.h"    before_check"option_find_lua"option_endoption_find_lua() {    option"lua"        add_cxflags`pkg-config --cflags lua5.42>/dev/null`        add_ldflags`pkg-config --libs lua5.42>/dev/null`    option_end}set_warnings"all""error"set_languages"c99""c++11"if is_mode"debug";then    set_symbols"debug"    set_optimizes"none"else    set_strip"all"    set_symbols"hidden"    set_optimizes"smallest"fitarget"demo"    set_kind"binary"    add_deps"foo""bar"    add_files"*.cpp"    add_includedirs"foo""bar"    add_configfiles"config.h.in"    set_configdir"${buildir}/include"    add_headerfiles"${buildir}/include/config.h""hello"    add_headerfiles"(bar/*.h)""hello"    add_headerfiles"foo/(*.h)""hello"    add_installfiles"res/(png/**.png)""share"    add_options"lua"if has_config"debug";then        add_defines"DEBUG""TEST"fiif is_plat"linux""macosx";then        add_defines"POSIX"fiif has_config"pthread";then        set_configvar"HAS_PTHREAD" 1fiif has_config"cxx_constexpr";then        set_configvar"HAS_CONSTEXPR" 1fiincludes"foo""bar"if has_config"tests";then    includes"tests"fi

Configure and generate makefile

$./configure

Build project

$make

Install artifacts

$make install

Run program

$make run

Supported apis

  • set_project
  • set_version
  • includes
  • is_plat
  • is_arch
  • is_host
  • is_mode
  • is_config
  • has_config
  • set_config
  • target
    • set_kind
    • add_deps
    • add_files
    • set_basename
    • set_extension
    • set_filename
    • set_prefixname
    • set_targetdir
    • set_objectdir
    • add_defines
    • add_undefines
    • add_includedirs
    • add_linkdirs
    • add_rpathdirs
    • add_links
    • add_syslinks
    • set_strip
    • set_symbols
    • set_languages
    • set_warnings
    • set_optmizes
    • add_frameworks
    • add_frameworkdirs
    • add_cflags
    • add_cxflags
    • add_cxxflags
    • add_mflags
    • add_mxflags
    • add_mxxflags
    • add_asflags
    • add_ldflags
    • add_shflags
    • add_arflags
    • set_configdir
    • set_configfiles
    • set_configvar
    • set_installdir
    • add_installfiles
    • add_headerfiles
    • add_options
    • before_install
    • after_install
  • target_end
  • option
    • set_default
    • set_description
    • set_showmenu
    • add_defines
    • add_undefines
    • add_includedirs
    • add_linkdirs
    • add_links
    • add_syslinks
    • add_cflags
    • add_cxflags
    • add_cxxflags
    • add_cfuncs
    • add_cxxfuncs
    • add_cincludes
    • add_cxxincludes
    • add_ctypes
    • add_cxxtypes
    • add_csnippets
    • add_cxxsnippets
  • option_end
  • toolchain
    • set_toolset
    • set_sdkdir
    • set_bindir
    • set_cross
  • toolchain_end

Contacts


[8]ページ先頭

©2009-2025 Movatter.jp