Skip to content

Commit

Permalink
Push version into binary
Browse files Browse the repository at this point in the history
  • Loading branch information
asb2m10 committed Apr 7, 2024
1 parent d9130aa commit 7e6063c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/project-pipeline.yml
Expand Up @@ -109,14 +109,16 @@ jobs:
echo "BUILD_VERSION=${GITHUB_REF_NAME:1}" >> "$GITHUB_ENV"
else
echo "BUILD_TYPE=Debug" >> "$GITHUB_ENV"
echo "BUILD_VERSION=DEVBUILD" >> "$GITHUB_ENV"
echo "BUILD_VERSION=$GITHUB_REF_NAME" >> "$GITHUB_ENV"
echo "CMAKE_CXX_FLAGS='-D DEXED_ID=\"$BUILD_VERSION\"'" >> "$GITHUB_ENV"
fi
echo "BUILD PARM =========="
cat $GITHUB_ENV
- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DDEXED_ID=${{ env.BUILD_VERSION }}
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }}
- name: Show
Expand Down
4 changes: 3 additions & 1 deletion Source/Dexed.h
Expand Up @@ -23,7 +23,9 @@

void dexed_trace(const char *source, const char *fmt, ...);

#define DEXED_ID "DEVBUILD"
#ifndef DEXED_ID
#define DEXED_ID "DEVBUILD"
#endif

#ifdef DEBUG
#define DEXED_VERSION DEXED_ID " DEBUG"
Expand Down

0 comments on commit 7e6063c

Please sign in to comment.