同步操作将从 tboox/xmake 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Xmake is an automatic cross-platform build tool.
create c/c++ projects
automatically probe the host environment and configure project
build and rebuild project
clean generated target files
package the project targets automatically
install target to pc or the mobile device
run a given target
describe the project file using lua script, more flexible and simple
-- xmake.lua
add_target("console")
-- set kind
set_kind("binary")
-- add files
add_files("src/*.c")
custom platforms and toolchains
custom rules for package/compiler/linker
XMake是一个跨平台自动构建工具,支持在各种主流平台上构建项目,类似cmake、automake、premake,但是更加的方便易用,工程描述语法更简洁直观,支持平台更多,并且集创建、配置、编译、打包、安装、卸载、运行于一体。
支持windows、mac、linux、ios、android等平台,自动检测不同平台上的编译工具链(也可手动配置) 编译windows项目采用原生vs的工具链,不需要使用cygwin、mingw(当然这些也支持)
支持自定义平台编译配置,可以很方便的扩展第三方平台支持
采用lua脚本语法描述项目,描述规则简单高效,逻辑规则可灵活修改,并且不会生成相关平台的工程文件,是工程更加简单明了
支持创建模板工程、配置项目、编译项目、运行、打包、安装和卸载等常用功能(后续还会增加:自动生成文档、调试等模块)
支持编译c/c++/objc成静态库、动态库、命令行可执行程序(后续还会增加:mac、ios、android的app的生成规则)
提供丰富的工程描述api,使用简单灵活,例如添加编译文件只需(还支持过滤排除):
add_files("src/*.c", "src/asm/**.S", "src/*.m")
支持头文件、接口、链接库依赖、类型的自动检测,并可自动生成配置头文件config.h
支持自定义编译配置开关,例如如果在工程描述文件中增加了enable_xxx的开关,那么配置编译的时候就可以手动进行配置来启用它:
xmake config --enable_xxx=true
提供一键打包功能,不管在哪个平台上进行打包,都只需要执行一条相同的命令,非常的方便
支持自定义编译工具和规则,例如想要增加对masm/yasm的编译规则,只需将自己写的masm.lua/yasm.lua规则文件,放到当前项目目录下即可。。
支持全局配置,一些常用的项目配置,例如工具链、规则描述等等,都可以进行全局配置,这样就不需要每次编译不同工程,都去配置一遍
除了可以自动检测依赖模块,也支持手动强制配置模块,还有各种编译flags。
也可以参考使用xmake的实际项目:TBOX
####后续工作
####alipay
####windows
####linux/macosx
Please see wiki if you want to known more usage or run xmake --help command.
// create a c++ console project
xmake create -l c++ -t 1 console
or xmake create --language=c++ --template=1 console
// enter the project directory
cd ./console
// build for the host platform
xmake
// only build for the given target
xmake target
// config and build for the host platform for debug
xmake f -m debug
or xmake config --mode=debug
xmake
// config and build for the iphoneos platform
xmake f -p iphoneos
or xmake config --plat=iphoneos
xmake
// config and build for the iphoneos platform with arm64
xmake f -p iphoneos -a arm64
or xmake config --plat=iphoneos --arch=arm64
xmake
// config and build for the android platform
xmake f -p android --ndk=xxxxx
xmake
// build and package project
xmake package
xmake package -a "i386, x86_64"
xmake package --arch="armv7, arm64"
xmake package --output=/tmp
// rebuild project
xmake -r
or xmake --rebuild
// clean all project targets
xmake c
or xmake clean
// clean the given project target
xmake c target
or xmake clean target
// run the given project target
xmake r target
or xmake run target
// install all targets
xmake i
or xmake install
-- the debug mode
if modes("debug") then
-- enable the debug symbols
set_symbols("debug")
-- disable optimization
set_optimize("none")
end
-- the release mode
if modes("release") then
-- set the symbols visibility: hidden
set_symbols("hidden")
-- enable fastest optimization
set_optimize("fastest")
-- strip all symbols
set_strip("all")
end
-- add target
add_target("test")
-- set kind
set_kind("static")
-- add files
add_files("src/*.c")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。