Skip to content

Commit

Permalink
Fix native_toolchain_c lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes committed Jan 10, 2024
1 parent a013b98 commit 019ea6e
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions pkgs/native_toolchain_c/test/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:ffi';
import 'dart:io';

import 'package:logging/logging.dart';
import 'package:native_assets_cli/native_assets_cli_internal.dart' as internal;
import 'package:native_toolchain_c/src/native_toolchain/apple_clang.dart';
import 'package:native_toolchain_c/src/utils/run_process.dart';
import 'package:test/test.dart';
Expand Down Expand Up @@ -123,36 +122,29 @@ String unparseKey(String key) => key.replaceAll('.', '__').toUpperCase();
/// Archiver provided by the environment.
///
/// Provided on Dart CI.
final Uri? ar = Platform
.environment[unparseKey(internal.CCompilerConfig.arConfigKeyFull)]
?.asFileUri();
final Uri? ar = Platform.environment[unparseKey('c_compiler.ar')]?.asFileUri();

/// Compiler provided by the environment.
///
/// Provided on Dart CI.
final Uri? cc = Platform
.environment[unparseKey(internal.CCompilerConfig.ccConfigKeyFull)]
?.asFileUri();
final Uri? cc = Platform.environment[unparseKey('c_compiler.cc')]?.asFileUri();

/// Linker provided by the environment.
///
/// Provided on Dart CI.
final Uri? ld = Platform
.environment[unparseKey(internal.CCompilerConfig.ldConfigKeyFull)]
?.asFileUri();
final Uri? ld = Platform.environment[unparseKey('c_compiler.ld')]?.asFileUri();

/// Path to script that sets environment variables for [cc], [ld], and [ar].
///
/// Provided on Dart CI.
final Uri? envScript = Platform
.environment[unparseKey(internal.CCompilerConfig.envScriptConfigKeyFull)]
?.asFileUri();
final Uri? envScript =
Platform.environment[unparseKey('c_compiler.env_script')]?.asFileUri();

/// Arguments for [envScript] provided by environment.
///
/// Provided on Dart CI.
final List<String>? envScriptArgs = Platform.environment[
unparseKey(internal.CCompilerConfig.envScriptArgsConfigKeyFull)]
final List<String>? envScriptArgs = Platform
.environment[unparseKey('c_compiler.env_script_arguments')]
?.split(' ');

extension on String {
Expand Down

0 comments on commit 019ea6e

Please sign in to comment.