Skip to content

Commit

Permalink
优化了点预处理器和make的集成,CI修复
Browse files Browse the repository at this point in the history
  • Loading branch information
SourLemonJuice committed Jun 16, 2024
1 parent 3442a18 commit 458f6aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
branches: [ "main" ]
workflow_dispatch:
inputs:
release_build_arg:
Make_releaseBuild:
required: true
type: string
default: releaseBuild=0
type: number
default: 0

jobs:
build:
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Build with make
env:
CI_HOST_INFO: GitHub Build Workflow
run: make --directory="./source/" build_host_description="${CI_HOST_INFO} ID:${GITHUB_RUN_ID} for ${GITHUB_REF}"
run: make --directory="./source/" build_host_description="${CI_HOST_INFO} ID:${GITHUB_RUN_ID} for ${GITHUB_REF}" releaseBuild="${Make_releaseBuild}"
- name: Upload executable file
uses: actions/upload-artifact@v4
with:
Expand Down
11 changes: 8 additions & 3 deletions source/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@
For compiler defin flag(gcc -D)
Those macros should be defined by compiler
*/
// git info when building
#ifndef APP_GIT_COMMIT_INFO
#define APP_GIT_COMMIT_INFO "[Build ERROR] APP_GIT_COMMIT_INFO not defined"
#endif

// build host info
#ifndef APP_BUILD_HOST_DESCRIPTION
#define APP_BUILD_HOST_DESCRIPTION "[Build ERROR] APP_BUILD_HOST_DESCRIPTION not defined"
#endif

/* Self define */
// switch between release build mode...
#if APP_BUILD_RELEASE_MODE == 1
#define APP_VERSION_STRING "ver-1.0"
#else // ...and develop build
#elif APP_BUILD_RELEASE_MODE == 0 // ...and develop build
// cheating the code analyzer
#define APP_BUILD_RELEASE_MODE 0
#define APP_VERSION_STRING "Under Development"
#define APP_VERSION_STRING "Development"
#else
#error The macro APP_BUILD_RELEASE_MODE is set to non 0/1, go check make flags.
#endif

/* Self define */

/*
TODO I'm tired...
This size use for some input string preprocessor, like fscanf() or deletePunctuations()
Expand Down

0 comments on commit 458f6aa

Please sign in to comment.