Skip to main content

native_toolchain_c 0.19.6 copy "native_toolchain_c: ^0.19.6" to clipboard
native_toolchain_c: ^0.19.6 copied to clipboard

A library to invoke the native C compiler installed on the host machine.

0.19.6 #

  • Decode vswhere -utf8 output as streaming UTF-8, preserving localized installation paths and JSON. Other tools still default to the system encoding.
  • Preserve minor and patch components of iOS and macOS deployment targets in CBuilder and CLinker. Requires package:code_assets 2.2.0.
  • Support listing .h files in CBuilder.sources to track header changes as build dependencies without passing them to the compiler.
  • Default linkerOptions to LinkerOptions.manual() in CLinker.run when omitted so static archives link all symbols by default.
  • Fix LinkerOptions.treeshake on Windows for thousands of symbols: no longer pass an /INCLUDE: flag per symbol in addition to the generated module-definition file, which exceeded the Windows command-line length limit. The generated module-definition file also no longer names the DLL MyDLL.
  • Do not pass linker flags (-Wl,-encryptable, -Wl,-z,max-page-size=16384, -framework, and C++ standard library link flags) when compiling object files for static libraries (-c).
  • Fix environmentFromBatchFile, and with it finding the MSVC environment on Windows, when the NoDefaultCurrentDirectoryInExePath environment variable is set. The batch file was run by its bare file name, which cmd.exe then doesn't look for in the working directory, so the environment came back empty. It now runs as .\<name>.bat.
  • environmentFromBatchFile now throws a ProcessException if running the batch file fails, instead of returning an empty environment.

