티스토리 뷰
728x90
    
    
  반응형
    
    
    
  BuildScript\Curl .ps1 -vsVersion 2022 -buildType Debug -arch x64 
BuildScript\Curl .ps1 -vsVersion 2022 -buildType MinSizeRel -arch Win32 
BuildScript\Curl .ps1 -vsVersion 2022 -buildType MinSizeRel -arch x64 
BuildScript\Curl.ps1 -vsVersion 2022 -buildType MinSizeRel -arch Win32
param(
    [string]$vsVersion,
    [string]$buildType = "Release",
    [string]$arch = "x64"
)
# Confirm input
$validVsVersions = @("2015", "2017", "2019", "2022")
$validBuildTypes = @("Debug", "Release", "Release-MD", "MinSizeRel")
$validArchs = @("x64", "Win32")
if ($vsVersion -notin $validVsVersions -or $buildType -notin $validBuildTypes -or $arch -notin $validArchs) {
    Write-Host "Invalid input. Please enter the correct Visual Studio version, build type, and architecture."
    exit
}
# Setup paths
$sourcePath = "G:\ThirdParty\Source\curl"
$buildDir = "install\build_${vsVersion}_${buildType}_${arch}"
$buildPath = Join-Path $sourcePath "build"
$installPath = Join-Path $sourcePath $buildDir
Write-Host "====================================================================" -ForegroundColor Cyan
Write-Host "=== You have selected the following configuration:"
Write-Host "=== [opensslPath] $opensslPath"
Write-Host "=== [sourcePath] $sourcePath"
Write-Host "=== [buildDir] $buildDir"
Write-Host "=== [buildPath] $buildPath"
Write-Host "=== [installPath] $installPath"
Write-Host "====================================================================" -ForegroundColor Cyan
# Create build and install directories
New-Item -Path $buildPath -ItemType Directory -Force
New-Item -Path $installPath -ItemType Directory -Force
# Change to build directory
Set-Location -Path $buildPath
# Visual Studio generator 설정
if ($vsVersion -eq "2022") {
    $generator = "`"Visual Studio 17 2022`""
} elseif ($vsVersion -eq "2019") {
    $generator = "`"Visual Studio 16 2019`""
} elseif ($vsVersion -eq "2017") {
    $generator = "`"Visual Studio 15 2017`""
} else {
    $generator = "`"Visual Studio 14 2015`""
}
$archType
# 아키텍처에 따른 추가 설정
if ($arch -eq "x64") {
    $archType = "x64"
} else {
    $archType = "Win32"
}
if( $validBuildTypes -eq "Debug" ){
$cmakeArgs = @(
    "-G",$generator,"-A", $arch,"..",
"-DCMAKE_BUILD_TYPE=$buildType",
    "-DCMAKE_INSTALL_PREFIX=$installPath"
"-DBUILD_SHARED_LIBS=OFF"
)
}elseif($validBuildTypes -eq "Release"){
$cmakeArgs = @(
    "-G",$generator,"-A", $arch, "..",
"-DCMAKE_BUILD_TYPE=$buildType",
    "-DCMAKE_INSTALL_PREFIX=$installPath"
"-DBUILD_SHARED_LIBS=OFF"
)
}else{
$cmakeArgs = @(
    "-G",$generator,"-A", $arch,"..",
"-DCMAKE_BUILD_TYPE=$buildType",
    "-DCMAKE_INSTALL_PREFIX=$installPath")
}
# 사용자에게 현재 설정을 보여주고 확인 받음
Write-Host "====================================================================" -ForegroundColor Cyan
Write-Host "=== You have selected the following configuration:"
Write-Host "=== INFORMATION" -ForegroundColor Yellow
Write-Host "=== [VS Version]: $vsVersion" -ForegroundColor Green
Write-Host "=== [BUILD Type]: $buildType" -ForegroundColor Green
Write-Host "=== [ARCH]: $arch" -ForegroundColor Green
Write-Host "=== [Source Path]: $sourcePath" -ForegroundColor Green
Write-Host "=== [cmakeArgs]: $cmakeArgs" -ForegroundColor Green
Write-Host "====================================================================" -ForegroundColor Cyan
$response = Read-Host "Is this information correct? (y/n)"
if ($response -ne 'y') {
    Write-Host "Configuration aborted by user." -ForegroundColor Red
    exit
}
# Run CMake to configure
& cmake $cmakeArgs
# Build and install
& cmake --build . --config $buildType
& cmake --build . --target install --config $buildType
# Return to original path
Set-Location -Path $sourcePath
# Cleanup: Remove build directory
Remove-Item -Path $buildPath -Recurse -Force
Write-Host "Build and installation completed and cleaned up for Visual Studio $vsVersion, $buildType, $arch, installed at $installPath" -ForegroundColor Green
MT/ MD 빌드 변경시 확인 해야 될 사항
* 생성된 솔루션 파일을 직접 열어 아래와 같이 수정해야 합니다. 
* libcurl_static 는 libcurl_object를 링크해서 사용합니다.
* libcurl_object의 프로젝트 속성의 MT/MD 값을 변경하여 빌드 진행하시면 됩니다. 

728x90
    
    
  
					댓글
						
					
					
					
				
			반응형
    
    
    
  
										공지사항
										
								
							
							
							
								최근에 올라온 글
								
							
							
								
									최근에 달린 댓글
									
							
							
								- Total
 
- Today
 
- Yesterday
 
									링크
									
							
							
								
									TAG
									
							
							
							- Thread
 - 패턴
 - C++
 - PowerShell
 - Build
 - 현포다이브
 - 울릉도
 - Windows
 - OpenSource
 - 서귀포
 - Linux
 - ip
 - 스쿠버다이빙
 - 제주도
 - ReFS
 - 윈도우
 - C#
 - 양파다이브
 - 성산블루버블
 - 디자인패턴
 - C
 - RSA
 - 암호화
 - 블루버블
 - 서귀포블루버블
 - 블루버블다이브팀
 - 리눅스
 - 블루버블다이빙팀
 - DLL
 - 다이빙
 
| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
									글 보관함
									
							
					