diff --git a/sdk_args.gni b/sdk_args.gni index 4b2a1e4ea63..0d6bc7a569d 100644 --- a/sdk_args.gni +++ b/sdk_args.gni @@ -19,12 +19,7 @@ declare_args() { # to out/ReleaseX64/args.gn. The path above can be extracted from the `.git` # file under the git worktree folder. # The script run here should take care of everything automatically though. - default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py", - [ - rebase_path("$_dart_root/.git"), - "$_dart_root/.git", - ], - "trim string") + default_git_folder = "" # Whether to enable the SDK hash check that will prevent loading a kernel # into a VM which was built with a different SDK. @@ -34,6 +29,15 @@ declare_args() { dart_sdk_output = "dart-sdk" } +if (default_git_folder == "") { + default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py", + [ + rebase_path("$_dart_root/.git"), + "$_dart_root/.git", + ], + "trim string") +} + # The SDK hash to build into VM and kernels. # The value 0000000000 signifies no hash is set, which will disable the check. if (verify_sdk_hash) {