diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c607f85..2fe04ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | diff --git a/ext/crlib b/ext/crlib index 99c8383..71bcf0e 160000 --- a/ext/crlib +++ b/ext/crlib @@ -1 +1 @@ -Subproject commit 99c8383ae2fccd6b0263bef92a154e571a0de12d +Subproject commit 71bcf0e921611f591b2a2f9c68368f2dd158279e diff --git a/meson.build b/meson.build index b10861a..7bf37de 100644 --- a/meson.build +++ b/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 diff --git a/meson_options.txt b/meson_options.txt index eaa20a1..83ef85f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,4 +9,7 @@ option('64bit', type : 'boolean', value : false, description: 'Enables bot build with as 64-bit binary.') option('native', type : 'boolean', value : false, - description: 'Configure compiler for a native machine build.') \ No newline at end of file + description: 'Configure compiler for a native machine build.') + +option('winxp', type : 'boolean', value : false, + description: 'Configure MSVC build to output Windows XP compatible binary.') diff --git a/package.py b/package.py index 68b4b81..2cf08da 100644 --- a/package.py +++ b/package.py @@ -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))