mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-20 01:27:41 +08:00
Refactor Windows resource compiling
This commit is contained in:
29
justfile
29
justfile
@@ -2,12 +2,12 @@
|
||||
# --------------------------------------------------------------
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# --------------------------------------------------------------
|
||||
# Build File : justfile
|
||||
# File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
# Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
|
||||
# |
|
||||
# Build File : justfile
|
||||
# File Authors : 曾奥然 <ccmywish@qq.com>
|
||||
# Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
|
||||
# |
|
||||
# Created On : <2025-06-18>
|
||||
# Last Modified : <2025-10-11>
|
||||
# Last Modified : <2025-10-15>
|
||||
#
|
||||
# 该文件主要用于在原生Windows上执行项目的基本任务,而不借助于
|
||||
# GNU make 以及相应的 MSYS2、Cygwin 环境
|
||||
@@ -53,7 +53,7 @@ CFLAGS_chk_Clang := if os() == 'windows' {
|
||||
} else {''}
|
||||
|
||||
|
||||
CFLAGS_base := '-Iinclude -Ilib -Isrc/framework ' + CFLAGS_chk_Clang
|
||||
CFLAGS_base := '-Iinclude -Ilib ' + CFLAGS_chk_Clang
|
||||
|
||||
WARN := '-Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation' + ' ' + \
|
||||
'-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare'
|
||||
@@ -114,12 +114,17 @@ build-in-debug-mode:
|
||||
@echo Finished: Build in DEBUG mode
|
||||
|
||||
build-in-release-mode:
|
||||
@echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}}
|
||||
{{ if os() == 'windows' { '@if exist src\\res\\chsrc.res del src\\res\\chsrc.res' } else { '' } }}
|
||||
{{ if os() == 'windows' { '@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res' } else { '' } }}
|
||||
{{ if os() == 'windows' { '@' + CC + ' src/chsrc-main.c src/res/chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } else { '@' + CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } }}
|
||||
{{ if os() == 'windows' { '@del src\\res\\chsrc.res' } else { '' } }}
|
||||
@echo Finished: Build in RELEASE mode
|
||||
@echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}}
|
||||
@{{ if os() == 'windows' { \
|
||||
'if exist chsrc.res del chsrc.res' + \
|
||||
' & windres src/resource/chsrc.rc -O coff -o chsrc.res' \
|
||||
} else { '' } }}
|
||||
@{{ if os() == 'windows' { \
|
||||
CC + ' src/chsrc-main.c chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \
|
||||
} else { \
|
||||
CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \
|
||||
} }}
|
||||
@echo Finished: Build in RELEASE mode
|
||||
|
||||
debug: build-in-debug-mode
|
||||
@{{DEBUGGER}} {{DebugMode-Target-Name}}
|
||||
|
Reference in New Issue
Block a user