Skip to content

Commit

Permalink
Enable PGO
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Jun 23, 2017
1 parent 059f978 commit c3f8020
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
59 changes: 31 additions & 28 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ version: '{branch}-{build}'
skip_tags: true

# manual mode
#branches:
# except:
# - /.*/
branches:
except:
- /.*/


#---------------------------------#
Expand Down Expand Up @@ -55,42 +55,45 @@ clone_folder: *REPO_DIR
# scripts to run before build
before_build:
# git submodules
- 'cd "%REPO_DIR%"'
- 'git submodule update --init --remote --recursive'
- cd "%REPO_DIR%"
- git submodule update --init --remote --recursive

# prepare ogg
- 'cd "%REPO_DIR%"'
- 'if exist "lib\libogg\win32\VS2015" (rd /S /Q "lib\libogg\win32\VS2015")'
- 'move /Y "src\ogg\VS2015" "lib\libogg\win32"'
- 'msbuild "lib\libogg\win32\VS2015\%OGG_SOL_FILE%" %OGG_MSBUILD_CMD_X86%'
- 'msbuild "lib\libogg\win32\VS2015\%OGG_SOL_FILE%" %OGG_MSBUILD_CMD_X64%'
- cd "%REPO_DIR%"
- if exist "lib\libogg\win32\VS2015" (rd /S /Q "lib\libogg\win32\VS2015")
- move /Y "src\ogg\VS2015" "lib\libogg\win32"
- msbuild "lib\libogg\win32\VS2015\%OGG_SOL_FILE%" %OGG_MSBUILD_CMD_X86%
- msbuild "lib\libogg\win32\VS2015\%OGG_SOL_FILE%" %OGG_MSBUILD_CMD_X64%

# prepare opus
- 'cd "%REPO_DIR%\lib\opus"'
- 'git checkout tags/%OPUS_GIT_TAG%'
- 'cd "%REPO_DIR%"'
- 'if exist "lib\opus\win32" (rd /S /Q "lib\opus\win32\VS2015")'
- 'move /Y "src\opus\VS2015" "lib\opus\win32"'
- 'msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X86%'
- 'msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X64%'
- cd "%REPO_DIR%\lib\opus"
- git checkout tags/%OPUS_GIT_TAG%
- cd "%REPO_DIR%"
- if exist "lib\opus\win32" (rd /S /Q "lib\opus\win32\VS2015")
- move /Y "src\opus\VS2015" "lib\opus\win32"
- msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X86%
- msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X64%

# to run your custom scripts instead of automatic MSBuild
build_script:
- 'cd "%REPO_DIR%"'
- 'if exist "lib\opus-tools\win32\VS2015" (rd /S /Q "lib\opus-tools\win32\VS2015")'
- 'move /Y "src\opus-tools\VS2015" "lib\opus-tools\win32\VS2015"'
- 'msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X86%'
- 'msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X64%'
- cd "%REPO_DIR%"
- if exist "lib\opus-tools\win32\VS2015" (rd /S /Q "lib\opus-tools\win32\VS2015")
- move /Y "src\opus-tools\VS2015" "lib\opus-tools\win32\VS2015"
- msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X86%

- mkdir "lib\opus-tools\win32\VS2015\x64\Release"
- copy "src\opus-tools\opusenc.pgd" "lib\opus-tools\win32\VS2015\x64\Release\"
- msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X64%

# scripts to run before deployment
after_build:
# prepare for artifacts packaging
- 'cd "%REPO_DIR%"'
- 'mkdir "opus-tools\win32" "opus-tools\x64"'
- 'copy "Readme.md" "opus-tools"'
- 'copy "lib\opus-tools\win32\VS2015\Win32\Release\opus*.exe" "opus-tools\win32"'
- 'copy "lib\opus-tools\win32\VS2015\x64\Release\opus*.exe" "opus-tools\x64"'
- '7z a -sfx7z.sfx -mx9 "opus-tools.exe" "opus-tools"' # the artifact must reside at the source repo root
- cd "%REPO_DIR%"
- mkdir "opus-tools\win32" "opus-tools\x64"
- copy "Readme.md" "opus-tools"
- copy "lib\opus-tools\win32\VS2015\Win32\Release\opus*.exe" "opus-tools\win32"
- copy "lib\opus-tools\win32\VS2015\x64\Release\opus*.exe" "opus-tools\x64"
- 7z a -sfx7z.sfx -mx9 "opus-tools.exe" "opus-tools" # the artifact must reside at the source repo root
- 'powershell -Command "& { $hash = (Get-FileHash -Algorithm SHA1 "opus-tools.exe").hash.ToString().toLower(); Write-Host $hash " *opus-tools.exe"; }" > "opus-tools.exe.sha1"'


Expand Down
3 changes: 3 additions & 0 deletions src/opus-tools/VS2015/opusenc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
<ClCompile>
<AdditionalOptions>/Gw %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<LinkTimeCodeGeneration>PGOptimization</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
Expand Down
Binary file added src/opus-tools/opusenc.pgd
Binary file not shown.

0 comments on commit c3f8020

Please sign in to comment.