-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8f8ca7
commit 5cb9c17
Showing
4 changed files
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
build/ | ||
Release/ | ||
build64/ | ||
build32/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,62 @@ | ||
# generate and compile exe files | ||
|
||
# 默认是编译 64 位的 dll,如果指定 32 位,则编译 32 位 dll | ||
$currentDirectory = Get-Location | ||
$cmakeListsPath = Join-Path -Path $currentDirectory -ChildPath "CMakeLists.txt" | ||
|
||
if (-not (Test-Path $cmakeListsPath)) | ||
{ | ||
Write-Host("No CMakeLists.txt in current directory, please check.") | ||
return | ||
Write-Host("No CMakeLists.txt in current directory, please check.") | ||
return | ||
} | ||
|
||
Write-Host "Start generating and compiling..." | ||
|
||
$buildFolderPath = ".\build" | ||
|
||
if (-not (Test-Path $buildFolderPath)) | ||
{ | ||
New-Item -ItemType Directory -Path $buildFolderPath | Out-Null | ||
Write-Host "build folder created." | ||
} | ||
|
||
cmake -G "Visual Studio 17 2022" -A Win32 -S . -B ./build/ | ||
$arch = $args[0] | ||
|
||
if ($LASTEXITCODE -eq 0) | ||
if ($arch -eq "32") | ||
{ | ||
$buildFolderPath = ".\build32" | ||
|
||
if (-not (Test-Path $buildFolderPath)) | ||
{ | ||
New-Item -ItemType Directory -Path $buildFolderPath | Out-Null | ||
Write-Host "build32 folder created." | ||
} | ||
cmake -G "Visual Studio 17 2022" -A Win32 -S . -B ./build32/ | ||
|
||
if ($LASTEXITCODE -eq 0) | ||
{ | ||
cmake --build ./build32/ --config DEBUG | ||
} | ||
} elseif ($arch -eq "64") | ||
{ | ||
cmake --build ./build/ --config DEBUG | ||
$buildFolderPath = ".\build64" | ||
|
||
if (-not (Test-Path $buildFolderPath)) | ||
{ | ||
New-Item -ItemType Directory -Path $buildFolderPath | Out-Null | ||
Write-Host "build64 folder created." | ||
} | ||
cmake -G "Visual Studio 17 2022" -A x64 -S . -B ./build64/ | ||
|
||
if ($LASTEXITCODE -eq 0) | ||
{ | ||
cmake --build ./build64/ --config DEBUG | ||
} | ||
} else | ||
{ # 默认是 64 位 | ||
$buildFolderPath = ".\build64" | ||
|
||
if (-not (Test-Path $buildFolderPath)) | ||
{ | ||
New-Item -ItemType Directory -Path $buildFolderPath | Out-Null | ||
Write-Host "build64 folder created." | ||
} | ||
cmake -G "Visual Studio 17 2022" -A x64 -S . -B ./build64/ | ||
|
||
if ($LASTEXITCODE -eq 0) | ||
{ | ||
cmake --build ./build64/ --config DEBUG | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# 在调试的时候,只需要注册 64 位 | ||
sudo regsvr32 "./build64/DEBUG/SampleIME.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sudo regsvr32 /u "./build64/DEBUG/SampleIME.dll" |