build: switch to msvc as default release builder
build: add separate extra dll from msvc with support for windows xp
This commit is contained in:
parent
aef3ff0b36
commit
52bfac2b09
5 changed files with 36 additions and 16 deletions
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ['linux-x86', 'linux-amd64', 'linux-x86-gcc', 'linux-aarch64', 'darwin-x86', 'windows-x86', 'windows-amd64', 'windows-x86-gcc']
|
||||
arch: ['linux-x86', 'linux-amd64', 'linux-x86-gcc', 'linux-aarch64', 'darwin-x86', 'windows-x86-clang', 'windows-amd64', 'windows-x86-gcc']
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
|
|
@ -58,7 +58,11 @@ jobs:
|
|||
env:
|
||||
name: windows-x86-msvc
|
||||
|
||||
name: bot-build (windows-x86-msvc)
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ['windows-x86', 'windows-x86-msvc-xp']
|
||||
fail-fast: false
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
|
|
@ -75,18 +79,24 @@ jobs:
|
|||
run: |
|
||||
python -m pip install --upgrade meson ninja
|
||||
- name: Configure meson
|
||||
shell: pwsh
|
||||
run: |
|
||||
meson setup ${{env.name}}
|
||||
if ('${{matrix.arch}}' -eq 'windows-x86-msvc-xp') {
|
||||
meson setup ${{matrix.arch}} -Dwinxp=true
|
||||
}
|
||||
else {
|
||||
meson setup ${{matrix.arch}}
|
||||
}
|
||||
- name: Build sources
|
||||
run: |
|
||||
meson compile -C ${{env.name}}
|
||||
meson compile -C ${{matrix.arch}}
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{env.name}}
|
||||
name: ${{matrix.arch}}
|
||||
path: |
|
||||
${{env.name}}/yapb.dll
|
||||
${{env.name}}/yapb.pdb
|
||||
${{matrix.arch}}/yapb.dll
|
||||
${{matrix.arch}}/yapb.pdb
|
||||
|
||||
bot-release:
|
||||
if: |
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 99c8383ae2fccd6b0263bef92a154e571a0de12d
|
||||
Subproject commit 71bcf0e921611f591b2a2f9c68368f2dd158279e
|
||||
18
meson.build
18
meson.build
|
|
@ -40,6 +40,7 @@ build_type = get_option ('buildtype')
|
|||
|
||||
opt_64bit = get_option('64bit')
|
||||
opt_native = get_option('native')
|
||||
opt_winxp = get_option('winxp')
|
||||
|
||||
# cpp and ldflags from scratch
|
||||
cxxflags = []
|
||||
|
|
@ -201,19 +202,24 @@ if cxx == 'clang' or cxx == 'gcc'
|
|||
]
|
||||
endif
|
||||
elif os == 'windows' and (cxx =='msvc' or cxx == 'clang-cl')
|
||||
|
||||
# define for building on winxp on msvc
|
||||
if opt_winxp
|
||||
cxxflags += [
|
||||
'/TP', '/DCR_HAS_WINXP_SUPPORT', '/D_WIN32_WINNT=0x0501', '/D_USING_V110_SDK71_'
|
||||
]
|
||||
ldflags += ['/SUBSYSTEM:WINDOWS,5.01']
|
||||
endif
|
||||
|
||||
if not opt_64bit and cxx == 'clang'
|
||||
cxxflags += '/MACHINE:X86'
|
||||
ldflags += '/MACHINE:X86'
|
||||
endif
|
||||
|
||||
cxxflags += [
|
||||
'/TP', '/D _WIN32_WINNT=0x0501', '/D _USING_V110_SDK71_', '/Zc:threadSafeInit-'
|
||||
]
|
||||
|
||||
# minor optimizations for release build
|
||||
if build_type == 'release'
|
||||
cxxflags += [
|
||||
'/GS-', '/Ob2', '/Oy', '/Oi', '/Ot', '/fp:precise', '/GF', '/GS-', '/GF', '/arch:SSE2', '/Zi'
|
||||
'/Zc:threadSafeInit-', '/GS-', '/Ob2', '/Oy', '/Oi', '/Ot', '/fp:precise', '/GF', '/Gw', '/arch:SSE2', '/Zi', '/guard:ehcont-', '/guard:cf-'
|
||||
]
|
||||
|
||||
# add wpo if msvc
|
||||
|
|
@ -225,7 +231,7 @@ elif os == 'windows' and (cxx =='msvc' or cxx == 'clang-cl')
|
|||
|
||||
# add linker flags
|
||||
ldflags += [
|
||||
'/LTCG', 'delayimp.lib', '/DELAYLOAD:user32.dll', '/DELAYLOAD:ws2_32.dll', '/SUBSYSTEM:WINDOWS,5.01',
|
||||
'/OPT:REF,ICF', '/GUARD:NO ', '/LTCG', 'delayimp.lib', '/DELAYLOAD:user32.dll', '/DELAYLOAD:ws2_32.dll',
|
||||
]
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -10,3 +10,6 @@ option('64bit', type : 'boolean', value : false,
|
|||
|
||||
option('native', type : 'boolean', value : false,
|
||||
description: 'Configure compiler for a native machine build.')
|
||||
|
||||
option('winxp', type : 'boolean', value : false,
|
||||
description: 'Configure MSVC build to output Windows XP compatible binary.')
|
||||
|
|
|
|||
|
|
@ -137,8 +137,9 @@ class BotRelease(object):
|
|||
'linux-amd64': 'so',
|
||||
'linux-x86-gcc': 'so',
|
||||
'windows-x86-gcc': 'dll',
|
||||
'windows-x86-clang': 'dll',
|
||||
'windows-x86-msvc-xp': 'dll',
|
||||
'windows-amd64': 'dll',
|
||||
'windows-x86-msvc': 'dll',
|
||||
'darwin-x86': 'dylib',
|
||||
}, extra=True))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue