简介XMake是一个跨平台自动构建工具,支持在各种主流平台上构建项目,类似cmake、automake、premake,但是更加的方便易用,工程描述语法更简洁直观,支持平台更多,并且集创建、配置、编译、打包、安装、卸载、运行于一体。 支持特性
简单例子创建一个c++ console项目: xmake create -l c++ -t 1 console or xmake create --language=c++ --template=1 console 工程描述文件:xmake.lua add_target("console") set_kind("binary") add_files("src/*.c") 配置工程: 这个是可选的步骤,如果只想编译当前主机平台的项目,是可以不用配置的,默认编译release版本。 当然每次配置都会被缓存,不需要每次全部重新配置。 xmake f -p iphoneos -m debug or xmake f --ldflags="-Lxxx -lxxx" or xmake f --plat=macosx --arch=x86_64 or xmake config --plat=iphoneos --mode=debug or xmake config --plat=iphonesimulator or xmake config --plat=android --arch=armv7-a --ndk=xxxxx or xmake config --cross=i386-mingw32- --toolchains=/xxx/bin or xmake config --cxflags="-Dxxx -Ixxx" or xmake config --help 编译工程: xmake or xmake -r or xmake --rebuild 运行目标: xmake r console or xmake run console 打包所有: xmake p or xmake p --archs="armv7, arm64" or xmake package or xmake package console or xmake package -o /tmp or xmake package --output=/tmp 安装目标: xmake i or xmake install or xmake install console or xmake install -o /tmp or xmake install --output=/tmp 详细使用方式和参数说明,请参考文档 或者运行: xmake -h or xmake --help or xmake config --help or xmake package --help ... 也可以参考一些使用xmake的项目: 后续工作
更新
|