* fix cmake linker flags

* update appveyor with disable debug build and add separate archive with pdb for release
This commit is contained in:
HarpyWar 2018-05-08 20:51:28 +03:00
parent 0d1c09e918
commit 4235aa8b3a
2 changed files with 15 additions and 6 deletions

View file

@ -63,7 +63,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
# Explaining of linker flags and why enable pdb with debug info for Release build is on: # Explaining of linker flags and why enable pdb with debug info for Release build is on:
# https://www.wintellect.com/correctly-creating-native-c-release-build-pdbs # https://www.wintellect.com/correctly-creating-native-c-release-build-pdbs
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASEz} /DEBUG /OPT:REF /OPT:ICF")
subdirs(src conf man files) subdirs(src conf man files)

View file

@ -22,7 +22,7 @@ environment:
db_id: 5 db_id: 5
configuration: configuration:
- Debug # - Debug
- Release - Release
matrix: matrix:
@ -39,14 +39,16 @@ install:
- cmd: mkdir c:\builder\source\ - cmd: mkdir c:\builder\source\
- cmd: xcopy /E /R /K /Y /Q "c:\pvpgn" "c:\builder\source\" - cmd: xcopy /E /R /K /Y /Q "c:\pvpgn" "c:\builder\source\"
- cmd: cd c:\builder\ - cmd: cd c:\builder\
- cmd: mkdir bkp - cmd: mkdir bin
- cmd: mkdir pdb
before_build: before_build:
- cmd: set APPVEYOR_REPO_COMMIT_SHORT=%APPVEYOR_REPO_COMMIT:~0,7% - cmd: set APPVEYOR_REPO_COMMIT_SHORT=%APPVEYOR_REPO_COMMIT:~0,7%
# read version string from version.h to %PVPGN_VERSION% and append commit string inside that file # read version string from version.h to %PVPGN_VERSION% and append commit string inside that file
- cmd: module\tools\pvpgn_version.bat %APPVEYOR_REPO_COMMIT_SHORT% - cmd: module\tools\pvpgn_version.bat %APPVEYOR_REPO_COMMIT_SHORT%
- cmd: set COMPLETE_BUILD_VERSION=pvpgn-%APPVEYOR_REPO_BRANCH%-%PVPGN_VERSION%-%APPVEYOR_REPO_COMMIT_SHORT% - cmd: set COMPLETE_BUILD_VERSION=pvpgn-%APPVEYOR_REPO_BRANCH%-%PVPGN_VERSION%-%APPVEYOR_REPO_COMMIT_SHORT%
- ps: $env:PVPGN_ZIP=$env:COMPLETE_BUILD_VERSION + "_" + $env:DB + $(If ($env:CONFIGURATION -eq "Debug") {"_debug"} Else {""}) + ".zip" - ps: $env:PVPGN_ZIP=$env:COMPLETE_BUILD_VERSION + "_" + $env:DB + $(If ($env:CONFIGURATION -eq "Release") {"_" + ($env:CONFIGURATION).ToLower()} Else {""}) + ".zip"
- ps: $env:PVPGN_PDB_ZIP=$env:COMPLETE_BUILD_VERSION + "_" + $env:DB + $(If ($env:CONFIGURATION -ne "Release") {"_" + ($env:CONFIGURATION).ToLower()} Else {".pdb"}) + ".zip"
build_script: build_script:
@ -59,15 +61,22 @@ build_script:
# 5. with or without lua # 5. with or without lua
# 6. Release or Debug # 6. Release or Debug
# gui
- cmd: build_pvpgn.bat auto auto 2 %DB_ID% y %CONFIGURATION% - cmd: build_pvpgn.bat auto auto 2 %DB_ID% y %CONFIGURATION%
- cmd: copy /Y %CONFIGURATION%\* bkp\* # backup gui exe/pdb files - cmd: move /Y %CONFIGURATION%\*.pdb pdb\ # move pdb files
- cmd: copy /Y %CONFIGURATION%\* bin\ # backup binary files
# console
- cmd: build_pvpgn.bat auto auto 1 %DB_ID% y %CONFIGURATION% - cmd: build_pvpgn.bat auto auto 1 %DB_ID% y %CONFIGURATION%
- cmd: move /Y bkp\* %CONFIGURATION% # move back after build console versions - cmd: move /Y %CONFIGURATION%\*.pdb pdb\ # move pdb files
- cmd: move /Y bin\* %CONFIGURATION% # move back binaries after build console version
# create zip artifacts
- cmd: 7z.exe a %PVPGN_ZIP% .\%CONFIGURATION%\* - cmd: 7z.exe a %PVPGN_ZIP% .\%CONFIGURATION%\*
- cmd: 7z.exe a %PVPGN_PDB_ZIP% .\pdb\*
deploy_script: deploy_script:
- ps: | - ps: |
Push-AppveyorArtifact $env:PVPGN_ZIP Push-AppveyorArtifact $env:PVPGN_ZIP
Push-AppveyorArtifact $env:PVPGN_PDB_ZIP
# check the latest build executable for exists # check the latest build executable for exists
test: test: