summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2022-09-21 12:26:02 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-30 04:34:53 +0000
commit988b3f41decf4954432b9c10b0dd7cf227ca53dc (patch)
tree94dfa48791452e76270b5f62665ad4d441dad00b /SConstruct
parent59ee2c548e05fdbf143ed061d4381064007f5bcd (diff)
downloadmongo-988b3f41decf4954432b9c10b0dd7cf227ca53dc.tar.gz
SERVER-69133 remove redundant setting of hardlink install action.
(cherry picked from commit c1adfd31dfb0780155e7da768dbbd3e1cc4b9705)
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct21
1 files changed, 12 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index 718215b289c..450a309c6f5 100755
--- a/SConstruct
+++ b/SConstruct
@@ -4597,11 +4597,20 @@ if get_option('ninja') != 'disabled':
return dependencies
env['NINJA_REGENERATE_DEPS'] = ninja_generate_deps
+
+ if env.TargetOSIs('windows'):
+ # The /b option here will make sure that windows updates the mtime
+ # when copying the file. This allows to not need to use restat for windows
+ # copy commands.
+ copy_install_cmd = "cmd.exe /c copy /b $in $out 1>NUL"
+ else:
+ copy_install_cmd = "install $in $out"
+
if env.GetOption('install-action') == 'hardlink':
if env.TargetOSIs('windows'):
- install_cmd = "cmd.exe /c mklink /h $out $in 1>nul"
+ install_cmd = f"cmd.exe /c mklink /h $out $in 1>nul || {copy_install_cmd}"
else:
- install_cmd = "ln $in $out"
+ install_cmd = f"ln $in $out || {copy_install_cmd}"
elif env.GetOption('install-action') == 'symlink':
@@ -4633,13 +4642,7 @@ if get_option('ninja') != 'disabled':
install_cmd = "ln -s $relpath $out"
else:
- if env.TargetOSIs('windows'):
- # The /b option here will make sure that windows updates the mtime
- # when copying the file. This allows to not need to use restat for windows
- # copy commands.
- install_cmd = "cmd.exe /c copy /b $in $out 1>NUL"
- else:
- install_cmd = "install $in $out"
+ install_cmd = copy_install_cmd
env.NinjaRule("INSTALL", install_cmd, description="Installed $out", pool="install_pool")