native_toolchain_xmake 0.0.9 copy "native_toolchain_xmake: ^0.0.9" to clipboard
native_toolchain_xmake: ^0.0.9 copied to clipboard

A library to invoke and build Xmake projects for Dart Native Assets.

xmake #

install #

dart run native_toolchain_xmake:install
  • windows:

    irm https://xmake.io/psget.text | iex
    
  • linux

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

    或者

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

    brew install xmake
    

    Note

    用官网的 bash 反而会陷入找不到库

example #

void main(List<String> args) async {
  await build(args, (input, output) async {
    if (input.config.buildCodeAssets) {
      // flutter need to check this flag
      await XmakeLibrary(
        target: 'project_xmake',
        assetName: 'src/project_xmake.g.dart',
      ).build(input: input, output: output);
    }
  });
}

xmake #

流程:configure -> build -> install

config #

android

xmake f --plat=android --arch=x86_64 --toolchain=ndk --ndk="C:/Users/<you>/AppData/Local/Android/Sdk/ndk/<version>" --mode=release --kind=shared -y

windows:

xmake f --plat=windows --arch=x64 --mode=release --kind=shared -y

issue #

忘记为什么不用 cmake 了。好像是 compile_commands.json 生成的问题?

用 zig 交叉编译

install zig

winget install -e --id zig.zig
brew install zig

如果debug的时候,xmake正在下载程序,然后自己中断了,会导致比如curl子程序成为孤立的进程占用文件

xmake -vD

可以查看

0
likes
150
points
393
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A library to invoke and build Xmake projects for Dart Native Assets.

Repository (GitHub)

License

MIT (license)

Dependencies

code_assets, hooks, logging, native_toolchain_c, path

More

Packages that depend on native_toolchain_xmake