mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Allow building with race detector
This commit is contained in:
		
							parent
							
								
									f3e742a297
								
							
						
					
					
						commit
						319366513c
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		
							
								
								
									
										7
									
								
								build
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								build
									
										
									
									
									
								
							| 
						 | 
					@ -8,7 +8,7 @@ PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
 | 
					LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts "udaitc:l:" option
 | 
					while getopts "udaitc:l:r" option
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
  case "${option}"
 | 
					  case "${option}"
 | 
				
			||||||
  in
 | 
					  in
 | 
				
			||||||
| 
						 | 
					@ -19,6 +19,7 @@ do
 | 
				
			||||||
  t) TABLES=true;;
 | 
					  t) TABLES=true;;
 | 
				
			||||||
  c) GCFLAGS="$GCFLAGS $OPTARG";;
 | 
					  c) GCFLAGS="$GCFLAGS $OPTARG";;
 | 
				
			||||||
  l) LDFLAGS="$LDFLAGS $OPTARG";;
 | 
					  l) LDFLAGS="$LDFLAGS $OPTARG";;
 | 
				
			||||||
 | 
					  r) RACE="-race";;
 | 
				
			||||||
  esac
 | 
					  esac
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,9 +44,9 @@ else
 | 
				
			||||||
    echo "Building: $CMD"
 | 
					    echo "Building: $CMD"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [ $DEBUG ]; then
 | 
					    if [ $DEBUG ]; then
 | 
				
			||||||
      go build -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" -tags debug -v ./cmd/$CMD
 | 
					      go build $RACE -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" -tags debug -v ./cmd/$CMD
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      go build -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" -v ./cmd/$CMD
 | 
					      go build $RACE -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" -v ./cmd/$CMD
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    if [ $UPX ]; then
 | 
					    if [ $UPX ]; then
 | 
				
			||||||
      upx --brute $CMD
 | 
					      upx --brute $CMD
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue