MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / build_native

Function build_native

tools/build_android_aar.py:88–119  ·  view source on GitHub ↗
(args, root, android_sdk_root)

Source from the content-addressed store, hash-verified

86
87
88def build_native(args, root, android_sdk_root):
89 ndk_root = resolve_ndk_root(android_sdk_root, args.ndk_root)
90 ninja = resolve_ninja(root)
91 toolchain = ndk_root / 'build' / 'cmake' / 'android.toolchain.cmake'
92 build_root = args.native_build_root.resolve()
93
94 for abi in args.abis:
95 build_dir = build_root / abi
96 build_dir.mkdir(parents=True, exist_ok=True)
97
98 cmake_cmd = [
99 resolve_executable('cmake'),
100 '-G', 'Ninja',
101 '-S', root,
102 '-B', build_dir,
103 '-DCMAKE_MAKE_PROGRAM=%s' % ninja,
104 '-DCMAKE_TOOLCHAIN_FILE=%s' % toolchain,
105 '-DANDROID_ABI=%s' % abi,
106 '-DCMAKE_BUILD_TYPE=Release',
107 '-DANDROID_NATIVE_API_LEVEL=%s' % args.android_api_level,
108 '-DBUILD_SYNCHRONI_SDK=OFF',
109 ]
110 if args.use_libftdi:
111 cmake_cmd.append('-DUSE_LIBFTDI=ON')
112 if args.cmake_find_root_path:
113 cmake_cmd.append('-DCMAKE_FIND_ROOT_PATH=%s' % args.cmake_find_root_path)
114 for define in args.cmake_define:
115 cmake_cmd.append('-D%s' % define)
116
117 run_command(cmake_cmd, root)
118 run_command(
119 [resolve_executable('cmake'), '--build', build_dir, '--parallel', str(args.jobs)], root)
120
121
122def build_java(root):

Callers 1

mainFunction · 0.85

Calls 4

resolve_ndk_rootFunction · 0.85
resolve_ninjaFunction · 0.85
resolve_executableFunction · 0.85
run_commandFunction · 0.70

Tested by

no test coverage detected