Skip to content

Commit

Permalink
Remove old Windows 7 support code (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Aug 28, 2023
1 parent 9b453cf commit de6ca88
Show file tree
Hide file tree
Showing 65 changed files with 17 additions and 4,898 deletions.
296 changes: 1 addition & 295 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
compiler: [MSVC, clang-cl]
arch: [x86, x64, arm64]
config: [Debug, Release]
test_exe: [test, test_cpp20, test_cpp20_no_sourcelocation, test_win7, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
test_exe: [test, test_cpp20, test_cpp20_no_sourcelocation, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
exclude:
- arch: arm64
config: Debug
Expand Down Expand Up @@ -250,120 +250,6 @@ jobs:
_build/${{ matrix.arch }}/${{ matrix.config }}/*.lib
_build/${{ matrix.arch }}/${{ matrix.config }}/*.pdb
test-llvm-mingw-cppwinrt:
name: 'llvm-mingw: Build and test'
strategy:
fail-fast: false
matrix:
arch: [i686, x86_64]
config: [Debug, Release]
runs-on: windows-latest
env:
CMAKE_COLOR_DIAGNOSTICS: 1
CLICOLOR_FORCE: 1
steps:
- uses: actions/checkout@v3

- id: setup-llvm
name: Set up llvm-mingw
uses: ./.github/actions/setup-llvm-mingw
with:
host-arch: ${{ matrix.arch }}

- name: Build cppwinrt
run: |
mkdir build
cd build
if ("${{ matrix.config }}" -eq "Debug") {
$sanitizers = "TRUE"
} else {
$sanitizers = "FALSE"
}
cmake ../ -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.config }} `
-DDOWNLOAD_WINDOWSNUMERICS=TRUE `
-DUSE_ANSI_COLOR=TRUE `
-DCMAKE_CXX_FLAGS="-fansi-escape-codes" `
-DENABLE_TEST_SANITIZERS=$sanitizers
cmake --build . -j2 --target cppwinrt
- name: Upload cppwinrt.exe
uses: actions/upload-artifact@v3
with:
name: llvm-mingw-build-${{ matrix.arch }}-bin
path: build/cppwinrt.exe

- name: Build tests
run: |
cd build
cmake --build . -j2 --target test-vanilla test_cpp20 test_cpp20_no_sourcelocation test_win7 test_old
- name: Upload test binaries
uses: actions/upload-artifact@v3
with:
name: llvm-mingw-tests-${{ matrix.arch }}-bin
path: build/test/*.exe

- name: Run tests
run: |
cd build
$env:UBSAN_OPTIONS = "print_stacktrace=1"
ctest --verbose
test-msys2-gcc-cppwinrt:
name: 'gcc/msys2: Build and test (${{ matrix.sys }}, ${{ matrix.config }})'
strategy:
fail-fast: false
matrix:
include:
# 32-bit builds are running out of memory
# - { sys: mingw32, arch: i686, config: Release }
- { sys: mingw64, arch: x86_64, config: Debug }
- { sys: mingw64, arch: x86_64, config: Release }
- { sys: ucrt64, arch: x86_64, config: Release }
runs-on: windows-latest
env:
CMAKE_COLOR_DIAGNOSTICS: 1
CLICOLOR_FORCE: 1
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
pacboy: >-
crt:p
gcc:p
binutils:p
cmake:p
ninja:p
- uses: actions/checkout@v3

- name: Build cppwinrt
run: |
mkdir build
cd build
if [[ "${{ matrix.arch }}" = "i686" ]]; then
skip_large_pch_arg="-DSKIP_LARGE_PCH=TRUE"
fi
cmake ../ -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DDOWNLOAD_WINDOWSNUMERICS=TRUE \
-DUSE_ANSI_COLOR=TRUE \
$skip_large_pch_arg
cmake --build . --target cppwinrt
- name: Build tests
run: |
cd build
cmake --build . -j2 --target test-vanilla test_cpp20 test_cpp20_no_sourcelocation test_win7 test_old
- name: Run tests
run: |
cd build
ctest --verbose
build-linux-cross-cppwinrt:
name: 'cross: Cross-build from Linux'
strategy:
Expand Down Expand Up @@ -398,186 +284,6 @@ jobs:
name: cross-build-${{ matrix.arch }}-bin
path: install/bin/cppwinrt.exe

test-linux-cross-cppwinrt:
name: 'cross: Test run on Windows'
needs: build-linux-cross-cppwinrt
strategy:
fail-fast: false
matrix:
arch: [i686, x86_64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Fetch cppwinrt executable
uses: actions/download-artifact@v3
with:
name: cross-build-${{ matrix.arch }}-bin
path: ./.test

- name: Run cppwinrt to build projection
run: |
.\.test\cppwinrt.exe -in local -out .\.test\out -verbose
- id: setup-llvm
name: Set up llvm-mingw
uses: ./.github/actions/setup-llvm-mingw
with:
host-arch: ${{ matrix.arch }}

- name: Build cppwinrt tests
run: |
mkdir build
cd build
cmake ../test -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug `
-DCPPWINRT_PROJECTION_INCLUDE_DIR="../.test/out" `
-DDOWNLOAD_WINDOWSNUMERICS=TRUE `
-DUSE_ANSI_COLOR=TRUE
cmake --build . -j2
- name: Run tests
run: |
cd build
ctest --verbose
build-linux-native-cppwinrt:
name: 'linux: GCC native build + mingw-w64 cross-build tests'
strategy:
fail-fast: false
matrix:
# TODO: Enable gcc build once Arch Linux gets more recent mingw-w64 headers (ver. 11 perhaps?)
# cross_toolchain: [gcc, llvm-mingw]
cross_toolchain: [llvm-mingw]
cross_arch: [i686, x86_64]
# include:
# - cross_toolchain: gcc
# container:
# image: archlinux:base-devel
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
defaults:
run:
shell: bash
env:
CMAKE_COLOR_DIAGNOSTICS: 1
CLICOLOR_FORCE: 1
steps:
- uses: actions/checkout@v3

- name: Install build tools
if: matrix.cross_toolchain == 'gcc'
run: |
pacman --noconfirm -Suuy
pacman --needed --noconfirm -S cmake ninja git
- name: Build cppwinrt
run: |
cmake -S . -B build/native/ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$PWD/install/
cmake --build build/native/ --target install -j2
- name: Test run (cppwinrt -?)
run: |
install/bin/cppwinrt -?
- name: Test run (build projection using Windows.winmd)
run: |
curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd
install/bin/cppwinrt -in Windows.winmd -out /tmp/cppwinrt -verbose
- id: setup-llvm
name: Set up llvm-mingw
if: matrix.cross_toolchain == 'llvm-mingw'
uses: ./.github/actions/setup-llvm-mingw

- name: Install GCC cross compiler
if: matrix.cross_toolchain == 'gcc'
run: |
pacman --needed --noconfirm -S mingw-w64-gcc
- name: Cross-build tests using projection
run: |
cmake -S test -B build/cross-tests --toolchain "$PWD/cross-mingw-toolchain.cmake" \
-DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cross_arch }} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-static" \
-DCPPWINRT_PROJECTION_INCLUDE_DIR=/tmp/cppwinrt \
-DDOWNLOAD_WINDOWSNUMERICS=TRUE \
-DUSE_ANSI_COLOR=TRUE
cmake --build build/cross-tests -j2
- name: Upload built tests
uses: actions/upload-artifact@v3
with:
name: linux-native-cppwinrt-cross-build-tests-${{ matrix.cross_toolchain }}-${{ matrix.cross_arch }}-bin
path: build/cross-tests/*.exe

test-linux-native-cppwinrt-cross-tests:
name: 'linux: Run llvm-mingw cross-build tests'
needs: build-linux-native-cppwinrt
strategy:
fail-fast: false
matrix:
# TODO: Enable gcc build test when it is buildable
# cross_toolchain: [gcc, llvm-mingw]
cross_toolchain: [llvm-mingw]
cross_arch: [i686, x86_64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Fetch test executables
uses: actions/download-artifact@v3
with:
name: linux-native-cppwinrt-cross-build-tests-${{ matrix.cross_toolchain }}-${{ matrix.cross_arch }}-bin
path: ./

- name: Run tests
run: |
$test_exes = ls *.exe -Name
$has_failed_tests = 0
foreach ($test_exe in $test_exes) {
echo "::group::Run '$test_exe'"
& .\$test_exe --use-colour yes
echo "::endgroup::"
if ($LastExitCode -ne 0) {
echo "::error::Test '$test_exe' failed!"
$has_failed_tests = 1
}
}
if ($has_failed_tests -ne 0) {
exit 1
}
build-macos-native-cppwinrt:
name: 'macOS: GCC native build'
runs-on: macos-latest
defaults:
run:
shell: bash
env:
CMAKE_COLOR_DIAGNOSTICS: 1
CLICOLOR_FORCE: 1
steps:
- uses: actions/checkout@v3

- name: Build cppwinrt
run: |
cmake -S . -B build/native/ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$PWD/install/
cmake --build build/native/ --target install -j2
- name: Test run (cppwinrt -?)
run: |
install/bin/cppwinrt -?
- name: Test run (build projection using Windows.winmd)
run: |
curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd
install/bin/cppwinrt -in Windows.winmd -out build/out -verbose
build-msvc-natvis:
name: 'Build natvis'
strategy:
Expand Down
4 changes: 0 additions & 4 deletions .pipelines/jobs/OneBranchTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
TestExe: 'test_cpp20_no_sourcelocation'
TestProject: 'test_cpp20_no_sourcelocation'
BuildPlatform: 'x86'
test_win7.x86:
TestExe: 'test_win7'
TestProject: 'test_win7'
BuildPlatform: 'x86'
test_fast.x86:
TestExe: 'test_fast'
TestProject: 'test_fast'
Expand Down
1 change: 0 additions & 1 deletion build_test_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%,
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_cpp20
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_cpp20_no_sourcelocation
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_win7
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_fast
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_slow
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_module_lock_custom
Expand Down
24 changes: 0 additions & 24 deletions cppwinrt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_module_lock_custom", "
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3C7EA5F8-6E8C-4376-B499-2CAF596384B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_win7", "test\test_win7\test_win7.vcxproj", "{2EF696B9-7F4A-410F-AE5C-5301565C0F08}"
ProjectSection(ProjectDependencies) = postProject
{A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270}
{D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4}
{F1C915B3-2C64-4992-AFB7-7F035B1A7607} = {F1C915B3-2C64-4992-AFB7-7F035B1A7607}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_cpp20", "test\test_cpp20\test_cpp20.vcxproj", "{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA}"
ProjectSection(ProjectDependencies) = postProject
{A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270}
Expand Down Expand Up @@ -452,22 +445,6 @@ Global
{08C40663-B6A3-481E-8755-AE32BAD99501}.Release|x64.Build.0 = Release|x64
{08C40663-B6A3-481E-8755-AE32BAD99501}.Release|x86.ActiveCfg = Release|Win32
{08C40663-B6A3-481E-8755-AE32BAD99501}.Release|x86.Build.0 = Release|Win32
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|ARM.ActiveCfg = Debug|ARM
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|ARM.Build.0 = Debug|ARM
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|ARM64.ActiveCfg = Debug|ARM64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|ARM64.Build.0 = Debug|ARM64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|x64.ActiveCfg = Debug|x64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|x64.Build.0 = Debug|x64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|x86.ActiveCfg = Debug|Win32
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Debug|x86.Build.0 = Debug|Win32
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|ARM.ActiveCfg = Release|ARM
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|ARM.Build.0 = Release|ARM
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|ARM64.ActiveCfg = Release|ARM64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|ARM64.Build.0 = Release|ARM64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|x64.ActiveCfg = Release|x64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|x64.Build.0 = Release|x64
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|x86.ActiveCfg = Release|Win32
{2EF696B9-7F4A-410F-AE5C-5301565C0F08}.Release|x86.Build.0 = Release|Win32
{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA}.Debug|ARM.ActiveCfg = Debug|ARM
{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA}.Debug|ARM.Build.0 = Debug|ARM
{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA}.Debug|ARM64.ActiveCfg = Debug|ARM64
Expand Down Expand Up @@ -521,7 +498,6 @@ Global
{303CC0FE-7D66-4F9F-B7A1-0AF7F9359074} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{D48A96C2-8512-4CC3-B6E4-7CFF07ED8ED3} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{08C40663-B6A3-481E-8755-AE32BAD99501} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{2EF696B9-7F4A-410F-AE5C-5301565C0F08} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
EndGlobalSection
Expand Down
1 change: 0 additions & 1 deletion run_tests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if "%target_configuration%"=="" set target_configuration=Debug
call :run_test test
call :run_test test_cpp20
call :run_test test_cpp20_no_sourcelocation
call :run_test test_win7
call :run_test test_fast
call :run_test test_slow
call :run_test test_old
Expand Down
Loading

0 comments on commit de6ca88

Please sign in to comment.