0.19.5 #

  • Support Architecture.arm64e for macOS and iOS.
  • Bump package:code_assets dependency to ^2.1.0.
  • Access all file system state through a package:file FileSystem, exposed as an optional parameter on CBuilder.run, CLinker.run, CLibrary.build, and CLibrary.link (defaulting to LocalFileSystem), so file system access can be mocked in tests. (#3072)

0.19.4 #

  • Fix native_toolchain_c failing with MSSSMS installed by requiring vswhere to only show output that includes the necessary build tools
  • Link frameworks for C and C++ sources targeting macOS or iOS. (#3162)
  • Bump package:code_assets dependency to ^2.0.0.
  • Spawn all processes through a package:process ProcessManager, exposed as an optional parameter on CBuilder.run, CLinker.run, CLibrary.build, and CLibrary.link (defaulting to LocalProcessManager), so process invocations can be mocked in tests. (#3072)

0.19.3 #

  • Fixed building with MSVC on Windows when a source, include, or output path contains a space (e.g. a user name with a space in the default pub cache location). The compiler and archiver are now invoked directly instead of through cmd.exe, whose quote handling mangled such command lines. As a consequence, cmd.exe environment variable expansion (%VAR%) no longer applies to compiler flags and defines; they are passed to the tools verbatim.
  • The MSVC archiver is now passed the object file names derived from the sources instead of *.obj, so object files left in the output directory by other builds are no longer swept into the archive, and archive member names no longer embed the local build directory path.
  • Support cross-compiling to Linux from macOS and Windows hosts. (#2185)

0.19.2 #

  • Fixed compatibility with newer Xcode versions when cross-compiling static libraries on macOS hosts targeting Android and Linux.

0.19.1 #

  • Added support for passing sanitizer flags (-fsanitize=address, -fsanitize=memory, -fsanitize=thread) to C compilers and linkers.
  • Depend on package:code_assets ^1.2.0.

0.19.0 #

  • Bumped dependency on package:code_assets to ^1.1.0 and package:hooks to ^2.0.0.

0.18.0 #

  • Made CLinker.run Logger argument optional. It now defaults to a logger printing to stdout and stderr.
  • For LinkerOptions.treeshake, skip bundling a dynamic library if symbolsToKeep is empty.

0.17.6 #

  • On Android, use the NDK's libc++.a linker script when cppLinkStdLib is 'c++_static'. This ensures both libc++_static and libc++abi are linked, fixing dlopen failures on newer Android versions caused by missing C++ ABI symbols. (#3240)

0.17.5 #

  • Search for NDK in ANDROID_HOME and ANDROID_NDK environment variables.
  • On iOS and macOS, use the -encryptable linker flag. This resolves an issue with app store rejections.
  • Fix unportable link arg when cross-compiling from MacOS.

0.17.4 #

  • For Windows, include errors from the standard output of cl in the logger's output of CBuilder. (#2809)

0.17.3 #

  • Bump package:hooks and package:code_assetsto 1.0.0.

0.17.2 #

  • Made CBuilder.run Logger argument optional. It now defaults to a logger printing to stdout and stderr. (Technically this is a breaking change on passing null explicitly, but I doubt anyone is using it like that.)
  • Broaden compiler tool discovery

0.17.1 #

  • Bump package:hooks and package:code_assetsto 0.20.0.

0.17.0 #

  • Fix treeshaking on mac.

0.16.8 #

  • Support building assets for packages which are not the input package.

0.16.7 #

  • Support Module Definitions for linking on Windows.

0.16.6 #

  • Support linking for Windows.

0.16.5 #

  • Support linking for iOS.

0.16.4 #

  • Support linking for MacOS.

0.16.3 #

  • Support linking for Android.

0.16.2 #

  • Bump the SDK constraint to at least the one from package:hooks to fix dartdoc generation on https://pub.dev.

0.16.1 #

  • Firebase Studio NixOS support (default install locations for native toolchains).

0.16.0 #

  • Depend on package:code_assets and package:hooks 0.19.0. (package:native_assets_cli was split up into these packages.)

0.15.0 #

  • Bump package:native_assets_cli to 0.18.0.

0.14.0 #

  • Bump package:native_assets_cli to 0.17.0.

0.13.0 #

  • Bump package:native_assets_cli to 0.16.0.

0.12.0 #

  • Bump package:native_assets_cli to 0.16.0.

0.11.0 #

  • Replace linkInPackage with Routing.
  • Bump package:native_assets_cli to 0.14.0.

0.10.0 #

  • Bump package:native_assets_cli to 0.13.0 and required fixes.

0.9.0 #

  • Added support for forced includes to CBuilder.
  • Toolchain recognizing fixes.
  • Bump package:native_assets_cli to 0.12.0.

0.8.0 #

  • Bump package:native_assets_cli to 0.11.0.
  • Support for LLVM Clang on Windows (requires MSVC to be installed).

0.7.0 #

0.6.0 #

  • Address analyzer info diagnostic about multi-line if requiring a block body.
  • Bump package:native_assets_cli to 0.9.0. This makes package:native_toolchain_c now take BuildOutputBuilder and LinkOutputBuilder objects.

0.5.4 #

  • Bump package:native_assets_cli to 0.8.0.

0.5.3 #

  • Fix internal bug in LinkerOptions.
  • Bump package:native_assets_cli to 0.7.3.

0.5.2 #

  • Deprecated CBuilder's constructors dartBuildFiles. The Dart sources are automatically used for determining whether hooks need to be rerun by newer Dart and Flutter SDKs.

0.5.1 #

  • Bump package:native_assets_cli to 0.7.0.

0.5.0 #

  • Renamed parameters in Builder.run.
  • Added Language.objectiveC.
  • Use HookConfig.targetIosSdk and HookConfig.targetMacosSdk optional values, and pass them to the clang compiler.

0.4.2 #

  • Bump package:native_assets_cli to 0.5.0.

0.4.1 #

0.4.0 #

0.3.4+1 #

  • Stop depending on private package:native_assets_cli CCompilerConfig fields.

0.3.4 #

  • Bump package:native_assets_cli to 0.4.0.

0.3.3 #

  • Export environmentFromBatchFile.
  • Bump package:native_assets_cli to 0.3.2.

0.3.2 #

  • Added workaround minSdkVersion 19 and 20 for Android.
  • Start using sysroot for Android.
  • Added tests for up to Android API version 34.

0.3.1 #

  • Added MSVC arm64 toolchain.

0.3.0 #

  • Bump package:native_assets_cli to 0.3.0.

0.2.5 #

  • Explicitly tell linker to create position dependent or position independent executable (#113).

0.2.4 #

  • Added includes for specifying include directories.
  • Added flags for specifying arbitrary compiler flags.
  • Added std for specifying a language standard.
  • Added language for selecting the language (c and cpp) to compile source files as.
  • Added cppLinkStdLib for specifying the C++ standard library to link against.

0.2.3 #

  • Fix MSVC tool resolution inside (x86) folder (#123).

0.2.2 #

  • Generate position independent code for libraries by default and add pic option to control this behavior.

0.2.1 #

  • Added defines for specifying custom defines.
  • Added buildModeDefine to toggle define for current build mode.
  • Added ndebugDefine to toggle define of NDEBUG for non-debug builds.

0.2.0 #

  • Breaking change Rename assetName to assetId (#100).
  • Added topics.

0.1.0 #

  • Initial version.
27
likes
150
points
4.54M
downloads

Documentation

API reference

Publisher

verified publisherlabs.dart.dev

Weekly Downloads

A library to invoke the native C compiler installed on the host machine.

Repository (GitHub)
View/report issues
Contributing

Topics

#compiler #ffi #interop #native-assets #native-toolchain

License

BSD-3-Clause (license)

Dependencies

code_assets, file, glob, hooks, logging, meta, process, pub_semver

More

Packages that depend on native_toolchain_c