-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native_toolchain_c] Add libraries
and libraryDirectories
options to CTool
#1423
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ba01bec
Add `CBuilder.dynamicallyLinkTo` option
blaugold f599be3
Add file header
blaugold 94882a5
Add `libraries` and `libraryDirectories` to `CTool`
blaugold 2571265
Update changelog
blaugold 1676912
Update `native_dynamic_linking` test data
blaugold 0937ee8
Fix formatting of ctool.dart
blaugold a579d3e
Reformat native_dynamic_linking_test.dart a bit
blaugold 6b0b2c5
Run native_dynamic_linking_test.dart on windows
blaugold 8f8c84a
Fix doc comment
blaugold d2e13b3
Return wether comparison was successful
blaugold 074d465
Fix debug_printf in production mode
blaugold 6e5d7a7
Make `CBuilder` test pass on linux
blaugold 7e93fc5
Skip native_dynamic_linking_test.dart on Windows
blaugold d6c129e
Disable `dart test` in `example/build/native_dynamic_linking` on windows
blaugold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,17 @@ import 'package:meta/meta.dart'; | |
import 'package:native_assets_cli/code_assets.dart'; | ||
|
||
import 'cbuilder.dart'; | ||
import 'clinker.dart'; | ||
import 'language.dart'; | ||
import 'optimization_level.dart'; | ||
import 'output_type.dart'; | ||
|
||
/// Common options for [CBuilder] and [CLinker]. | ||
abstract class CTool { | ||
/// What kind of artifact to build. | ||
final OutputType type; | ||
|
||
/// Name of the library or executable to linkg. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. build or link (I believe linkers also inherit from ctool) |
||
/// Name of the library or executable to build or link. | ||
/// | ||
/// The filename will be decided by [LinkConfig.targetOS] and | ||
/// [OSLibraryNaming.libraryFileName] or | ||
|
@@ -50,16 +52,39 @@ abstract class CTool { | |
/// | ||
/// Defaults to `['Foundation']`. | ||
/// | ||
/// Framworks will not be automatically reported as dependencies of the hook. | ||
/// Frameworks will not be automatically reported as dependencies of the hook. | ||
/// Frameworks can be mentioned by name if they are available on the system, | ||
/// so the file path is not known. If you're depending on your own frameworks | ||
/// report them as dependencies of the hook by calling | ||
/// [BuildOutputBuilder.addDependency] / [LinkOutputBuilder.addDependency] | ||
/// manually. | ||
final List<String> frameworks; | ||
|
||
/// The default [frameworks]. | ||
static const List<String> defaultFrameworks = ['Foundation']; | ||
|
||
/// Libraries to link to. | ||
/// | ||
/// In addition to the system default directories, libraries will be searched | ||
/// for in [libraryDirectories]. | ||
/// | ||
/// If you want to link to a library that was built by another [CBuilder] or | ||
/// [CLinker], either leave the default [libraryDirectories] or include `'.'` | ||
/// in the list. | ||
final List<String> libraries; | ||
|
||
/// Directories to search for [libraries], in addition to the system default | ||
/// directories. | ||
/// | ||
/// Resolved against [LinkConfig.outputDirectory]. | ||
/// | ||
/// Defaults to `['.']`, which means the [LinkConfig.outputDirectory] will be | ||
/// searched for libraries. | ||
final List<String> libraryDirectories; | ||
|
||
/// The default [libraryDirectories]. | ||
static const List<String> defaultLibraryDirectories = ['.']; | ||
|
||
/// TODO(https://github.com/dart-lang/native/issues/54): Move to [LinkConfig] | ||
/// or hide in public API. | ||
@visibleForTesting | ||
|
@@ -130,6 +155,8 @@ abstract class CTool { | |
required this.sources, | ||
required this.includes, | ||
required this.frameworks, | ||
required this.libraries, | ||
required this.libraryDirectories, | ||
required this.installName, | ||
required this.flags, | ||
required this.defines, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
if (Platform.isWindows) {
on line 20.