File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ int  boot_compilet () { return  1 ; }
Original file line number Diff line number Diff line change @@ -66,12 +66,19 @@ sub _mirror
6666        my  $target  = readlink  " $src "  ;
6767        Alien::Build-> log (" ln -s $target  $dst "  ) if  $opt -> {verbose };
6868        if  (path($target )-> is_relative) {
69+           my  $nativesymlink  =
70+                    (($^O eq  " msys"   && defined  $ENV {MSYS } && $ENV {MSYS } eq  " winsymlinks:nativestrict"  )
71+                 || ($^O eq  " cygwin"   && defined  $ENV {CYGWIN } && $ENV {CYGWIN } eq  " winsymlinks:nativestrict"  ));
6972          if  (!$src -> parent-> child($target )-> exists ) {
70-             die  " cannot create symlink to nonexistent file $target  on MSYS2"  ;
73+             if  ($nativesymlink ) {
74+               #  NOTE: On linux, it is OK to create broken symlinks, but it is not allowed on 
75+               #    windows MSYS2/Cygwin when nativestrict is used.
76+               die  " cannot create native symlink to nonexistent file $target  on $^O"  ;
77+             }
78+           }
79+           if  ($nativesymlink ) {
80+             $dst -> parent-> child($target )-> touchpath;
7181          }
72-            #  NOTE: On linux, it is OK to create broken symlinks, but it is not allowed on 
73-            #    windows MSYS2, so make sure the target exists.
74-           $dst -> parent-> child($target )-> touchpath;
7582        }
7683        my  $curdir  = Path::Tiny-> cwd;
7784        #  CD into the directory, such that symlink will work on MSYS2
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments