CBuilder class
Specification for building an artifact with a C compiler.
Constructors
-
CBuilder.executable({required String name, List<
String> sources = const [], List<String> includes = const [], List<String> forcedIncludes = const [], List<String> frameworks = CTool.defaultFrameworks, List<String> libraries = const [], List<String> libraryDirectories = CTool.defaultLibraryDirectories, @Deprecated('Newer Dart and Flutter SDKs automatically add the Dart hook ' 'sources as dependencies.') List<String> dartBuildFiles = const [], List<String> flags = const [], Map<String, String?> defines = const {}, bool buildModeDefine = true, bool ndebugDefine = true, bool? pie = false, String? std, Language language = Language.c, String? cppLinkStdLib, OptimizationLevel optimizationLevel = OptimizationLevel.o3, BuildMode buildMode = BuildMode.release}) -
CBuilder.library({required String name, String? assetName, List<
String> sources = const [], List<String> includes = const [], List<String> forcedIncludes = const [], List<String> frameworks = CTool.defaultFrameworks, List<String> libraries = const [], List<String> libraryDirectories = CTool.defaultLibraryDirectories, @Deprecated('Newer Dart and Flutter SDKs automatically add the Dart hook ' 'sources as dependencies.') List<String> dartBuildFiles = const [], @visibleForTesting Uri? installName, List<String> flags = const [], Map<String, String?> defines = const {}, bool buildModeDefine = true, bool ndebugDefine = true, bool? pic = true, String? std, Language language = Language.c, String? cppLinkStdLib, LinkModePreference? linkModePreference, OptimizationLevel optimizationLevel = OptimizationLevel.o3, BuildMode buildMode = BuildMode.release})
Properties
- assetName → String?
-
Asset identifier.
finalinherited
- buildMode → BuildMode
-
final
- buildModeDefine → bool
-
Whether to define a macro for the current BuildMode.
final
- cppLinkStdLib → String?
-
The C++ standard library to link against.
finalinherited
-
dartBuildFiles
→ List<
String> -
The dart files involved in building this artifact.
final
-
defines
→ Map<
String, String?> -
Definitions of preprocessor macros.
finalinherited
-
flags
→ List<
String> -
Flags to pass to the linker.
finalinherited
-
forcedIncludes
→ List<
String> -
Files passed to the compiler that will be included before all source
files.
finalinherited
-
frameworks
→ List<
String> -
Frameworks to link.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
includes
→ List<
String> -
Include directories to pass to the linker.
finalinherited
- installName → Uri?
-
TODO(https://github.com/dart-lang/native/issues/54): Move to
LinkInput
or hide in public API.finalinherited - language → Language
-
The language to compile
sources
as.finalinherited -
libraries
→ List<
String> -
Libraries to link to.
finalinherited
-
libraryDirectories
→ List<
String> -
Directories to search for
libraries
, in addition to the system default directories.finalinherited - linkModePreference → LinkModePreference?
-
If the code asset should be a dynamic or static library.
finalinherited
- name → String
-
Name of the library or executable to build or link.
finalinherited
- ndebugDefine → bool
-
Whether to define the standard
NDEBUG
macro when not building with BuildMode.debug.final - optimizationLevel → OptimizationLevel
-
What optimization level should be used for compiling.
finalinherited
- pic → bool?
-
Whether the linker will emit position independent code.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sources
→ List<
String> -
Sources to build the library or executable.
finalinherited
- std → String?
-
The language standard to use.
finalinherited
- type → OutputType
-
What kind of artifact to build.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
{required BuildInput input, required BuildOutputBuilder output, required Logger? logger, List< AssetRouting> routing = const [ToAppBundle()]}) → Future<void> - Runs the C Compiler with on this C build spec.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited