Skip to content

Commit 5d89575

Browse files
fix: stringize VERSION_NUMBER for v-tags
1 parent e35a6bf commit 5d89575

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ jobs:
397397
# Use cmd to call vcvarsall and then cl
398398
$outName = "win-witr-${{ matrix.arch }}.exe"
399399
$verTag = "${{ needs.prepare.outputs.version }}"
400-
cmd /c "`"$vcvarsPath`" $vcvarsArch && cl /O2 /Ot /GL /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /DVERSION_NUMBER=`"$verTag`" /Fe:$outName"
400+
cmd /c "`"$vcvarsPath`" $vcvarsArch && cl /O2 /Ot /GL /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /DVERSION_NUMBER=$verTag /Fe:$outName"
401401
if ($LASTEXITCODE -ne 0) {
402402
Write-Host "Build failed with exit code $LASTEXITCODE"
403403
Exit $LASTEXITCODE

main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ This is kept as a bunch of strings to be easier to call than a dictionary, map,
9393
Less words to type ;)
9494
*/
9595
std::string forkAuthor = ""; // if this is a fork of this project, put your name here! Please be nice and leave my name too :)
96+
#define STRINGIZE2(x) #x
97+
#define STRINGIZE(x) STRINGIZE2(x)
9698
std::string version = []() {
9799
#ifdef VERSION_NUMBER
98-
return std::string(VERSION_NUMBER); // Release builds only
100+
return std::string(STRINGIZE(VERSION_NUMBER)); // Release builds only
99101
#else
100102
return std::string("dev-build"); // Local builds - no env var check
101103
#endif

0 commit comments

Comments
 (0)