Skip to content

Commit 00b9aaa

Browse files
authored
Merge pull request #29 from matyalatte/support_ucrt
Support Universal CRT for Windows 10 or later
2 parents 5453bd0 + 6920dd9 commit 00b9aaa

File tree

8 files changed

+30
-7
lines changed

8 files changed

+30
-7
lines changed

.github/workflows/build_all.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Create Release Draft
3434
id: create-release
35-
uses: softprops/action-gh-release@v1
35+
uses: softprops/action-gh-release@v2
3636
with:
3737
tag_name: ${{ steps.check-tag.outputs.tag }}
3838
name: ${{ steps.check-tag.outputs.tag }}
@@ -64,6 +64,11 @@ jobs:
6464
zip_ext: zip
6565
arch: ARM
6666
arch_suffix: -arm64
67+
- os: windows-2022
68+
exe_ext: .exe
69+
zip_ext: zip
70+
arch: UCRT
71+
arch_suffix: -x64-ucrt
6772
- os: ubuntu-20.04
6873
exe_ext: ""
6974
zip_ext: tar.bz2
@@ -105,7 +110,6 @@ jobs:
105110
- name: Build exe for Windows
106111
if: runner.os == 'Windows'
107112
run: batch_files/build.bat Release ${{ matrix.arch }}
108-
109113
- name: Build exe for Unix
110114
if: runner.os != 'Windows'
111115
run: bash shell_scripts/build.sh Release

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
shell: bash
138138

139139
- name: Upload artifacts
140-
uses: actions/upload-artifact@v3
140+
uses: actions/upload-artifact@v4
141141
with:
142142
name: tests-windows-arm64
143143
path: workspace
@@ -147,7 +147,7 @@ jobs:
147147
needs: [lint, build_tests_windows_arm64]
148148
steps:
149149
- uses: actions/checkout@v4
150-
- uses: actions/download-artifact@v3
150+
- uses: actions/download-artifact@v4
151151
with:
152152
name: tests-windows-arm64
153153
path: workspace

batch_files/build.bat

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ if /I "%~2"=="ARM" (
1616
)
1717
)
1818

19+
if /I "%~2"=="UCRT" (
20+
set OPT="-Duse_ucrt=true"
21+
)
22+
1923
echo Build type: %BUILD_TYPE%
2024

2125
@pushd %~dp0\..
22-
meson setup build\%BUILD_TYPE%%~2 --backend=vs %PRESET%
26+
meson setup build\%BUILD_TYPE%%~2 --backend=vs %PRESET% %OPT%
2327
if %ERRORLEVEL% neq 0 goto :buildend
2428
cd build\%BUILD_TYPE%%~2
2529
meson compile -v

batch_files/build_with_ucrt.bat

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
REM Build with Universal CRT.
2+
REM This option makes exe much smaller. But the built binary only supports Windows10 or later.
3+
4+
@pushd %~dp0
5+
build.bat Release UCRT
6+
popd

docs/changelog.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ver 0.6.4
2+
- Added Universal CRT version for Windows 10 or later
13
- Fixed a bug that the execution button still says "processing" after getting errors.
24

35
ver 0.6.3

include/tuw_constants.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace tuw_constants {
1010
" CLI tools\n";
1111
constexpr char TOOL_NAME[] = "Tuw";
1212
constexpr char AUTHOR[] = "matyalatte";
13-
constexpr char VERSION[] = "0.6.3";
14-
constexpr int VERSION_INT = 603;
13+
constexpr char VERSION[] = "0.6.4";
14+
constexpr int VERSION_INT = 604;
1515

1616
#ifdef _WIN32
1717
constexpr char OS[] = "win";

meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ if tuw_OS == 'windows'
3434
'/INCREMENTAL:NO',
3535
'/ENTRY:wmainCRTStartup'
3636
]
37+
if get_option('use_ucrt')
38+
# These linker options make exe much smaller with UCRT,
39+
# but the built binary only supports Windows10 or later.
40+
tuw_link_args += ['/NODEFAULTLIB:libucrt.lib', '/DEFAULTLIB:ucrt.lib']
41+
endif
3742
if meson.version().version_compare('<1.4.0')
3843
tuw_link_args += ['/MANIFEST:NO']
3944
endif

meson_options.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ option('build_exe', type : 'boolean', value : true, description : 'Build executa
22
option('build_test', type : 'boolean', value : false, description : 'Build tests')
33
option('macosx_version_min', type : 'string', value : '10.9',
44
description : 'Deployment target for macOS. This will affect to subprojects')
5+
option('use_ucrt', type : 'boolean', value : false,
6+
description : 'Use Universal CRT for Windows 10 or later')

0 commit comments

Comments
 (0)