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 ee9264e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 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:
required: true
type: string
default: releaseBuild=0
Make_releaseBuild_arg:
required: false
type: string
default: releaseBuild="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}" ${Make_releaseBuild_arg}
- 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 ee9264e

Please sign in to comment.